#define VERBOSE GNUNET_NO
-#define START_ARM GNUNET_YES
-
/**
* How long until we give up on passing the test?
*/
struct PeerContext
{
struct GNUNET_CONFIGURATION_Handle *cfg;
-#if START_ARM
struct GNUNET_OS_Process *arm_proc;
-#endif
};
struct Wanted
static int is_p2p;
-struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key = NULL;
+static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key;
static void
setup_peer (struct PeerContext *p, const char *cfgname)
{
+ char *binary;
+
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
-#if START_ARM
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm",
+ GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
"gnunet-service-arm",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
"-c", cfgname, NULL);
-#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
+ GNUNET_free (binary);
}
static void
stop_arm (struct PeerContext *p)
{
-#if START_ARM
if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK)
GNUNET_OS_process_get_pid (p->arm_proc));
GNUNET_OS_process_destroy (p->arm_proc);
p->arm_proc = NULL;
-#endif
GNUNET_CONFIGURATION_destroy (p->cfg);
}
"test-chat",
"-c",
"test_chat_data.conf",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
};
GNUNET_log_setup ("test_chat",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
if (strstr (argv[0], "p2p") != NULL)
{