diff options
author | Julius Bünger <buenger@mytum.de> | 2018-10-11 14:48:02 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-10-11 14:48:02 +0200 |
commit | 2408ee6b254b5f67a6b50280dec6c66536abd1c1 (patch) | |
tree | 9af518049544dd4825f3490b0c29fff8e45248dc /src/rps | |
parent | 261dd70aa12d986e6f7b38c38f843621bcc47763 (diff) | |
download | gnunet-2408ee6b254b5f67a6b50280dec6c66536abd1c1.tar.gz gnunet-2408ee6b254b5f67a6b50280dec6c66536abd1c1.zip |
RPS Tests: Test Subs
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/.gitignore | 9 | ||||
-rw-r--r-- | src/rps/Makefile.am | 32 | ||||
-rw-r--r-- | src/rps/test_rps.c | 42 | ||||
-rw-r--r-- | src/rps/test_rps.conf | 2 |
4 files changed, 65 insertions, 20 deletions
diff --git a/src/rps/.gitignore b/src/rps/.gitignore index cb14f5b09..9e78e2ca0 100644 --- a/src/rps/.gitignore +++ b/src/rps/.gitignore | |||
@@ -1,15 +1,16 @@ | |||
1 | gnunet-service-rps | 1 | gnunet-service-rps |
2 | gnunet-rps | 2 | gnunet-rps |
3 | gnunet-rps-profiler | 3 | gnunet-rps-profiler |
4 | test_rps_malicious_1 | 4 | test_rps_single_req |
5 | test_rps_malicious_2 | ||
6 | test_rps_malicious_3 | ||
7 | test_rps_req_cancel | 5 | test_rps_req_cancel |
6 | test_rps_sub | ||
8 | test_rps_seed_big | 7 | test_rps_seed_big |
9 | test_rps_seed_request | 8 | test_rps_seed_request |
10 | test_rps_single_req | ||
11 | test_service_rps_custommap | 9 | test_service_rps_custommap |
12 | test_service_rps_sampler_elem | 10 | test_service_rps_sampler_elem |
13 | test_service_rps_view | 11 | test_service_rps_view |
14 | test_rps_churn | 12 | test_rps_churn |
15 | test_service_rps_peers | 13 | test_service_rps_peers |
14 | test_rps_malicious_1 | ||
15 | test_rps_malicious_2 | ||
16 | test_rps_malicious_3 | ||
diff --git a/src/rps/Makefile.am b/src/rps/Makefile.am index e973bb7ca..8d2ddf7d7 100644 --- a/src/rps/Makefile.am +++ b/src/rps/Makefile.am | |||
@@ -79,14 +79,15 @@ check_PROGRAMS = \ | |||
79 | test_service_rps_view \ | 79 | test_service_rps_view \ |
80 | test_service_rps_custommap \ | 80 | test_service_rps_custommap \ |
81 | test_service_rps_sampler_elem \ | 81 | test_service_rps_sampler_elem \ |
82 | test_rps_malicious_1 \ | ||
83 | test_rps_malicious_2 \ | ||
84 | test_rps_malicious_3 \ | ||
85 | test_rps_seed_request \ | ||
86 | test_rps_single_req \ | 82 | test_rps_single_req \ |
87 | test_rps_req_cancel \ | 83 | test_rps_req_cancel \ |
84 | test_rps_sub \ | ||
85 | test_rps_seed_request \ | ||
88 | test_rps_seed_big \ | 86 | test_rps_seed_big \ |
89 | test_rps_churn | 87 | test_rps_churn \ |
88 | test_rps_malicious_1 \ | ||
89 | test_rps_malicious_2 \ | ||
90 | test_rps_malicious_3 | ||
90 | endif | 91 | endif |
91 | 92 | ||
92 | rps_test_src = \ | 93 | rps_test_src = \ |
@@ -125,15 +126,6 @@ test_service_rps_sampler_elem_SOURCES = \ | |||
125 | test_service_rps_sampler_elem.c | 126 | test_service_rps_sampler_elem.c |
126 | test_service_rps_sampler_elem_LDADD = $(top_builddir)/src/util/libgnunetutil.la | 127 | test_service_rps_sampler_elem_LDADD = $(top_builddir)/src/util/libgnunetutil.la |
127 | 128 | ||
128 | test_rps_malicious_1_SOURCES = $(rps_test_src) | ||
129 | test_rps_malicious_1_LDADD = $(ld_rps_test_lib) | ||
130 | |||
131 | test_rps_malicious_2_SOURCES = $(rps_test_src) | ||
132 | test_rps_malicious_2_LDADD = $(ld_rps_test_lib) | ||
133 | |||
134 | test_rps_malicious_3_SOURCES = $(rps_test_src) | ||
135 | test_rps_malicious_3_LDADD = $(ld_rps_test_lib) | ||
136 | |||
137 | test_rps_single_req_SOURCES = $(rps_test_src) | 129 | test_rps_single_req_SOURCES = $(rps_test_src) |
138 | test_rps_single_req_LDADD = $(ld_rps_test_lib) | 130 | test_rps_single_req_LDADD = $(ld_rps_test_lib) |
139 | 131 | ||
@@ -143,12 +135,24 @@ test_rps_seed_request_LDADD = $(ld_rps_test_lib) | |||
143 | test_rps_req_cancel_SOURCES = $(rps_test_src) | 135 | test_rps_req_cancel_SOURCES = $(rps_test_src) |
144 | test_rps_req_cancel_LDADD = $(ld_rps_test_lib) | 136 | test_rps_req_cancel_LDADD = $(ld_rps_test_lib) |
145 | 137 | ||
138 | test_rps_sub_SOURCES = $(rps_test_src) | ||
139 | test_rps_sub_LDADD = $(ld_rps_test_lib) | ||
140 | |||
146 | test_rps_seed_big_SOURCES = $(rps_test_src) | 141 | test_rps_seed_big_SOURCES = $(rps_test_src) |
147 | test_rps_seed_big_LDADD = $(ld_rps_test_lib) | 142 | test_rps_seed_big_LDADD = $(ld_rps_test_lib) |
148 | 143 | ||
149 | test_rps_churn_SOURCES = $(rps_test_src) | 144 | test_rps_churn_SOURCES = $(rps_test_src) |
150 | test_rps_churn_LDADD = $(ld_rps_test_lib) | 145 | test_rps_churn_LDADD = $(ld_rps_test_lib) |
151 | 146 | ||
147 | test_rps_malicious_1_SOURCES = $(rps_test_src) | ||
148 | test_rps_malicious_1_LDADD = $(ld_rps_test_lib) | ||
149 | |||
150 | test_rps_malicious_2_SOURCES = $(rps_test_src) | ||
151 | test_rps_malicious_2_LDADD = $(ld_rps_test_lib) | ||
152 | |||
153 | test_rps_malicious_3_SOURCES = $(rps_test_src) | ||
154 | test_rps_malicious_3_LDADD = $(ld_rps_test_lib) | ||
155 | |||
152 | gnunet_rps_profiler_SOURCES = \ | 156 | gnunet_rps_profiler_SOURCES = \ |
153 | gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \ | 157 | gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \ |
154 | rps-sampler_common.h rps-sampler_common.c \ | 158 | rps-sampler_common.h rps-sampler_common.c \ |
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index ba0371f38..cbd3ba845 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c | |||
@@ -1544,6 +1544,31 @@ churn_test_cb (struct RPSPeer *rps_peer) | |||
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | /*********************************** | 1546 | /*********************************** |
1547 | * SUB | ||
1548 | ***********************************/ | ||
1549 | |||
1550 | void sub_post (struct RPSPeer *rps_peer) | ||
1551 | { | ||
1552 | GNUNET_RPS_sub_stop (rps_peer->rps_handle, "test"); | ||
1553 | } | ||
1554 | |||
1555 | static void | ||
1556 | sub_stop_op (void *cls) | ||
1557 | { | ||
1558 | struct GNUNET_RPS_Handle *h = cls; | ||
1559 | |||
1560 | GNUNET_RPS_sub_stop (h, "test"); | ||
1561 | } | ||
1562 | |||
1563 | static void | ||
1564 | sub_pre (struct RPSPeer *rps_peer, struct GNUNET_RPS_Handle *h) | ||
1565 | { | ||
1566 | (void) rps_peer; | ||
1567 | |||
1568 | GNUNET_RPS_sub_start (h, "test"); | ||
1569 | } | ||
1570 | |||
1571 | /*********************************** | ||
1547 | * PROFILER | 1572 | * PROFILER |
1548 | ***********************************/ | 1573 | ***********************************/ |
1549 | 1574 | ||
@@ -2873,7 +2898,22 @@ main (int argc, char *argv[]) | |||
2873 | cur_test_run.eval_cb = default_eval_cb; | 2898 | cur_test_run.eval_cb = default_eval_cb; |
2874 | cur_test_run.have_churn = HAVE_NO_CHURN; | 2899 | cur_test_run.have_churn = HAVE_NO_CHURN; |
2875 | cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; | 2900 | cur_test_run.have_quick_quit = HAVE_NO_QUICK_QUIT; |
2876 | timeout_s = 10; | 2901 | timeout_s = 40; |
2902 | } | ||
2903 | |||
2904 | else if (strstr (argv[0], "_sub") != NULL) | ||
2905 | { | ||
2906 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test subs\n"); | ||
2907 | cur_test_run.name = "test-rps-sub"; | ||
2908 | num_peers = 5; | ||
2909 | //cur_test_run.init_peer = &default_init_peer; | ||
2910 | cur_test_run.pre_test = &sub_pre; | ||
2911 | cur_test_run.main_test = &single_req_cb; | ||
2912 | //cur_test_run.reply_handle = default_reply_handle; | ||
2913 | cur_test_run.post_test = &sub_post; | ||
2914 | //cur_test_run.eval_cb = default_eval_cb; | ||
2915 | cur_test_run.have_churn = HAVE_NO_CHURN; | ||
2916 | cur_test_run.have_quick_quit = HAVE_QUICK_QUIT; | ||
2877 | } | 2917 | } |
2878 | 2918 | ||
2879 | else if (strstr (argv[0], "profiler") != NULL) | 2919 | else if (strstr (argv[0], "profiler") != NULL) |
diff --git a/src/rps/test_rps.conf b/src/rps/test_rps.conf index 84e0e5049..c55930649 100644 --- a/src/rps/test_rps.conf +++ b/src/rps/test_rps.conf | |||
@@ -12,7 +12,7 @@ NOARMBIND = YES | |||
12 | #OPTIONS=-l /tmp/rps_profiler_logs/rps-[]-%Y-%m-%d.log | 12 | #OPTIONS=-l /tmp/rps_profiler_logs/rps-[]-%Y-%m-%d.log |
13 | 13 | ||
14 | # This is the timeinterval between the rounds | 14 | # This is the timeinterval between the rounds |
15 | ROUNDINTERVAL = 2 s | 15 | ROUNDINTERVAL = 1 s |
16 | FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt | 16 | FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt |
17 | 17 | ||
18 | # This is the 'estimate' in the beginning. | 18 | # This is the 'estimate' in the beginning. |