HTTP_PLUGIN_TEST = test_plugin_transport_http
HTTP_API_TEST = test_transport_api_http
HTTP_REL_TEST = test_transport_api_reliability_http
+ HTTP_QUOTA_TEST = test_quota_compliance_http
HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
HTTPS_PLUGIN_TEST = test_plugin_transport_https
HTTPS_API_TEST = test_transport_api_https
- HTTPS_REL_TEST = test_transport_api_reliability_https
+ HTTPS_REL_TEST = test_transport_api_reliability_https
+ HTTPS_QUOTA_TEST = test_quota_compliance_https
endif
if USE_COVERAGE
$(HTTP_REL_TEST) \
$(HTTPS_REL_TEST) \
test_quota_compliance_tcp \
- test_quota_compliance_http \
- test_quota_compliance_https \
- test_quota_compliance_udp
+ test_quota_compliance_tcp_asymmetric_recv_constant \
+ test_quota_compliance_tcp_asymmetric_send_constant \
+ test_quota_compliance_udp \
+ $(HTTP_QUOTA_TEST) \
+ $(HTTPS_QUOTA_TEST)
# TODO: add tests for nat, etc.
if !DISABLE_TEST_RUN
$(HTTP_REL_TEST) \
$(HTTPS_REL_TEST) \
test_quota_compliance_tcp \
- test_quota_compliance_http \
- test_quota_compliance_https \
- test_quota_compliance_udp
+ test_quota_compliance_tcp_asymmetric_recv_constant \
+ test_quota_compliance_tcp_asymmetric_send_constant \
+ test_quota_compliance_udp \
+ $(HTTP_QUOTA_TEST) \
+ $(HTTPS_QUOTA_TEST)
endif
test_transport_api_tcp_SOURCES = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/util/libgnunetutil.la
+test_quota_compliance_tcp_asymmetric_recv_constant_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_tcp_asymmetric_recv_constant_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.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 = \
endif
+
EXTRA_DIST = \
test_transport_api_data.conf \
test_transport_api_tcp_peer1.conf \
test_quota_compliance_http_peer1.conf \
test_quota_compliance_http_peer2.conf \
test_quota_compliance_https_peer1.conf \
- test_quota_compliance_https_peer2.conf
\ No newline at end of file
+ test_quota_compliance_https_peer2.conf \
+ test_quota_compliance_udp_peer1.conf \
+ test_quota_compliance_udp_peer2.conf
\ No newline at end of file
static int is_http;
static int is_https;
static int is_udp;
+static int is_asymmetric_send_constant;
+static int is_asymmetric_recv_constant;
static struct GNUNET_TIME_Absolute start_time;
ok = 0;
}
- if (current_quota_p1 < MEASUREMENT_MIN_QUOTA)
+ if ((current_quota_p1 < MEASUREMENT_MIN_QUOTA) || (current_quota_p2 < MEASUREMENT_MIN_QUOTA))
{
end();
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Scheduling next measurement\n");
#endif
- measure (current_quota_p1 / 10, current_quota_p2 / 10);
+ if (is_asymmetric_send_constant == GNUNET_YES)
+ measure (current_quota_p1 / 10, MEASUREMENT_MAX_QUOTA);
+ else if (is_asymmetric_recv_constant == GNUNET_YES)
+ measure (MEASUREMENT_MAX_QUOTA, current_quota_p2 / 10);
+ else
+ measure (current_quota_p1 / 10, current_quota_p2 / 10);
}
}
current_quota_p2 = quota_p2;
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Starting transport level measurement for %u seconds and quota %llu kB/s\n", MEASUREMENT_INTERVALL.rel_value / 1000 , current_quota_p1 / 1024);
+ "Starting transport level measurement for %u seconds and p1 quota %llu kB/s p2 quota %llu\n", MEASUREMENT_INTERVALL.rel_value / 1000 , current_quota_p1 / 1024, current_quota_p2 / 1024);
#endif
GNUNET_TRANSPORT_set_quota (p1.th,
&p2.id,
if (is_tcp)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing quota compliance for TCP transport plugin\n");
setup_peer (&p1, "test_quota_compliance_tcp_peer1.conf");
setup_peer (&p2, "test_quota_compliance_tcp_peer2.conf");
}
else if (is_http)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing quota compliance for HTTP transport plugin\n");
setup_peer (&p1, "test_quota_compliance_http_peer1.conf");
setup_peer (&p2, "test_quota_compliance_http_peer2.conf");
}
else if (is_https)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing quota compliance for HTTPS transport plugin\n");
setup_peer (&p1, "test_quota_compliance_https_peer1.conf");
setup_peer (&p2, "test_quota_compliance_https_peer2.conf");
}
else if (is_udp)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Testing quota compliance for UDP transport plugin\n");
setup_peer (&p1, "test_quota_compliance_udp_peer1.conf");
setup_peer (&p2, "test_quota_compliance_udp_peer2.conf");
}
{
is_udp = GNUNET_YES;
}
+
GNUNET_log_setup ("test-quota-compliance",
#if VERBOSE
"DEBUG",
GNUNET_GETOPT_OPTION_END
};
+ if (strstr(argv[0], "asymmetric_recv") != NULL)
+ {
+ is_asymmetric_recv_constant = GNUNET_YES;
+ }
+ else
+ is_asymmetric_recv_constant = GNUNET_NO;
+ if (strstr(argv[0], "asymmetric_send") != NULL)
+ {
+ is_asymmetric_send_constant = GNUNET_YES;
+ }
+ else
+ is_asymmetric_send_constant = GNUNET_NO;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv1) / sizeof (char *)) - 1,
argv1, "test-quota-compliance", "nohelp",