aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-10-29 12:22:33 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-10-29 12:22:33 +0000
commit3c96ac35df35d267713bd89a0bc9cd8df99215bc (patch)
tree5ae259ba3a16f34774d7377a29e2a989b56556c6
parentd028f7bccb02874f92c60127c5dbd90112a79202 (diff)
downloadgnunet-3c96ac35df35d267713bd89a0bc9cd8df99215bc.tar.gz
gnunet-3c96ac35df35d267713bd89a0bc9cd8df99215bc.zip
Adding quota compliance test for http
-rw-r--r--src/transport/Makefile.am22
-rw-r--r--src/transport/test_quota_compliance.c24
-rw-r--r--src/transport/test_quota_compliance_http_peer1.conf108
-rw-r--r--src/transport/test_quota_compliance_http_peer2.conf117
-rw-r--r--src/transport/test_quota_compliance_tcp_peer1.conf (renamed from src/transport/test_quota_compliance_peer1.conf)4
-rw-r--r--src/transport/test_quota_compliance_tcp_peer2.conf (renamed from src/transport/test_quota_compliance_peer2.conf)2
6 files changed, 256 insertions, 21 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 3fae21572..067e882a2 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -201,7 +201,8 @@ check_PROGRAMS = \
201 test_transport_api_reliability_udp \ 201 test_transport_api_reliability_udp \
202 $(HTTP_REL_TEST) \ 202 $(HTTP_REL_TEST) \
203 $(HTTPS_REL_TEST) \ 203 $(HTTPS_REL_TEST) \
204 test_quota_compliance 204 test_quota_compliance_tcp \
205 test_quota_compliance_http
205# TODO: add tests for nat, etc. 206# TODO: add tests for nat, etc.
206 207
207if !DISABLE_TEST_RUN 208if !DISABLE_TEST_RUN
@@ -218,7 +219,8 @@ TESTS = \
218 test_transport_api_reliability_tcp_nat \ 219 test_transport_api_reliability_tcp_nat \
219 $(HTTP_REL_TEST) \ 220 $(HTTP_REL_TEST) \
220 $(HTTPS_REL_TEST) \ 221 $(HTTPS_REL_TEST) \
221 test_quota_compliance 222 test_quota_compliance_tcp \
223 test_quota_compliance_http
222endif 224endif
223 225
224test_transport_api_tcp_SOURCES = \ 226test_transport_api_tcp_SOURCES = \
@@ -305,9 +307,15 @@ test_transport_api_reliability_https_LDADD = \
305 $(top_builddir)/src/transport/libgnunettransport.la \ 307 $(top_builddir)/src/transport/libgnunettransport.la \
306 $(top_builddir)/src/util/libgnunetutil.la 308 $(top_builddir)/src/util/libgnunetutil.la
307 309
308test_quota_compliance_SOURCES = \ 310test_quota_compliance_tcp_SOURCES = \
309 test_quota_compliance.c 311 test_quota_compliance.c
310test_quota_compliance_LDADD = \ 312test_quota_compliance_tcp_LDADD = \
313 $(top_builddir)/src/transport/libgnunettransport.la \
314 $(top_builddir)/src/util/libgnunetutil.la
315
316test_quota_compliance_http_SOURCES = \
317 test_quota_compliance.c
318test_quota_compliance_http_LDADD = \
311 $(top_builddir)/src/transport/libgnunettransport.la \ 319 $(top_builddir)/src/transport/libgnunettransport.la \
312 $(top_builddir)/src/util/libgnunetutil.la 320 $(top_builddir)/src/util/libgnunetutil.la
313 321
@@ -335,5 +343,7 @@ EXTRA_DIST = \
335 test_plugin_transport_data_http.conf \ 343 test_plugin_transport_data_http.conf \
336 test_plugin_transport_data.conf \ 344 test_plugin_transport_data.conf \
337 test_quota_compliance_data.conf \ 345 test_quota_compliance_data.conf \
338 test_quota_compliance_peer1.conf \ 346 test_quota_compliance_tcp_peer1.conf \
339 test_quota_compliance_peer2.conf \ No newline at end of file 347 test_quota_compliance_tcp_peer2.conf \
348 test_quota_compliance_http_peer1.conf \
349 test_quota_compliance_http_peer2.conf \ No newline at end of file
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 5a41f20ca..0c5acbdc3 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -578,31 +578,33 @@ run (void *cls,
578 send_running = GNUNET_NO; 578 send_running = GNUNET_NO;
579 recv_running = GNUNET_NO; 579 recv_running = GNUNET_NO;
580 580
581
582 if (is_tcp) 581 if (is_tcp)
583 { 582 {
584 setup_peer (&p1, "test_quota_compliance_peer1.conf"); 583 setup_peer (&p1, "test_quota_compliance_tcp_peer1.conf");
585 setup_peer (&p2, "test_quota_compliance_peer2.conf"); 584 setup_peer (&p2, "test_quota_compliance_tcp_peer2.conf");
586 } 585 }
587 else if (is_http) 586 else if (is_http)
588 { 587 {
589 setup_peer (&p1, "test_quota_compliance_peer1.conf"); 588 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
590 setup_peer (&p2, "test_quota_compliance_peer2.conf"); 589 "is_http: %u \n",
590 is_http);
591 setup_peer (&p1, "test_quota_compliance_http_peer1.conf");
592 setup_peer (&p2, "test_quota_compliance_http_peer2.conf");
591 } 593 }
592 else if (is_https) 594 else if (is_https)
593 { 595 {
594 setup_peer (&p1, "test_quota_compliance_peer1.conf"); 596 setup_peer (&p1, "test_quota_compliance_tcp_peer1.conf");
595 setup_peer (&p2, "test_quota_compliance_peer2.conf"); 597 setup_peer (&p2, "test_quota_compliance_tcp_peer2.conf");
596 } 598 }
597 else if (is_udp) 599 else if (is_udp)
598 { 600 {
599 setup_peer (&p1, "test_quota_compliance_peer1.conf"); 601 setup_peer (&p1, "test_quota_compliance_tcp_peer1.conf");
600 setup_peer (&p2, "test_quota_compliance_peer2.conf"); 602 setup_peer (&p2, "test_quota_compliance_tcp_peer2.conf");
601 } 603 }
602 else if (is_tcp_nat) 604 else if (is_tcp_nat)
603 { 605 {
604 setup_peer (&p1, "test_quota_compliance_peer1.conf"); 606 setup_peer (&p1, "test_quota_compliance_tcp_peer1.conf");
605 setup_peer (&p2, "test_quota_compliance_peer2.conf"); 607 setup_peer (&p2, "test_quota_compliance_tcp_peer2.conf");
606 } 608 }
607 else 609 else
608 GNUNET_assert (0); 610 GNUNET_assert (0);
diff --git a/src/transport/test_quota_compliance_http_peer1.conf b/src/transport/test_quota_compliance_http_peer1.conf
new file mode 100644
index 000000000..190410d91
--- /dev/null
+++ b/src/transport/test_quota_compliance_http_peer1.conf
@@ -0,0 +1,108 @@
1[PATHS]
2SERVICEHOME = /tmp/test_quota_compliance_peer1/
3DEFAULTCONFIG = test_quota_compliance_http_peer1.conf
4
5[fs]
6AUTOSTART = NO
7
8[datastore]
9AUTOSTART = NO
10
11[hostlist]
12HTTP-PROXY =
13SERVERS = http://gnunet.org:8080/
14OPTIONS = -b
15BINARY = gnunet-daemon-hostlist
16CONFIG = $DEFAULTCONFIG
17HOME = $SERVICEHOME
18HOSTNAME = localhost
19HTTPPORT = 8080
20
21[topology]
22BINARY = gnunet-daemon-topology
23CONFIG = $DEFAULTCONFIG
24FRIENDS = $SERVICEHOME/friends
25TARGET-CONNECTION-COUNT = 16
26AUTOCONNECT = YES
27FRIENDS-ONLY = NO
28MINIMUM-FRIENDS = 0
29
30[core]
31AUTOSTART = NO
32
33[transport-http]
34PORT = 4389
35DEBUG = NO
36USE_IPv4 = YES
37USE_IPv6 = NO
38BINDTO4 = 127.0.0.1
39#BINDTO6 = ::1
40
41[transport]
42plugins = http
43#DEBUG = YES
44PREFIX =
45ACCEPT_FROM6 = ::1;
46ACCEPT_FROM = 127.0.0.1;
47NEIGHBOUR_LIMIT = 50
48BINARY = gnunet-service-transport
49CONFIG = $DEFAULTCONFIG
50HOME = $SERVICEHOME
51HOSTNAME = localhost
52PORT = 4091
53UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_transport_peer1.sock
54
55[peerinfo]
56TRUST = $SERVICEHOME/data/credit/
57HOSTS = $SERVICEHOME/data/hosts/
58ACCEPT_FROM6 = ::1;
59ACCEPT_FROM = 127.0.0.1;
60BINARY = gnunet-service-peerinfo
61CONFIG = $DEFAULTCONFIG
62HOME = $SERVICEHOME
63HOSTNAME = localhost
64PORT = 4090
65UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_peerinfo_peer1.sock
66
67[resolver]
68ACCEPT_FROM6 = ::1;
69ACCEPT_FROM = 127.0.0.1;
70BINARY = gnunet-service-resolver
71CONFIG = $DEFAULTCONFIG
72HOME = $SERVICEHOME
73HOSTNAME = localhost
74PORT = 4089
75UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_resolver_peer1.sock
76
77[statistics]
78ACCEPT_FROM6 = ::1;
79ACCEPT_FROM = 127.0.0.1;
80BINARY = gnunet-service-statistics
81CONFIG = $DEFAULTCONFIG
82HOME = $SERVICEHOME
83HOSTNAME = localhost
84PORT = 4088
85UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_statistics_peer1.sock
86
87[arm]
88DEFAULTSERVICES =
89ACCEPT_FROM6 = ::1;
90ACCEPT_FROM = 127.0.0.1;
91BINARY = gnunet-service-arm
92CONFIG = $DEFAULTCONFIG
93HOME = $SERVICEHOME
94HOSTNAME = localhost
95PORT = 4087
96UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_arm_peer1.sock
97
98[TESTING]
99WEAKRANDOM = YES
100
101[gnunetd]
102HOSTKEY = $SERVICEHOME/.hostkey
103
104
105[dht]
106AUTOSTART = NO
107
108
diff --git a/src/transport/test_quota_compliance_http_peer2.conf b/src/transport/test_quota_compliance_http_peer2.conf
new file mode 100644
index 000000000..b69e77200
--- /dev/null
+++ b/src/transport/test_quota_compliance_http_peer2.conf
@@ -0,0 +1,117 @@
1[PATHS]
2SERVICEHOME = /tmp/test_quota_compliance_peer2
3DEFAULTCONFIG = test_quota_compliance_http_peer2.conf
4
5[transport-http]
6PORT = 3389
7DEBUG = NO
8USE_IPv4 = YES
9USE_IPv6 = NO
10BINDTO4 = 127.0.0.1
11#BINDTO6 = ::1
12
13
14[transport-udp]
15PORT = 3094
16
17[transport-tcp]
18TIMEOUT = 300000
19PORT = 3094
20BINDTO = 127.0.0.1
21
22[fs]
23AUTOSTART = NO
24
25[datastore]
26AUTOSTART = NO
27
28[hostlist]
29HTTP-PROXY =
30SERVERS = http://gnunet.org:8080/
31OPTIONS = -b
32BINARY = gnunet-daemon-hostlist
33CONFIG = $DEFAULTCONFIG
34HOME = $SERVICEHOME
35HOSTNAME = localhost
36HTTPPORT = 8080
37
38[topology]
39BINARY = gnunet-daemon-topology
40CONFIG = $DEFAULTCONFIG
41FRIENDS = $SERVICEHOME/friends
42TARGET-CONNECTION-COUNT = 16
43AUTOCONNECT = YES
44FRIENDS-ONLY = NO
45MINIMUM-FRIENDS = 0
46
47[core]
48AUTOSTART = NO
49
50[transport]
51plugins = http
52#DEBUG = YES
53PREFIX =
54ACCEPT_FROM6 = ::1;
55ACCEPT_FROM = 127.0.0.1;
56NEIGHBOUR_LIMIT = 50
57BINARY = gnunet-service-transport
58CONFIG = $DEFAULTCONFIG
59HOME = $SERVICEHOME
60HOSTNAME = localhost
61PORT = 3091
62UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_transport_peer2.sock
63
64[peerinfo]
65TRUST = $SERVICEHOME/data/credit/
66HOSTS = $SERVICEHOME/data/hosts/
67ACCEPT_FROM6 = ::1;
68ACCEPT_FROM = 127.0.0.1;
69BINARY = gnunet-service-peerinfo
70CONFIG = $DEFAULTCONFIG
71HOME = $SERVICEHOME
72HOSTNAME = localhost
73PORT = 3090
74UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_peerinfo_peer2.sock
75
76[resolver]
77ACCEPT_FROM6 = ::1;
78ACCEPT_FROM = 127.0.0.1;
79BINARY = gnunet-service-resolver
80CONFIG = $DEFAULTCONFIG
81HOME = $SERVICEHOME
82HOSTNAME = localhost
83PORT = 3089
84UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_resolver_peer2.sock
85
86[statistics]
87ACCEPT_FROM6 = ::1;
88ACCEPT_FROM = 127.0.0.1;
89BINARY = gnunet-service-statistics
90CONFIG = $DEFAULTCONFIG
91HOME = $SERVICEHOME
92HOSTNAME = localhost
93PORT = 3088
94UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_statistics_peer2.sock
95
96[arm]
97DEFAULTSERVICES =
98ACCEPT_FROM6 = ::1;
99ACCEPT_FROM = 127.0.0.1;
100BINARY = gnunet-service-arm
101CONFIG = $DEFAULTCONFIG
102HOME = $SERVICEHOME
103HOSTNAME = localhost
104PORT = 3087
105UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_arm_peer2.sock
106
107[TESTING]
108WEAKRANDOM = YES
109
110[gnunetd]
111HOSTKEY = $SERVICEHOME/.hostkey
112
113
114[dht]
115AUTOSTART = NO
116
117
diff --git a/src/transport/test_quota_compliance_peer1.conf b/src/transport/test_quota_compliance_tcp_peer1.conf
index 32e422a71..258f9ba98 100644
--- a/src/transport/test_quota_compliance_peer1.conf
+++ b/src/transport/test_quota_compliance_tcp_peer1.conf
@@ -1,8 +1,6 @@
1[PATHS] 1[PATHS]
2SERVICEHOME = /tmp/test_quota_compliance_peer1/ 2SERVICEHOME = /tmp/test_quota_compliance_peer1/
3DEFAULTCONFIG = test_quota_compliance_peer1.conf 3DEFAULTCONFIG = test_quota_compliance_tcp_peer1.conf
4
5
6 4
7[fs] 5[fs]
8AUTOSTART = NO 6AUTOSTART = NO
diff --git a/src/transport/test_quota_compliance_peer2.conf b/src/transport/test_quota_compliance_tcp_peer2.conf
index ded0d096c..117e3d1ca 100644
--- a/src/transport/test_quota_compliance_peer2.conf
+++ b/src/transport/test_quota_compliance_tcp_peer2.conf
@@ -1,6 +1,6 @@
1[PATHS] 1[PATHS]
2SERVICEHOME = /tmp/test_quota_compliance_peer2 2SERVICEHOME = /tmp/test_quota_compliance_peer2
3DEFAULTCONFIG = test_quota_compliance_peer2.conf 3DEFAULTCONFIG = test_quota_compliance_tcp_peer2.conf
4 4
5[transport-udp] 5[transport-udp]
6PORT = 3094 6PORT = 3094