From: Matthias Wachs Date: Fri, 6 Jul 2012 15:24:37 +0000 (+0000) Subject: quota tests for wlan X-Git-Tag: initial-import-from-subversion-38251~12604 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e05dfc08064634e54c527b133ef00e510a3adeda;p=oweals%2Fgnunet.git quota tests for wlan --- diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 0cf817db9..55d47f059 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -40,6 +40,8 @@ if LINUX WLAN_API_TEST = test_transport_api_wlan WLAN_REL_TEST = test_transport_api_reliability_wlan WLAN_UREL_TEST = test_transport_api_unreliability_wlan + WLAN_QUOTA_TEST = test_quota_compliance_wlan \ + test_quota_compliance_wlan_asymmetric endif @@ -276,6 +278,7 @@ check_PROGRAMS = \ $(HTTPS_API_TEST) \ $(HTTPS_NAT_API_TEST) \ $(HTTPS_API_TIMEOUT_TEST) \ + $(WLAN_API_TEST) \ test_transport_api_multi \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat \ @@ -286,15 +289,14 @@ check_PROGRAMS = \ $(HTTP_NAT_REL_TEST) \ $(HTTPS_REL_TEST) \ $(HTTPS_NAT_REL_TEST) \ + $(WLAN_REL_TEST) \ + $(WLAN_UREL_TEST) \ test_quota_compliance_tcp \ test_quota_compliance_tcp_asymmetric \ test_quota_compliance_udp \ $(UNIX_QUOTA_TEST) \ $(HTTP_QUOTA_TEST) \ - $(HTTPS_QUOTA_TEST) \ - $(WLAN_API_TEST) \ - $(WLAN_REL_TEST) \ - $(WLAN_UREL_TEST) + $(WLAN_QUOTA_TEST) if ENABLE_TEST_RUN TESTS = \ @@ -322,6 +324,7 @@ TESTS = \ $(HTTPS_API_TEST) \ $(HTTPS_NAT_API_TEST) \ $(HTTPS_API_TIMEOUT_TEST) \ + $(WLAN_API_TEST) \ test_transport_api_multi \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat \ @@ -332,15 +335,14 @@ TESTS = \ $(HTTP_NAT_REL_TEST) \ $(HTTPS_REL_TEST) \ $(HTTPS_NAT_REL_TEST) \ + $(WLAN_REL_TEST) \ + $(WLAN_UREL_TEST) \ test_quota_compliance_tcp \ test_quota_compliance_tcp_asymmetric \ test_quota_compliance_udp \ $(UNIX_QUOTA_TEST) \ $(HTTP_QUOTA_TEST) \ - $(HTTPS_QUOTA_TEST) \ - $(WLAN_API_TEST) \ - $(WLAN_REL_TEST) \ - $(WLAN_UREL_TEST) + $(HTTPS_QUOTA_TEST) endif test_transport_testing_startstop_SOURCES = \ @@ -655,12 +657,6 @@ test_quota_compliance_tcp_asymmetric_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/transport/libgnunettransporttesting.la -#test_quota_compliance_tcp_asymmetric_send_constant_SOURCES = \ -# test_quota_compliance.c -#test_quota_compliance_tcp_asymmetric_send_constant_LDADD = \ -# $(top_builddir)/src/transport/libgnunettransport.la \ -# $(top_builddir)/src/util/libgnunetutil.la - test_quota_compliance_http_SOURCES = \ test_quota_compliance.c test_quota_compliance_http_LDADD = \ @@ -677,12 +673,6 @@ test_quota_compliance_http_asymmetric_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/transport/libgnunettransporttesting.la -#test_quota_compliance_http_asymmetric_send_constant_SOURCES = \ -# test_quota_compliance.c -#test_quota_compliance_http_asymmetric_send_constant_LDADD = \ -# $(top_builddir)/src/transport/libgnunettransport.la \ -# $(top_builddir)/src/util/libgnunetutil.la - test_quota_compliance_https_SOURCES = \ test_quota_compliance.c test_quota_compliance_https_LDADD = \ @@ -699,12 +689,6 @@ test_quota_compliance_https_asymmetric_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/transport/libgnunettransporttesting.la -#test_quota_compliance_https_asymmetric_send_constant_SOURCES = \ -# test_quota_compliance.c -#test_quota_compliance_https_asymmetric_send_constant_LDADD = \ -# $(top_builddir)/src/transport/libgnunettransport.la \ -# $(top_builddir)/src/util/libgnunetutil.la - test_quota_compliance_udp_SOURCES = \ test_quota_compliance.c test_quota_compliance_udp_LDADD = \ @@ -729,6 +713,22 @@ test_quota_compliance_unix_asymmetric_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/transport/libgnunettransporttesting.la +test_quota_compliance_wlan_SOURCES = \ + test_quota_compliance.c +test_quota_compliance_wlan_LDADD = \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/transport/libgnunettransporttesting.la + +test_quota_compliance_wlan_asymmetric_SOURCES = \ + test_quota_compliance.c +test_quota_compliance_wlan_asymmetric_LDADD = \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/transport/libgnunettransporttesting.la + test_transport_api_multi_SOURCES = \ test_transport_api.c test_transport_api_multi_LDADD = \ diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index ce407a382..629dd91bb 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -2169,7 +2169,7 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, return; } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "ATS tells us to switch to address '%s' session %p for " "peer `%s' in state %s (quota in/out %u %u )\n", (address->address_length != 0) ? GST_plugins_a2s (address): "", diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index ebfbcd5eb..4aae669eb 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c @@ -529,7 +529,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL != strstr (test_name, "asymmetric")) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running asymmetric test with sending peer unlimited, receiving peer (in/out): %llu/%llu b/s \n", p2_quota_in, p2_quota_out); p1_quota_out = 1024 * 1024 * 1024; @@ -537,7 +537,7 @@ run (void *cls, char *const *args, const char *cfgfile, } else { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running symmetric test with (in/out) %llu/%llu b/s \n", p2_quota_in, p2_quota_out); } diff --git a/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf b/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf new file mode 100644 index 000000000..9dd9d1bd6 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_asymmetric_peer1.conf @@ -0,0 +1,30 @@ +@INLINE@ template_cfg_peer1.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-wlan-p1/ +DEFAULTCONFIG = test_transport_api_wlan_peer1.conf + +[transport-wlan] +TESTMODE = 1 + +[arm] +PORT = 12164 +UNIXPATH = /tmp/gnunet-p1-service-arm.sock + +[statistics] +PORT = 12163 +UNIXPATH = /tmp/gnunet-p1-service-statistics.sock + +[resolver] +PORT = 12162 +UNIXPATH = /tmp/gnunet-p1-service-resolver.sock + +[peerinfo] +PORT = 12161 +UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock + +[transport] +PORT = 12160 +PLUGINS = wlan +UNIXPATH = /tmp/gnunet-p1-service-transport.sock + + diff --git a/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf b/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf new file mode 100644 index 000000000..bc868d7d7 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_asymmetric_peer2.conf @@ -0,0 +1,30 @@ +@INLINE@ template_cfg_peer2.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-wlan-p2/ +DEFAULTCONFIG = test_transport_api_wlan_peer2.conf + +[transport-wlan] +INTERFACE = mon1 +TESTMODE = 2 + +[arm] +PORT = 12174 +UNIXPATH = /tmp/gnunet-p2-service-arm.sock + +[statistics] +PORT = 12173 +UNIXPATH = /tmp/gnunet-p2-service-statistics.sock + +[resolver] +PORT = 12172 +UNIXPATH = /tmp/gnunet-p2-service-resolver.sock + +[peerinfo] +PORT = 12171 +UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock + +[transport] +PORT = 12170 +PLUGINS = wlan +UNIXPATH = /tmp/gnunet-p2-service-transport.sock + diff --git a/src/transport/test_quota_compliance_wlan_peer1.conf b/src/transport/test_quota_compliance_wlan_peer1.conf new file mode 100644 index 000000000..9dd9d1bd6 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_peer1.conf @@ -0,0 +1,30 @@ +@INLINE@ template_cfg_peer1.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-wlan-p1/ +DEFAULTCONFIG = test_transport_api_wlan_peer1.conf + +[transport-wlan] +TESTMODE = 1 + +[arm] +PORT = 12164 +UNIXPATH = /tmp/gnunet-p1-service-arm.sock + +[statistics] +PORT = 12163 +UNIXPATH = /tmp/gnunet-p1-service-statistics.sock + +[resolver] +PORT = 12162 +UNIXPATH = /tmp/gnunet-p1-service-resolver.sock + +[peerinfo] +PORT = 12161 +UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock + +[transport] +PORT = 12160 +PLUGINS = wlan +UNIXPATH = /tmp/gnunet-p1-service-transport.sock + + diff --git a/src/transport/test_quota_compliance_wlan_peer2.conf b/src/transport/test_quota_compliance_wlan_peer2.conf new file mode 100644 index 000000000..bc868d7d7 --- /dev/null +++ b/src/transport/test_quota_compliance_wlan_peer2.conf @@ -0,0 +1,30 @@ +@INLINE@ template_cfg_peer2.conf +[PATHS] +SERVICEHOME = /tmp/test-transport/api-wlan-p2/ +DEFAULTCONFIG = test_transport_api_wlan_peer2.conf + +[transport-wlan] +INTERFACE = mon1 +TESTMODE = 2 + +[arm] +PORT = 12174 +UNIXPATH = /tmp/gnunet-p2-service-arm.sock + +[statistics] +PORT = 12173 +UNIXPATH = /tmp/gnunet-p2-service-statistics.sock + +[resolver] +PORT = 12172 +UNIXPATH = /tmp/gnunet-p2-service-resolver.sock + +[peerinfo] +PORT = 12171 +UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock + +[transport] +PORT = 12170 +PLUGINS = wlan +UNIXPATH = /tmp/gnunet-p2-service-transport.sock + diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index ddad8f196..960844f97 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -477,6 +477,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) break; } n = neighbour_add (h, &cim->id); + LOG (GNUNET_ERROR_TYPE_ERROR, "Receiving `%s' message for `%4s' with quota %u\n", + "CONNECT", GNUNET_i2s (&cim->id), ntohl (cim->quota_out.value__)); GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out); if (h->nc_cb != NULL) h->nc_cb (h->cls, &n->id, ats, ats_count); @@ -564,6 +566,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) n = neighbour_find (h, &qm->peer); if (n == NULL) break; + LOG (GNUNET_ERROR_TYPE_ERROR, "Receiving `%s' message for `%4s' with quota %u\n", + "SET_QUOTA", GNUNET_i2s (&qm->peer), ntohl (qm->quota.value__)); GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); break; default: