diff options
author | Julius Bünger <buenger@mytum.de> | 2017-12-27 15:42:55 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2017-12-27 15:42:55 +0100 |
commit | 228e08b13cd1419f3f19f96bf1a2b50f14172c36 (patch) | |
tree | 45a7416c81cc20c206855897e99b4d81440fb408 | |
parent | c740c81d864cd6f60e4db22f962d5c9b0947f8a5 (diff) | |
download | gnunet-228e08b13cd1419f3f19f96bf1a2b50f14172c36.tar.gz gnunet-228e08b13cd1419f3f19f96bf1a2b50f14172c36.zip |
do not churn on most tests; add specific churn test
-rw-r--r-- | src/rps/Makefile.am | 6 | ||||
-rw-r--r-- | src/rps/test_rps.c | 26 |
2 files changed, 30 insertions, 2 deletions
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 = \ | |||
81 | test_rps_seed_request \ | 81 | test_rps_seed_request \ |
82 | test_rps_single_req \ | 82 | test_rps_single_req \ |
83 | test_rps_req_cancel \ | 83 | test_rps_req_cancel \ |
84 | test_rps_seed_big | 84 | test_rps_seed_big \ |
85 | test_rps_churn | ||
85 | endif | 86 | endif |
86 | 87 | ||
87 | ld_rps_test_lib = \ | 88 | ld_rps_test_lib = \ |
@@ -145,6 +146,9 @@ test_rps_req_cancel_LDADD = $(ld_rps_test_lib) | |||
145 | test_rps_seed_big_SOURCES = $(rps_test_src) | 146 | test_rps_seed_big_SOURCES = $(rps_test_src) |
146 | test_rps_seed_big_LDADD = $(ld_rps_test_lib) | 147 | test_rps_seed_big_LDADD = $(ld_rps_test_lib) |
147 | 148 | ||
149 | test_rps_churn_SOURCES = $(rps_test_src) | ||
150 | test_rps_churn_LDADD = $(ld_rps_test_lib) | ||
151 | |||
148 | gnunet_rps_profiler_SOURCES = $(rps_test_src) | 152 | gnunet_rps_profiler_SOURCES = $(rps_test_src) |
149 | gnunet_rps_profiler_LDADD = $(ld_rps_test_lib) | 153 | gnunet_rps_profiler_LDADD = $(ld_rps_test_lib) |
150 | 154 | ||
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 | |||
344 | * Number of Requests to make. | 344 | * Number of Requests to make. |
345 | */ | 345 | */ |
346 | uint32_t num_requests; | 346 | uint32_t num_requests; |
347 | |||
348 | /** | ||
349 | * Run with churn | ||
350 | */ | ||
351 | int have_churn; | ||
347 | } cur_test_run; | 352 | } cur_test_run; |
348 | 353 | ||
349 | /** | 354 | /** |
@@ -1256,7 +1261,7 @@ static void | |||
1256 | profiler_cb (struct RPSPeer *rps_peer) | 1261 | profiler_cb (struct RPSPeer *rps_peer) |
1257 | { | 1262 | { |
1258 | /* Start churn */ | 1263 | /* Start churn */ |
1259 | if (NULL == churn_task) | 1264 | if (GNUNET_YES == cur_test_run.have_churn && NULL == churn_task) |
1260 | { | 1265 | { |
1261 | churn_task = GNUNET_SCHEDULER_add_delayed ( | 1266 | churn_task = GNUNET_SCHEDULER_add_delayed ( |
1262 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), | 1267 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5), |
@@ -1412,6 +1417,7 @@ main (int argc, char *argv[]) | |||
1412 | cur_test_run.pre_test = NULL; | 1417 | cur_test_run.pre_test = NULL; |
1413 | cur_test_run.reply_handle = default_reply_handle; | 1418 | cur_test_run.reply_handle = default_reply_handle; |
1414 | cur_test_run.eval_cb = default_eval_cb; | 1419 | cur_test_run.eval_cb = default_eval_cb; |
1420 | cur_test_run.have_churn = GNUNET_YES; | ||
1415 | churn_task = NULL; | 1421 | churn_task = NULL; |
1416 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); | 1422 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); |
1417 | 1423 | ||
@@ -1446,6 +1452,7 @@ main (int argc, char *argv[]) | |||
1446 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test single request\n"); | 1452 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test single request\n"); |
1447 | cur_test_run.name = "test-rps-single-req"; | 1453 | cur_test_run.name = "test-rps-single-req"; |
1448 | cur_test_run.main_test = single_req_cb; | 1454 | cur_test_run.main_test = single_req_cb; |
1455 | cur_test_run.have_churn = GNUNET_NO; | ||
1449 | } | 1456 | } |
1450 | 1457 | ||
1451 | else if (strstr (argv[0], "_delayed_reqs") != NULL) | 1458 | else if (strstr (argv[0], "_delayed_reqs") != NULL) |
@@ -1453,6 +1460,7 @@ main (int argc, char *argv[]) | |||
1453 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test delayed requests\n"); | 1460 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test delayed requests\n"); |
1454 | cur_test_run.name = "test-rps-delayed-reqs"; | 1461 | cur_test_run.name = "test-rps-delayed-reqs"; |
1455 | cur_test_run.main_test = delay_req_cb; | 1462 | cur_test_run.main_test = delay_req_cb; |
1463 | cur_test_run.have_churn = GNUNET_NO; | ||
1456 | } | 1464 | } |
1457 | 1465 | ||
1458 | else if (strstr (argv[0], "_seed_big") != NULL) | 1466 | else if (strstr (argv[0], "_seed_big") != NULL) |
@@ -1462,6 +1470,7 @@ main (int argc, char *argv[]) | |||
1462 | cur_test_run.name = "test-rps-seed-big"; | 1470 | cur_test_run.name = "test-rps-seed-big"; |
1463 | cur_test_run.main_test = seed_big_cb; | 1471 | cur_test_run.main_test = seed_big_cb; |
1464 | cur_test_run.eval_cb = no_eval; | 1472 | cur_test_run.eval_cb = no_eval; |
1473 | cur_test_run.have_churn = GNUNET_NO; | ||
1465 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); | 1474 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); |
1466 | } | 1475 | } |
1467 | 1476 | ||
@@ -1470,6 +1479,7 @@ main (int argc, char *argv[]) | |||
1470 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on a single peer\n"); | 1479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on a single peer\n"); |
1471 | cur_test_run.name = "test-rps-single-peer-seed"; | 1480 | cur_test_run.name = "test-rps-single-peer-seed"; |
1472 | cur_test_run.main_test = single_peer_seed_cb; | 1481 | cur_test_run.main_test = single_peer_seed_cb; |
1482 | cur_test_run.have_churn = GNUNET_NO; | ||
1473 | } | 1483 | } |
1474 | 1484 | ||
1475 | else if (strstr (argv[0], "_seed_request") != NULL) | 1485 | else if (strstr (argv[0], "_seed_request") != NULL) |
@@ -1477,6 +1487,7 @@ main (int argc, char *argv[]) | |||
1477 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on multiple peers\n"); | 1487 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test seeding and requesting on multiple peers\n"); |
1478 | cur_test_run.name = "test-rps-seed-request"; | 1488 | cur_test_run.name = "test-rps-seed-request"; |
1479 | cur_test_run.main_test = seed_req_cb; | 1489 | cur_test_run.main_test = seed_req_cb; |
1490 | cur_test_run.have_churn = GNUNET_NO; | ||
1480 | } | 1491 | } |
1481 | 1492 | ||
1482 | else if (strstr (argv[0], "_seed") != NULL) | 1493 | else if (strstr (argv[0], "_seed") != NULL) |
@@ -1485,6 +1496,7 @@ main (int argc, char *argv[]) | |||
1485 | cur_test_run.name = "test-rps-seed"; | 1496 | cur_test_run.name = "test-rps-seed"; |
1486 | cur_test_run.main_test = seed_cb; | 1497 | cur_test_run.main_test = seed_cb; |
1487 | cur_test_run.eval_cb = no_eval; | 1498 | cur_test_run.eval_cb = no_eval; |
1499 | cur_test_run.have_churn = GNUNET_NO; | ||
1488 | } | 1500 | } |
1489 | 1501 | ||
1490 | else if (strstr (argv[0], "_req_cancel") != NULL) | 1502 | else if (strstr (argv[0], "_req_cancel") != NULL) |
@@ -1494,6 +1506,17 @@ main (int argc, char *argv[]) | |||
1494 | num_peers = 1; | 1506 | num_peers = 1; |
1495 | cur_test_run.main_test = req_cancel_cb; | 1507 | cur_test_run.main_test = req_cancel_cb; |
1496 | cur_test_run.eval_cb = no_eval; | 1508 | cur_test_run.eval_cb = no_eval; |
1509 | cur_test_run.have_churn = GNUNET_NO; | ||
1510 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); | ||
1511 | } | ||
1512 | |||
1513 | else if (strstr (argv[0], "_churn") != NULL) | ||
1514 | { | ||
1515 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test churn\n"); | ||
1516 | cur_test_run.name = "test-rps-churn"; | ||
1517 | num_peers = 5; | ||
1518 | cur_test_run.main_test = single_req_cb; | ||
1519 | cur_test_run.have_churn = GNUNET_YES; | ||
1497 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); | 1520 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10); |
1498 | } | 1521 | } |
1499 | 1522 | ||
@@ -1510,6 +1533,7 @@ main (int argc, char *argv[]) | |||
1510 | cur_test_run.eval_cb = profiler_eval; | 1533 | cur_test_run.eval_cb = profiler_eval; |
1511 | cur_test_run.request_interval = 2; | 1534 | cur_test_run.request_interval = 2; |
1512 | cur_test_run.num_requests = 5; | 1535 | cur_test_run.num_requests = 5; |
1536 | cur_test_run.have_churn = GNUNET_YES; | ||
1513 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); | 1537 | timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90); |
1514 | 1538 | ||
1515 | /* 'Clean' directory */ | 1539 | /* 'Clean' directory */ |