diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-28 12:29:16 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-28 12:29:16 +0000 |
commit | 7b7e5f4ca0c3a0d924283148368dfd07449b170c (patch) | |
tree | 91d2e7f414709d5d86fd73a4e4a4f21c0d111a07 /src | |
parent | 07ec48898b06b41f6b7598a0c99c3a04c20dbc33 (diff) | |
download | gnunet-7b7e5f4ca0c3a0d924283148368dfd07449b170c.tar.gz gnunet-7b7e5f4ca0c3a0d924283148368dfd07449b170c.zip |
additional test
Diffstat (limited to 'src')
4 files changed, 109 insertions, 11 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index aad49299c..14ab82e5d 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -323,11 +323,6 @@ check_PROGRAMS = \ | |||
323 | $(HTTP_SERVER_PLUGIN_TEST) \ | 323 | $(HTTP_SERVER_PLUGIN_TEST) \ |
324 | $(HTTPS_SERVER_PLUGIN_TEST) \ | 324 | $(HTTPS_SERVER_PLUGIN_TEST) \ |
325 | test_transport_api_blacklisting \ | 325 | test_transport_api_blacklisting \ |
326 | test_transport_blacklisting_no_bl \ | ||
327 | test_transport_blacklisting_outbound_bl_full \ | ||
328 | test_transport_blacklisting_outbound_bl_plugin \ | ||
329 | test_transport_blacklisting_inbound_bl_plugin \ | ||
330 | test_transport_blacklisting_inbound_bl_full \ | ||
331 | test_transport_api_disconnect_tcp \ | 326 | test_transport_api_disconnect_tcp \ |
332 | test_transport_api_bidirectional_connect \ | 327 | test_transport_api_bidirectional_connect \ |
333 | test_transport_api_tcp \ | 328 | test_transport_api_tcp \ |
@@ -348,6 +343,12 @@ check_PROGRAMS = \ | |||
348 | $(HTTPS_API_TIMEOUT_TEST) \ | 343 | $(HTTPS_API_TIMEOUT_TEST) \ |
349 | $(WLAN_API_TEST) \ | 344 | $(WLAN_API_TEST) \ |
350 | test_transport_api_multi \ | 345 | test_transport_api_multi \ |
346 | test_transport_blacklisting_no_bl \ | ||
347 | test_transport_blacklisting_outbound_bl_full \ | ||
348 | test_transport_blacklisting_outbound_bl_plugin \ | ||
349 | test_transport_blacklisting_inbound_bl_plugin \ | ||
350 | test_transport_blacklisting_inbound_bl_full \ | ||
351 | test_transport_blacklisting_multiple_plugins \ | ||
351 | test_transport_api_manipulation_send_tcp \ | 352 | test_transport_api_manipulation_send_tcp \ |
352 | test_transport_api_manipulation_recv_tcp \ | 353 | test_transport_api_manipulation_recv_tcp \ |
353 | test_transport_api_reliability_tcp \ | 354 | test_transport_api_reliability_tcp \ |
@@ -378,11 +379,6 @@ TESTS = \ | |||
378 | $(UNIX_TEST) \ | 379 | $(UNIX_TEST) \ |
379 | $(WLAN_PLUGIN_TEST) \ | 380 | $(WLAN_PLUGIN_TEST) \ |
380 | test_transport_api_blacklisting \ | 381 | test_transport_api_blacklisting \ |
381 | test_transport_blacklisting_no_bl \ | ||
382 | test_transport_blacklisting_outbound_bl_full \ | ||
383 | test_transport_blacklisting_outbound_bl_plugin \ | ||
384 | test_transport_blacklisting_inbound_bl_plugin \ | ||
385 | test_transport_blacklisting_inbound_bl_full \ | ||
386 | test_transport_api_disconnect_tcp \ | 382 | test_transport_api_disconnect_tcp \ |
387 | test_transport_api_bidirectional_connect \ | 383 | test_transport_api_bidirectional_connect \ |
388 | test_transport_api_tcp \ | 384 | test_transport_api_tcp \ |
@@ -402,6 +398,12 @@ TESTS = \ | |||
402 | $(HTTPS_API_TIMEOUT_TEST) \ | 398 | $(HTTPS_API_TIMEOUT_TEST) \ |
403 | $(WLAN_API_TEST) \ | 399 | $(WLAN_API_TEST) \ |
404 | test_transport_api_multi \ | 400 | test_transport_api_multi \ |
401 | test_transport_blacklisting_no_bl \ | ||
402 | test_transport_blacklisting_outbound_bl_full \ | ||
403 | test_transport_blacklisting_outbound_bl_plugin \ | ||
404 | test_transport_blacklisting_inbound_bl_plugin \ | ||
405 | test_transport_blacklisting_inbound_bl_full \ | ||
406 | test_transport_blacklisting_multiple_plugins \ | ||
405 | test_transport_api_manipulation_send_tcp \ | 407 | test_transport_api_manipulation_send_tcp \ |
406 | test_transport_api_manipulation_recv_tcp \ | 408 | test_transport_api_manipulation_recv_tcp \ |
407 | test_transport_api_reliability_tcp \ | 409 | test_transport_api_reliability_tcp \ |
@@ -499,6 +501,16 @@ test_transport_blacklisting_inbound_bl_plugin_LDADD = \ | |||
499 | $(top_builddir)/src/util/libgnunetutil.la \ | 501 | $(top_builddir)/src/util/libgnunetutil.la \ |
500 | $(top_builddir)/src/transport/libgnunettransporttesting.la | 502 | $(top_builddir)/src/transport/libgnunettransporttesting.la |
501 | 503 | ||
504 | test_transport_blacklisting_multiple_plugins_SOURCES = \ | ||
505 | test_transport_blacklisting.c | ||
506 | test_transport_blacklisting_multiple_plugins_LDADD = \ | ||
507 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
508 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
509 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
510 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
511 | $(top_builddir)/src/transport/libgnunettransporttesting.la | ||
512 | |||
513 | |||
502 | test_transport_api_disconnect_tcp_SOURCES = \ | 514 | test_transport_api_disconnect_tcp_SOURCES = \ |
503 | test_transport_api_disconnect.c | 515 | test_transport_api_disconnect.c |
504 | test_transport_api_disconnect_tcp_LDADD = \ | 516 | test_transport_api_disconnect_tcp_LDADD = \ |
@@ -1031,5 +1043,7 @@ test_transport_blacklisting_cfg_blp_peer1_full.conf\ | |||
1031 | test_transport_blacklisting_cfg_blp_peer1_plugin.conf \ | 1043 | test_transport_blacklisting_cfg_blp_peer1_plugin.conf \ |
1032 | test_transport_blacklisting_cfg_blp_peer2_full.conf\ | 1044 | test_transport_blacklisting_cfg_blp_peer2_full.conf\ |
1033 | test_transport_blacklisting_cfg_blp_peer2_plugin.conf \ | 1045 | test_transport_blacklisting_cfg_blp_peer2_plugin.conf \ |
1046 | test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf \ | ||
1047 | test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf \ | ||
1034 | test_transport_api_http_reverse_peer1.conf \ | 1048 | test_transport_api_http_reverse_peer1.conf \ |
1035 | test_transport_api_http_reverse_peer2.conf | 1049 | test_transport_api_http_reverse_peer2.conf |
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c index 8423c641e..b75da26d1 100644 --- a/src/transport/test_transport_blacklisting.c +++ b/src/transport/test_transport_blacklisting.c | |||
@@ -242,6 +242,22 @@ run_stage (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
242 | p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_blacklisting_cfg_blp_peer2_plugin.conf", 2, | 242 | p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_blacklisting_cfg_blp_peer2_plugin.conf", 2, |
243 | NULL, NULL, NULL, &start_cb, NULL); | 243 | NULL, NULL, NULL, &start_cb, NULL); |
244 | } | 244 | } |
245 | else if (0 == strcmp(test_name, "test_transport_blacklisting_multiple_plugins")) | ||
246 | { | ||
247 | p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf", 1, | ||
248 | NULL, NULL, NULL, &start_cb, NULL); | ||
249 | |||
250 | p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf", 2, | ||
251 | NULL, NULL, NULL, &start_cb, NULL); | ||
252 | } | ||
253 | |||
254 | |||
255 | if ((NULL == p1) || (NULL == p2)) | ||
256 | { | ||
257 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start peers\n"); | ||
258 | ok = 1; | ||
259 | GNUNET_SCHEDULER_add_now (&end, NULL); | ||
260 | } | ||
245 | 261 | ||
246 | timeout_task = GNUNET_SCHEDULER_add_delayed (CONNECT_TIMEOUT, &connect_timeout, NULL); | 262 | timeout_task = GNUNET_SCHEDULER_add_delayed (CONNECT_TIMEOUT, &connect_timeout, NULL); |
247 | stage ++; | 263 | stage ++; |
@@ -270,7 +286,8 @@ run_stage (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
270 | (GNUNET_NO == started) ? "NOT STARTED" : "STARTED", | 286 | (GNUNET_NO == started) ? "NOT STARTED" : "STARTED", |
271 | (GNUNET_YES == connected) ? "CONNECTED" : "NOT CONNECTED"); | 287 | (GNUNET_YES == connected) ? "CONNECTED" : "NOT CONNECTED"); |
272 | 288 | ||
273 | if (0 == strcmp(test_name, "test_transport_blacklisting_no_bl")) | 289 | if ((0 == strcmp(test_name, "test_transport_blacklisting_no_bl")) || |
290 | (0 == strcmp(test_name, "test_transport_blacklisting_multiple_plugins"))) | ||
274 | { | 291 | { |
275 | if ((GNUNET_NO != started) && (GNUNET_YES == connected)) | 292 | if ((GNUNET_NO != started) && (GNUNET_YES == connected)) |
276 | ok = 0; | 293 | ok = 0; |
diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf new file mode 100644 index 000000000..ff78c6829 --- /dev/null +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf | |||
@@ -0,0 +1,34 @@ | |||
1 | @INLINE@ template_cfg_peer1.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-tcp-p1/ | ||
4 | |||
5 | [transport-tcp] | ||
6 | PORT = 12000 | ||
7 | TIMEOUT = 5 s | ||
8 | |||
9 | [arm] | ||
10 | PORT = 12005 | ||
11 | DEFAULTSERVICES = transport | ||
12 | UNIXPATH = /tmp/gnunet-p1-service-arm.sock | ||
13 | |||
14 | [statistics] | ||
15 | PORT = 12004 | ||
16 | UNIXPATH = /tmp/gnunet-p1-service-statistics.sock | ||
17 | |||
18 | [resolver] | ||
19 | PORT = 12003 | ||
20 | UNIXPATH = /tmp/gnunet-p1-service-resolver.sock | ||
21 | |||
22 | [peerinfo] | ||
23 | PORT = 12002 | ||
24 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | ||
25 | |||
26 | [transport] | ||
27 | #PREFIX = valgrind --leak-check=full | ||
28 | PORT = 12001 | ||
29 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | ||
30 | PLUGINS = tcp udp | ||
31 | |||
32 | [transport-blacklist-AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520] | ||
33 | P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G = tcp | ||
34 | \ No newline at end of file | ||
diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf new file mode 100644 index 000000000..58a6c70a0 --- /dev/null +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf | |||
@@ -0,0 +1,33 @@ | |||
1 | @INLINE@ template_cfg_peer2.conf | ||
2 | [PATHS] | ||
3 | SERVICEHOME = /tmp/test-transport/api-tcp-p2/ | ||
4 | |||
5 | [transport-tcp] | ||
6 | PORT = 12015 | ||
7 | TIMEOUT = 5 s | ||
8 | |||
9 | [arm] | ||
10 | PORT = 12014 | ||
11 | DEFAULTSERVICES = transport | ||
12 | UNIXPATH = /tmp/gnunet-p2-service-arm.sock | ||
13 | |||
14 | [statistics] | ||
15 | PORT = 12013 | ||
16 | UNIXPATH = /tmp/gnunet-p2-service-statistics.sock | ||
17 | |||
18 | [resolver] | ||
19 | PORT = 12012 | ||
20 | UNIXPATH = /tmp/gnunet-p2-service-resolver.sock | ||
21 | |||
22 | [peerinfo] | ||
23 | PORT = 12011 | ||
24 | UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | ||
25 | |||
26 | [transport] | ||
27 | #PREFIX = valgrind --leak-check=full | ||
28 | PORT = 12010 | ||
29 | PLUGINS = tcp udp | ||
30 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | ||
31 | |||
32 | [transport-blacklist-P565723JO1C2HSN6J29TAQ22MN6CI8HTMUU55T0FUQG4CMDGGEQ8UCNBKUMB94GC8R9G4FB2SF9LDOBAJ6AMINBP4JHHDD6L7VD801G] | ||
33 | AG2PHES1BARB9IJCPAMJTFPVJ5V3A72S3F2A8SBUB8DAQ2V0O3V8G6G2JU56FHGFOHMQVKBSQFV98TCGTC3RJ1NINP82G0RC00N1520 = tcp udp \ No newline at end of file | ||