aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-11-30 14:02:25 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-11-30 14:02:25 +0000
commite14f682ca1de9f26c90420dd33ffad215bfef45c (patch)
treed50cc2c185108ff448667cae87a923ed0e26b23a /src
parent28824d44aba065b4a0afe6c9ee8526d7d8082611 (diff)
downloadgnunet-e14f682ca1de9f26c90420dd33ffad215bfef45c.tar.gz
gnunet-e14f682ca1de9f26c90420dd33ffad215bfef45c.zip
added multi plugin transport api testcase
Diffstat (limited to 'src')
-rw-r--r--src/transport/Makefile.am10
-rw-r--r--src/transport/test_transport_api.c24
-rw-r--r--src/transport/test_transport_api_multi_peer1.conf132
-rw-r--r--src/transport/test_transport_api_multi_peer2.conf134
4 files changed, 298 insertions, 2 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 313d94854..e2d5acda8 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -200,6 +200,7 @@ check_PROGRAMS = \
200 $(HTTP_API_TEST) \ 200 $(HTTP_API_TEST) \
201 $(HTTPS_PLUGIN_TEST) \ 201 $(HTTPS_PLUGIN_TEST) \
202 $(HTTPS_API_TEST) \ 202 $(HTTPS_API_TEST) \
203 test_transport_api_multi \
203 test_transport_api_reliability_tcp \ 204 test_transport_api_reliability_tcp \
204 test_transport_api_reliability_tcp_nat \ 205 test_transport_api_reliability_tcp_nat \
205 test_transport_api_reliability_udp \ 206 test_transport_api_reliability_udp \
@@ -223,6 +224,7 @@ TESTS = \
223 $(HTTP_API_TEST) \ 224 $(HTTP_API_TEST) \
224 $(HTTPS_PLUGIN_TEST) \ 225 $(HTTPS_PLUGIN_TEST) \
225 $(HTTPS_API_TEST) \ 226 $(HTTPS_API_TEST) \
227 test_transport_api_multi \
226 test_transport_api_reliability_tcp \ 228 test_transport_api_reliability_tcp \
227 test_transport_api_reliability_tcp_nat \ 229 test_transport_api_reliability_tcp_nat \
228 $(HTTP_REL_TEST) \ 230 $(HTTP_REL_TEST) \
@@ -391,6 +393,12 @@ test_quota_compliance_udp_asymmetric_recv_constant_LDADD = \
391# $(top_builddir)/src/transport/libgnunettransport.la \ 393# $(top_builddir)/src/transport/libgnunettransport.la \
392# $(top_builddir)/src/util/libgnunetutil.la 394# $(top_builddir)/src/util/libgnunetutil.la
393 395
396test_transport_api_multi_SOURCES = \
397 test_transport_api.c
398test_transport_api_multi_LDADD = \
399 $(top_builddir)/src/transport/libgnunettransport.la \
400 $(top_builddir)/src/util/libgnunetutil.la
401
394endif 402endif
395 403
396 404
@@ -409,6 +417,8 @@ EXTRA_DIST = \
409 test_transport_api_http_peer2.conf \ 417 test_transport_api_http_peer2.conf \
410 test_transport_api_https_peer1.conf \ 418 test_transport_api_https_peer1.conf \
411 test_transport_api_https_peer2.conf \ 419 test_transport_api_https_peer2.conf \
420 test_transport_api_multi_peer1.conf \
421 test_transport_api_multi_peer2.conf \
412 test_transport_api_rel_http_peer1.conf \ 422 test_transport_api_rel_http_peer1.conf \
413 test_transport_api_rel_http_peer2.conf \ 423 test_transport_api_rel_http_peer2.conf \
414 test_transport_api_rel_https_peer1.conf \ 424 test_transport_api_rel_https_peer1.conf \
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 488471e7a..1f9c56974 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -82,6 +82,8 @@ static int is_http;
82 82
83static int is_https; 83static int is_https;
84 84
85static int is_multi_protocol;
86
85static GNUNET_SCHEDULER_TaskIdentifier die_task; 87static GNUNET_SCHEDULER_TaskIdentifier die_task;
86 88
87static char * key_file_p1; 89static char * key_file_p1;
@@ -344,6 +346,12 @@ run (void *cls,
344 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 346 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
345 &end_badly, NULL); 347 &end_badly, NULL);
346 348
349 if (is_multi_protocol)
350 {
351 setup_peer (&p1, "test_transport_api_multi_peer1.conf");
352 setup_peer (&p2, "test_transport_api_multi_peer2.conf");
353 }
354
347 if (is_udp) 355 if (is_udp)
348 { 356 {
349 setup_peer (&p1, "test_transport_api_udp_peer1.conf"); 357 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
@@ -559,10 +567,22 @@ main (int argc, char *argv[])
559 { 567 {
560 is_http = GNUNET_YES; 568 is_http = GNUNET_YES;
561 } 569 }
570 else if (strstr(argv[0], "multi") != NULL)
571 {
572 is_multi_protocol = GNUNET_YES;
573 }
562 574
563 ret = check (); 575 ret = check ();
564 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1"); 576 if (is_multi_protocol)
565 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2"); 577 {
578 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/");
579 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/");
580 }
581 else
582 {
583 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
584 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
585 }
566 return ret; 586 return ret;
567} 587}
568 588
diff --git a/src/transport/test_transport_api_multi_peer1.conf b/src/transport/test_transport_api_multi_peer1.conf
new file mode 100644
index 000000000..0208ac29e
--- /dev/null
+++ b/src/transport/test_transport_api_multi_peer1.conf
@@ -0,0 +1,132 @@
1[transport-tcp]
2DISABLEV6 = YES
3PORT = 30001
4BINDTO = 127.0.0.1
5BEHIND_NAT = NO
6ALLOW_NAT = NO
7ENABLE_UPNP = NO
8INTERNAL_ADDRESS = 127.0.0.1
9EXTERNAL_ADDRESS = 127.0.0.1
10
11[transport-udp]
12PORT = 30001
13
14[transport-http]
15PORT = 30002
16DEBUG = NO
17USE_IPv6 = YES
18USE_IPv4 = YES
19#BINDTO4 = 127.0.0.1
20#BINDTO6 = ::1
21
22[transport-https]
23PORT = 30003
24DEBUG = NO
25USE_IPv6 = YES
26USE_IPv4 = YES
27#BINDTO4 = 127.0.0.1
28#BINDTO6 = ::1
29
30[fs]
31AUTOSTART = NO
32
33[datastore]
34AUTOSTART = NO
35
36[core]
37AUTOSTART = NO
38
39[hostlist]
40HTTP-PROXY =
41SERVERS = http://gnunet.org:8080/
42OPTIONS = -b
43BINARY = gnunet-daemon-hostlist
44CONFIG = $DEFAULTCONFIG
45HOME = $SERVICEHOME
46HOSTNAME = localhost
47HTTPPORT = 8080
48
49[topology]
50BINARY = gnunet-daemon-topology
51CONFIG = $DEFAULTCONFIG
52FRIENDS = $SERVICEHOME/friends
53TARGET-CONNECTION-COUNT = 16
54AUTOCONNECT = YES
55FRIENDS-ONLY = NO
56MINIMUM-FRIENDS = 0
57
58[transport]
59PLUGINS = tcp udp http https
60#DEBUG = YES
61#PREFIX = xterm -T transport2 -e gdb --command=cmd --args
62#PREFIX = valgrind --tool=memcheck --leak-check=full --log-file=transport%p
63ACCEPT_FROM6 = ::1;
64ACCEPT_FROM = 127.0.0.1;
65NEIGHBOUR_LIMIT = 50
66BINARY = gnunet-service-transport
67#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
68CONFIG = $DEFAULTCONFIG
69HOME = $SERVICEHOME
70HOSTNAME = localhost
71PORT = 12365
72UNIXPATH = /tmp/gnunet-p1-service-transport.sock
73
74[peerinfo]
75TRUST = $SERVICEHOME/data/credit/
76HOSTS = $SERVICEHOME/data/hosts/
77ACCEPT_FROM6 = ::1;
78ACCEPT_FROM = 127.0.0.1;
79BINARY = gnunet-service-peerinfo
80CONFIG = $DEFAULTCONFIG
81HOME = $SERVICEHOME
82HOSTNAME = localhost
83PORT = 12369
84UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
85
86[resolver]
87ACCEPT_FROM6 = ::1;
88ACCEPT_FROM = 127.0.0.1;
89BINARY = gnunet-service-resolver
90CONFIG = $DEFAULTCONFIG
91HOME = $SERVICEHOME
92HOSTNAME = localhost
93PORT = 1236
94UNIXPATH = /tmp/gnunet-p1-service-resolver.sock
95
96[statistics]
97AUTOSTART = YES
98ACCEPT_FROM6 = ::1;
99ACCEPT_FROM = 127.0.0.1;
100BINARY = gnunet-service-statistics
101CONFIG = $DEFAULTCONFIG
102HOME = $SERVICEHOME
103HOSTNAME = localhost
104PORT = 12367
105UNIXPATH = /tmp/gnunet-p1-service-statistics.sock
106
107[arm]
108DEFAULTSERVICES = transport
109ACCEPT_FROM6 = ::1;
110ACCEPT_FROM = 127.0.0.1;
111BINARY = gnunet-service-arm
112CONFIG = $DEFAULTCONFIG
113HOME = $SERVICEHOME
114HOSTNAME = localhost
115PORT = 12366
116UNIXPATH = /tmp/gnunet-p1-service-arm.sock
117
118[TESTING]
119WEAKRANDOM = YES
120
121[gnunetd]
122HOSTKEY = $SERVICEHOME/.hostkey
123
124[PATHS]
125DEFAULTCONFIG = test_transport_api_multi_peer1.conf
126SERVICEHOME = /tmp/test-gnunetd-transport-multi-peer-1/
127
128
129[dht]
130AUTOSTART = NO
131
132
diff --git a/src/transport/test_transport_api_multi_peer2.conf b/src/transport/test_transport_api_multi_peer2.conf
new file mode 100644
index 000000000..d00f0a0be
--- /dev/null
+++ b/src/transport/test_transport_api_multi_peer2.conf
@@ -0,0 +1,134 @@
1[transport-tcp]
2DISABLEV6 = YES
3PORT = 0
4BINDTO = 127.0.0.1
5BEHIND_NAT = NO
6ALLOW_NAT = NO
7ENABLE_UPNP = NO
8EXTERNAL_ADDRESS = 127.0.0.1
9INTERNAL_ADDRESS = 127.0.0.1
10
11[transport-udp]
12PORT = 40001
13
14[transport-http]
15PORT = 40002
16DEBUG = NO
17USE_IPv6 = YES
18USE_IPv4 = YES
19#BINDTO4 = 127.0.0.1
20#BINDTO6 = ::1
21
22[transport-https]
23PORT = 40003
24DEBUG = NO
25USE_IPv6 = YES
26USE_IPv4 = YES
27#BINDTO4 = 127.0.0.1
28#BINDTO6 = ::1
29
30
31[core]
32AUTOSTART = NO
33
34[fs]
35AUTOSTART = NO
36
37[datastore]
38AUTOSTART = NO
39
40[hostlist]
41HTTP-PROXY =
42SERVERS = http://gnunet.org:8080/
43OPTIONS = -b
44BINARY = gnunet-daemon-hostlist
45CONFIG = $DEFAULTCONFIG
46HOME = $SERVICEHOME
47HOSTNAME = localhost
48HTTPPORT = 8080
49
50[topology]
51BINARY = gnunet-daemon-topology
52CONFIG = $DEFAULTCONFIG
53FRIENDS = $SERVICEHOME/friends
54TARGET-CONNECTION-COUNT = 16
55AUTOCONNECT = YES
56FRIENDS-ONLY = NO
57MINIMUM-FRIENDS = 0
58
59[transport]
60PLUGINS = tcp udp http https
61#DEBUG = YES
62ACCEPT_FROM6 = ::1;
63ACCEPT_FROM = 127.0.0.1;
64NEIGHBOUR_LIMIT = 50
65#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
66BINARY = gnunet-service-transport
67CONFIG = $DEFAULTCONFIG
68HOME = $SERVICEHOME
69HOSTNAME = localhost
70PORT = 22365
71UNIXPATH = /tmp/gnunet-p2-service-transport.sock
72#PREFIX = valgrind --tool=callgrind
73#PREFIX = xterm -T transport2 -e gdb --command=cmd --args
74#PREFIX = valgrind --leak-check=full
75
76[peerinfo]
77TRUST = $SERVICEHOME/data/credit/
78HOSTS = $SERVICEHOME/data/hosts/
79ACCEPT_FROM6 = ::1;
80ACCEPT_FROM = 127.0.0.1;
81BINARY = gnunet-service-peerinfo
82CONFIG = $DEFAULTCONFIG
83HOME = $SERVICEHOME
84HOSTNAME = localhost
85PORT = 22369
86UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
87
88[resolver]
89ACCEPT_FROM6 = ::1;
90ACCEPT_FROM = 127.0.0.1;
91BINARY = gnunet-service-resolver
92CONFIG = $DEFAULTCONFIG
93HOME = $SERVICEHOME
94HOSTNAME = localhost
95PORT = 22364
96UNIXPATH = /tmp/gnunet-p2-service-resolver.sock
97
98[statistics]
99AUTOSTART = YES
100ACCEPT_FROM6 = ::1;
101ACCEPT_FROM = 127.0.0.1;
102BINARY = gnunet-service-statistics
103CONFIG = $DEFAULTCONFIG
104HOME = $SERVICEHOME
105HOSTNAME = localhost
106PORT = 22367
107UNIXPATH = /tmp/gnunet-p2-service-statistics.sock
108
109[arm]
110DEFAULTSERVICES = transport
111ACCEPT_FROM6 = ::1;
112ACCEPT_FROM = 127.0.0.1;
113BINARY = gnunet-service-arm
114CONFIG = $DEFAULTCONFIG
115HOME = $SERVICEHOME
116HOSTNAME = localhost
117PORT = 22366
118UNIXPATH = /tmp/gnunet-p2-service-arm.sock
119
120[TESTING]
121WEAKRANDOM = YES
122
123[gnunetd]
124HOSTKEY = $SERVICEHOME/.hostkey
125
126[PATHS]
127DEFAULTCONFIG = test_transport_api_multi_peer2.conf
128SERVICEHOME = /tmp/test-gnunetd-transport-multi-peer-2/
129
130
131[dht]
132AUTOSTART = NO
133
134