From 481d9421fcb761679daea807e94dd147d35ea7a0 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Mon, 29 Mar 2010 17:05:32 +0000 Subject: remove debugging from testcases, testing now used gnunet-arm to run and stop gnunet, removes configs and directories by default. remote still needs tested --- src/testing/test_testing.c | 3 +-- src/testing/test_testing_connect.c | 4 ++-- src/testing/test_testing_group.c | 8 +++++++- src/testing/test_testing_topology.c | 6 +++++- src/testing/testing.c | 17 +++++++++++++---- src/testing/testing_group.c | 18 +++++++++--------- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/testing/test_testing.c b/src/testing/test_testing.c index 15b7e10ec..4a014de66 100644 --- a/src/testing/test_testing.c +++ b/src/testing/test_testing.c @@ -101,8 +101,7 @@ main (int argc, char *argv[]) #endif NULL); ret = check (); - sleep (1); /* FIXME: make this unnecessary */ - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing"); + return ret; } diff --git a/src/testing/test_testing_connect.c b/src/testing/test_testing_connect.c index 5cd6274ea..15cc695bc 100644 --- a/src/testing/test_testing_connect.c +++ b/src/testing/test_testing_connect.c @@ -170,10 +170,10 @@ main (int argc, char *argv[]) #endif NULL); ret = check (); - sleep (1); + /*sleep (1); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer2"); + GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer2");*/ return ret; } diff --git a/src/testing/test_testing_group.c b/src/testing/test_testing_group.c index 2b6df732e..1f21b64f4 100644 --- a/src/testing/test_testing_group.c +++ b/src/testing/test_testing_group.c @@ -109,7 +109,13 @@ main (int argc, char *argv[]) #endif NULL); ret = check (); - sleep (1); + /** + * Still need to remove the base testing directory here, + * because group starts will create subdirectories under this + * main dir. However, we no longer need to sleep, as the + * shutdown sequence won't return until everything is cleaned + * up. + */ GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing"); return ret; } diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index c3d9cfda8..7f5411fc4 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c @@ -619,7 +619,11 @@ main (int argc, char *argv[]) #endif NULL); ret = check (); - sleep (1); + + /** + * Need to remove base directory, subdirectories taken care + * of by the testing framework. + */ GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing"); GNUNET_free(our_binary_name); return ret; diff --git a/src/testing/testing.c b/src/testing/testing.c index a18e7b88b..a1bbb4f70 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -168,13 +168,13 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) /* start GNUnet on remote host */ if (NULL == d->hostname) { - d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", - "gnunet-service-arm", + d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm", + "gnunet-arm", "-c", d->cfgfile, #if DEBUG_TESTING "-L", "DEBUG", #endif - "-d", NULL); + "-s", NULL); } else { @@ -186,6 +186,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "ssh", dst, "gnunet-arm", +#if DEBUG_TESTING + "-L", "DEBUG", +#endif "-c", d->cfgfile, "-s", NULL); GNUNET_free (dst); } @@ -528,6 +531,9 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh", arg, "gnunet-arm", +#if DEBUG_TESTING + "-L", "DEBUG", +#endif "-c", d->cfgfile, "-e", "-d", NULL); /* Use -e to end arm, and -d to remove temp files */ @@ -541,7 +547,10 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, #endif d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm", "gnunet-arm", - "-c", d->cfgfile, "-e", NULL); +#if DEBUG_TESTING + "-L", "DEBUG", +#endif + "-c", d->cfgfile, "-e", "-d", NULL); } d->wait_runs = 0; diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 30c4fc886..96d2831d7 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -27,7 +27,7 @@ #include "gnunet_arm_service.h" #include "gnunet_testing_lib.h" -#define VERBOSE_TESTING GNUNET_YES +#define VERBOSE_TESTING GNUNET_NO /** * Lowest port used for GNUnet testing. Should be high enough to not @@ -213,8 +213,8 @@ update_config (void *cls, * Create a new configuration using the given configuration * as a template; however, each PORT in the existing cfg * must be renumbered by incrementing "*port". If we run - * out of "*port" numbers, return NULL. - * + * out of "*port" numbers, return NULL. + * * @param cfg template configuration * @param port port numbers to use, update to reflect * port numbers that were used @@ -330,9 +330,9 @@ create_small_world_ring(struct GNUNET_TESTING_PeerGroup *pg) int connect_attempts; logNModifier = 0.5; /* FIXME: default value? */ - if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg, + if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", - "LOGNMODIFIER", + "LOGNMODIFIER", &p_string)) { if (sscanf(p_string, "%lf", &logNModifier) != 1) @@ -500,7 +500,7 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg) square = floor (sqrt (pg->total)); rows = square; cols = square; - + percentage = 0.5; /* FIXME: default percentage? */ if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", @@ -842,7 +842,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg) if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string(pg->peers[pg_iter].daemon->cfg, "PATHS", "SERVICEHOME", &temp_service_path)) - { + { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("No `%s' specified in peer configuration in section `%s', cannot copy friends file!\n"), "SERVICEHOME", @@ -1134,7 +1134,7 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg) * adjusted to ensure that no two peers running on the same system * have the same port(s) in their respective configurations. * - * @param sched scheduler to use + * @param sched scheduler to use * @param cfg configuration template to use * @param total number of daemons to start * @param cb function to call on each daemon that was started @@ -1301,7 +1301,7 @@ GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, unsigned int pos /** * Shutdown all peers started in the given group. - * + * * @param pg handle to the peer group */ void -- cgit v1.2.3