From: Julius Bünger Date: Wed, 27 Dec 2017 14:42:55 +0000 (+0100) Subject: do not churn on most tests; add specific churn test X-Git-Tag: gnunet-0.11.0rc0~74 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=228e08b13cd1419f3f19f96bf1a2b50f14172c36;p=oweals%2Fgnunet.git do not churn on most tests; add specific churn test --- diff --git a/src/rps/Makefile.am b/src/rps/Makefile.am index e6c8cd929..68424557b 100644 --- a/src/rps/Makefile.am +++ b/src/rps/Makefile.am @@ -81,7 +81,8 @@ check_PROGRAMS = \ test_rps_seed_request \ test_rps_single_req \ test_rps_req_cancel \ - test_rps_seed_big + test_rps_seed_big \ + test_rps_churn endif ld_rps_test_lib = \ @@ -145,6 +146,9 @@ test_rps_req_cancel_LDADD = $(ld_rps_test_lib) test_rps_seed_big_SOURCES = $(rps_test_src) test_rps_seed_big_LDADD = $(ld_rps_test_lib) +test_rps_churn_SOURCES = $(rps_test_src) +test_rps_churn_LDADD = $(ld_rps_test_lib) + gnunet_rps_profiler_SOURCES = $(rps_test_src) gnunet_rps_profiler_LDADD = $(ld_rps_test_lib) diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 464b7a8db..b8f7588e1 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -344,6 +344,11 @@ struct SingleTestRun * Number of Requests to make. */ uint32_t num_requests; + + /** + * Run with churn + */ + int have_churn; } cur_test_run; /** @@ -1256,7 +1261,7 @@ static void profiler_cb (struct RPSPeer *rps_peer) { /* Start churn */ - if (NULL == churn_task) + if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task) { churn_task = GNUNET_SCHEDULER_add_delayed ( GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), @@ -1412,6 +1417,7 @@ main (int argc, char *argv[]) cur_test_run.pre_test = NULL; cur_test_run.reply_handle = default_reply_handle; cur_test_run.eval_cb = default_eval_cb; + cur_test_run.have_churn = GNUNET_YES; churn_task = NULL; timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); @@ -1446,6 +1452,7 @@ main (int argc, char *argv[]) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test single request\n"); cur_test_run.name = "test-rps-single-req"; cur_test_run.main_test = single_req_cb; + cur_test_run.have_churn = GNUNET_NO; } else if (strstr (argv[0], "_delayed_reqs") != NULL) @@ -1453,6 +1460,7 @@ main (int argc, char *argv[]) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test delayed requests\n"); cur_test_run.name = "test-rps-delayed-reqs"; cur_test_run.main_test = delay_req_cb; + cur_test_run.have_churn = GNUNET_NO; } else if (strstr (argv[0], "_seed_big") != NULL) @@ -1462,6 +1470,7 @@ main (int argc, char *argv[]) cur_test_run.name = "test-rps-seed-big"; cur_test_run.main_test = seed_big_cb; cur_test_run.eval_cb = no_eval; + cur_test_run.have_churn = GNUNET_NO; timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); } @@ -1470,6 +1479,7 @@ main (int argc, char *argv[]) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on a single peer\n"); cur_test_run.name = "test-rps-single-peer-seed"; cur_test_run.main_test = single_peer_seed_cb; + cur_test_run.have_churn = GNUNET_NO; } else if (strstr (argv[0], "_seed_request") != NULL) @@ -1477,6 +1487,7 @@ main (int argc, char *argv[]) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on multiple peers\n"); cur_test_run.name = "test-rps-seed-request"; cur_test_run.main_test = seed_req_cb; + cur_test_run.have_churn = GNUNET_NO; } else if (strstr (argv[0], "_seed") != NULL) @@ -1485,6 +1496,7 @@ main (int argc, char *argv[]) cur_test_run.name = "test-rps-seed"; cur_test_run.main_test = seed_cb; cur_test_run.eval_cb = no_eval; + cur_test_run.have_churn = GNUNET_NO; } else if (strstr (argv[0], "_req_cancel") != NULL) @@ -1494,6 +1506,17 @@ main (int argc, char *argv[]) num_peers = 1; cur_test_run.main_test = req_cancel_cb; cur_test_run.eval_cb = no_eval; + cur_test_run.have_churn = GNUNET_NO; + timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); + } + + else if (strstr (argv[0], "_churn") != NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test churn\n"); + cur_test_run.name = "test-rps-churn"; + num_peers = 5; + cur_test_run.main_test = single_req_cb; + cur_test_run.have_churn = GNUNET_YES; timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); } @@ -1510,6 +1533,7 @@ main (int argc, char *argv[]) cur_test_run.eval_cb = profiler_eval; cur_test_run.request_interval = 2; cur_test_run.num_requests = 5; + cur_test_run.have_churn = GNUNET_YES; timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); /* 'Clean' directory */