diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-29 12:22:33 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-29 12:22:33 +0000 |
commit | 3c96ac35df35d267713bd89a0bc9cd8df99215bc (patch) | |
tree | 5ae259ba3a16f34774d7377a29e2a989b56556c6 | |
parent | d028f7bccb02874f92c60127c5dbd90112a79202 (diff) | |
download | gnunet-3c96ac35df35d267713bd89a0bc9cd8df99215bc.tar.gz gnunet-3c96ac35df35d267713bd89a0bc9cd8df99215bc.zip |
Adding quota compliance test for http
-rw-r--r-- | src/transport/Makefile.am | 22 | ||||
-rw-r--r-- | src/transport/test_quota_compliance.c | 24 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_http_peer1.conf | 108 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_http_peer2.conf | 117 | ||||
-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 | ||
207 | if !DISABLE_TEST_RUN | 208 | if !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 | ||
222 | endif | 224 | endif |
223 | 225 | ||
224 | test_transport_api_tcp_SOURCES = \ | 226 | test_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 | ||
308 | test_quota_compliance_SOURCES = \ | 310 | test_quota_compliance_tcp_SOURCES = \ |
309 | test_quota_compliance.c | 311 | test_quota_compliance.c |
310 | test_quota_compliance_LDADD = \ | 312 | test_quota_compliance_tcp_LDADD = \ |
313 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
314 | $(top_builddir)/src/util/libgnunetutil.la | ||
315 | |||
316 | test_quota_compliance_http_SOURCES = \ | ||
317 | test_quota_compliance.c | ||
318 | test_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] | ||
2 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ | ||
3 | DEFAULTCONFIG = test_quota_compliance_http_peer1.conf | ||
4 | |||
5 | [fs] | ||
6 | AUTOSTART = NO | ||
7 | |||
8 | [datastore] | ||
9 | AUTOSTART = NO | ||
10 | |||
11 | [hostlist] | ||
12 | HTTP-PROXY = | ||
13 | SERVERS = http://gnunet.org:8080/ | ||
14 | OPTIONS = -b | ||
15 | BINARY = gnunet-daemon-hostlist | ||
16 | CONFIG = $DEFAULTCONFIG | ||
17 | HOME = $SERVICEHOME | ||
18 | HOSTNAME = localhost | ||
19 | HTTPPORT = 8080 | ||
20 | |||
21 | [topology] | ||
22 | BINARY = gnunet-daemon-topology | ||
23 | CONFIG = $DEFAULTCONFIG | ||
24 | FRIENDS = $SERVICEHOME/friends | ||
25 | TARGET-CONNECTION-COUNT = 16 | ||
26 | AUTOCONNECT = YES | ||
27 | FRIENDS-ONLY = NO | ||
28 | MINIMUM-FRIENDS = 0 | ||
29 | |||
30 | [core] | ||
31 | AUTOSTART = NO | ||
32 | |||
33 | [transport-http] | ||
34 | PORT = 4389 | ||
35 | DEBUG = NO | ||
36 | USE_IPv4 = YES | ||
37 | USE_IPv6 = NO | ||
38 | BINDTO4 = 127.0.0.1 | ||
39 | #BINDTO6 = ::1 | ||
40 | |||
41 | [transport] | ||
42 | plugins = http | ||
43 | #DEBUG = YES | ||
44 | PREFIX = | ||
45 | ACCEPT_FROM6 = ::1; | ||
46 | ACCEPT_FROM = 127.0.0.1; | ||
47 | NEIGHBOUR_LIMIT = 50 | ||
48 | BINARY = gnunet-service-transport | ||
49 | CONFIG = $DEFAULTCONFIG | ||
50 | HOME = $SERVICEHOME | ||
51 | HOSTNAME = localhost | ||
52 | PORT = 4091 | ||
53 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_transport_peer1.sock | ||
54 | |||
55 | [peerinfo] | ||
56 | TRUST = $SERVICEHOME/data/credit/ | ||
57 | HOSTS = $SERVICEHOME/data/hosts/ | ||
58 | ACCEPT_FROM6 = ::1; | ||
59 | ACCEPT_FROM = 127.0.0.1; | ||
60 | BINARY = gnunet-service-peerinfo | ||
61 | CONFIG = $DEFAULTCONFIG | ||
62 | HOME = $SERVICEHOME | ||
63 | HOSTNAME = localhost | ||
64 | PORT = 4090 | ||
65 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_peerinfo_peer1.sock | ||
66 | |||
67 | [resolver] | ||
68 | ACCEPT_FROM6 = ::1; | ||
69 | ACCEPT_FROM = 127.0.0.1; | ||
70 | BINARY = gnunet-service-resolver | ||
71 | CONFIG = $DEFAULTCONFIG | ||
72 | HOME = $SERVICEHOME | ||
73 | HOSTNAME = localhost | ||
74 | PORT = 4089 | ||
75 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_resolver_peer1.sock | ||
76 | |||
77 | [statistics] | ||
78 | ACCEPT_FROM6 = ::1; | ||
79 | ACCEPT_FROM = 127.0.0.1; | ||
80 | BINARY = gnunet-service-statistics | ||
81 | CONFIG = $DEFAULTCONFIG | ||
82 | HOME = $SERVICEHOME | ||
83 | HOSTNAME = localhost | ||
84 | PORT = 4088 | ||
85 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_statistics_peer1.sock | ||
86 | |||
87 | [arm] | ||
88 | DEFAULTSERVICES = | ||
89 | ACCEPT_FROM6 = ::1; | ||
90 | ACCEPT_FROM = 127.0.0.1; | ||
91 | BINARY = gnunet-service-arm | ||
92 | CONFIG = $DEFAULTCONFIG | ||
93 | HOME = $SERVICEHOME | ||
94 | HOSTNAME = localhost | ||
95 | PORT = 4087 | ||
96 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_arm_peer1.sock | ||
97 | |||
98 | [TESTING] | ||
99 | WEAKRANDOM = YES | ||
100 | |||
101 | [gnunetd] | ||
102 | HOSTKEY = $SERVICEHOME/.hostkey | ||
103 | |||
104 | |||
105 | [dht] | ||
106 | AUTOSTART = 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] | ||
2 | SERVICEHOME = /tmp/test_quota_compliance_peer2 | ||
3 | DEFAULTCONFIG = test_quota_compliance_http_peer2.conf | ||
4 | |||
5 | [transport-http] | ||
6 | PORT = 3389 | ||
7 | DEBUG = NO | ||
8 | USE_IPv4 = YES | ||
9 | USE_IPv6 = NO | ||
10 | BINDTO4 = 127.0.0.1 | ||
11 | #BINDTO6 = ::1 | ||
12 | |||
13 | |||
14 | [transport-udp] | ||
15 | PORT = 3094 | ||
16 | |||
17 | [transport-tcp] | ||
18 | TIMEOUT = 300000 | ||
19 | PORT = 3094 | ||
20 | BINDTO = 127.0.0.1 | ||
21 | |||
22 | [fs] | ||
23 | AUTOSTART = NO | ||
24 | |||
25 | [datastore] | ||
26 | AUTOSTART = NO | ||
27 | |||
28 | [hostlist] | ||
29 | HTTP-PROXY = | ||
30 | SERVERS = http://gnunet.org:8080/ | ||
31 | OPTIONS = -b | ||
32 | BINARY = gnunet-daemon-hostlist | ||
33 | CONFIG = $DEFAULTCONFIG | ||
34 | HOME = $SERVICEHOME | ||
35 | HOSTNAME = localhost | ||
36 | HTTPPORT = 8080 | ||
37 | |||
38 | [topology] | ||
39 | BINARY = gnunet-daemon-topology | ||
40 | CONFIG = $DEFAULTCONFIG | ||
41 | FRIENDS = $SERVICEHOME/friends | ||
42 | TARGET-CONNECTION-COUNT = 16 | ||
43 | AUTOCONNECT = YES | ||
44 | FRIENDS-ONLY = NO | ||
45 | MINIMUM-FRIENDS = 0 | ||
46 | |||
47 | [core] | ||
48 | AUTOSTART = NO | ||
49 | |||
50 | [transport] | ||
51 | plugins = http | ||
52 | #DEBUG = YES | ||
53 | PREFIX = | ||
54 | ACCEPT_FROM6 = ::1; | ||
55 | ACCEPT_FROM = 127.0.0.1; | ||
56 | NEIGHBOUR_LIMIT = 50 | ||
57 | BINARY = gnunet-service-transport | ||
58 | CONFIG = $DEFAULTCONFIG | ||
59 | HOME = $SERVICEHOME | ||
60 | HOSTNAME = localhost | ||
61 | PORT = 3091 | ||
62 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_transport_peer2.sock | ||
63 | |||
64 | [peerinfo] | ||
65 | TRUST = $SERVICEHOME/data/credit/ | ||
66 | HOSTS = $SERVICEHOME/data/hosts/ | ||
67 | ACCEPT_FROM6 = ::1; | ||
68 | ACCEPT_FROM = 127.0.0.1; | ||
69 | BINARY = gnunet-service-peerinfo | ||
70 | CONFIG = $DEFAULTCONFIG | ||
71 | HOME = $SERVICEHOME | ||
72 | HOSTNAME = localhost | ||
73 | PORT = 3090 | ||
74 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_peerinfo_peer2.sock | ||
75 | |||
76 | [resolver] | ||
77 | ACCEPT_FROM6 = ::1; | ||
78 | ACCEPT_FROM = 127.0.0.1; | ||
79 | BINARY = gnunet-service-resolver | ||
80 | CONFIG = $DEFAULTCONFIG | ||
81 | HOME = $SERVICEHOME | ||
82 | HOSTNAME = localhost | ||
83 | PORT = 3089 | ||
84 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_resolver_peer2.sock | ||
85 | |||
86 | [statistics] | ||
87 | ACCEPT_FROM6 = ::1; | ||
88 | ACCEPT_FROM = 127.0.0.1; | ||
89 | BINARY = gnunet-service-statistics | ||
90 | CONFIG = $DEFAULTCONFIG | ||
91 | HOME = $SERVICEHOME | ||
92 | HOSTNAME = localhost | ||
93 | PORT = 3088 | ||
94 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_statistics_peer2.sock | ||
95 | |||
96 | [arm] | ||
97 | DEFAULTSERVICES = | ||
98 | ACCEPT_FROM6 = ::1; | ||
99 | ACCEPT_FROM = 127.0.0.1; | ||
100 | BINARY = gnunet-service-arm | ||
101 | CONFIG = $DEFAULTCONFIG | ||
102 | HOME = $SERVICEHOME | ||
103 | HOSTNAME = localhost | ||
104 | PORT = 3087 | ||
105 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_arm_peer2.sock | ||
106 | |||
107 | [TESTING] | ||
108 | WEAKRANDOM = YES | ||
109 | |||
110 | [gnunetd] | ||
111 | HOSTKEY = $SERVICEHOME/.hostkey | ||
112 | |||
113 | |||
114 | [dht] | ||
115 | AUTOSTART = 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] |
2 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ | 2 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ |
3 | DEFAULTCONFIG = test_quota_compliance_peer1.conf | 3 | DEFAULTCONFIG = test_quota_compliance_tcp_peer1.conf |
4 | |||
5 | |||
6 | 4 | ||
7 | [fs] | 5 | [fs] |
8 | AUTOSTART = NO | 6 | AUTOSTART = 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] |
2 | SERVICEHOME = /tmp/test_quota_compliance_peer2 | 2 | SERVICEHOME = /tmp/test_quota_compliance_peer2 |
3 | DEFAULTCONFIG = test_quota_compliance_peer2.conf | 3 | DEFAULTCONFIG = test_quota_compliance_tcp_peer2.conf |
4 | 4 | ||
5 | [transport-udp] | 5 | [transport-udp] |
6 | PORT = 3094 | 6 | PORT = 3094 |