From: Nathan S. Evans Date: Wed, 31 Mar 2010 12:55:29 +0000 (+0000) Subject: more tweaks to allow testing to actually work X-Git-Tag: initial-import-from-subversion-38251~22341 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=64c8d1d569a6ab537bdb9e18c95d434a36d4b60a;p=oweals%2Fgnunet.git more tweaks to allow testing to actually work --- diff --git a/src/testing/testing.c b/src/testing/testing.c index 5d88a4229..7f6ff3fd2 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -531,7 +531,7 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, { #if DEBUG_TESTING GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Stopping gnunet-arm on with config `%s' on host `%s'.\n", d->cfgfile, d->hostname); + "Stopping gnunet-arm with config `%s' on host `%s'.\n", d->cfgfile, d->hostname); #endif if (d->username != NULL) diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 6815f99ff..7c2cd658a 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -183,6 +183,7 @@ struct ConnectContext */ static int outstanding_connects; + /** * Function to iterate over options. Copies * the options to the target configuration, @@ -209,7 +210,7 @@ update_config (void *cls, if ((0 == strcmp (option, "HOSTNAME")) && (ctx->hostname != NULL)) { - GNUNET_CONFIGURATION_set_value_string (ctx->ret, section, option, ctx->hostname); + value = ctx->hostname; } GNUNET_CONFIGURATION_set_value_string (ctx->ret, section, option, value); @@ -250,13 +251,22 @@ make_config (const struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t * port, con if (GNUNET_CONFIGURATION_get_value_string(cfg, "testing", "control_host", &control_host) == GNUNET_OK) { - GNUNET_asprintf(&allowed_hosts, "%s; 127.0.0.1;", control_host); - fprintf(stderr, "FOUND CONTROL_HOST OPTION %s, setting to %s\n", control_host, allowed_hosts); + GNUNET_asprintf(&allowed_hosts, "%s 127.0.0.1;", control_host); GNUNET_CONFIGURATION_set_value_string(uc.ret, "core", "ACCEPT_FROM", allowed_hosts); GNUNET_free_non_null(control_host); GNUNET_free(allowed_hosts); } + + /* arm needs to know to allow connections from the host on which it is running, + * otherwise gnunet-arm is unable to connect to it in some instances */ + if (hostname != NULL) + { + GNUNET_asprintf(&allowed_hosts, "%s; 127.0.0.1;", hostname); + GNUNET_CONFIGURATION_set_value_string(uc.ret, "arm", "ACCEPT_FROM", allowed_hosts); + GNUNET_free(allowed_hosts); + } + *port = (uint16_t) uc.nport; return uc.ret; } @@ -1266,6 +1276,7 @@ GNUNET_TESTING_daemons_start (struct GNUNET_SCHEDULER_Handle *sched, hostname = NULL; pcfg = make_config (cfg, &minport, hostname); } + if (NULL == pcfg) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING,