a lot of new testcases
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 29 Oct 2010 16:12:25 +0000 (16:12 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 29 Oct 2010 16:12:25 +0000 (16:12 +0000)
src/transport/Makefile.am
src/transport/test_quota_compliance.c

index a5bf9dbe2fb603d3fb1cc9f47653d1ae1b6fdc33..666c4af0636189b79991bb34bc8382d47f028d3e 100644 (file)
@@ -18,13 +18,17 @@ if HAVE_MHD
  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
+ HTTP_QUOTA_TEST = test_quota_compliance_http \
+                                  test_quota_compliance_http_asymmetric_recv_constant \
+                                  test_quota_compliance_http_asymmetric_send_constant
 
  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_QUOTA_TEST = test_quota_compliance_https                      
+ HTTPS_QUOTA_TEST = test_quota_compliance_https \
+                                       test_quota_compliance_https_asymmetric_recv_constant \
+                                       test_quota_compliance_https_asymmetric_send_constant
 endif
 
 if USE_COVERAGE
@@ -207,6 +211,8 @@ check_PROGRAMS = \
  test_quota_compliance_tcp_asymmetric_recv_constant \
  test_quota_compliance_tcp_asymmetric_send_constant \
  test_quota_compliance_udp \
+ test_quota_compliance_udp_asymmetric_send_constant \
+ test_quota_compliance_udp_asymmetric_recv_constant \
  $(HTTP_QUOTA_TEST) \
  $(HTTPS_QUOTA_TEST)
 # TODO: add tests for nat, etc.
@@ -229,6 +235,8 @@ TESTS = \
  test_quota_compliance_tcp_asymmetric_recv_constant \
  test_quota_compliance_tcp_asymmetric_send_constant \
  test_quota_compliance_udp \
+ test_quota_compliance_udp_asymmetric_send_constant \
+ test_quota_compliance_udp_asymmetric_recv_constant \
  $(HTTP_QUOTA_TEST) \
  $(HTTPS_QUOTA_TEST)
 endif
@@ -340,6 +348,18 @@ test_quota_compliance_http_SOURCES = \
 test_quota_compliance_http_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la
+ test_quota_compliance_http_asymmetric_recv_constant_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_http_asymmetric_recv_constant_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.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
@@ -347,11 +367,36 @@ test_quota_compliance_https_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la
 
+ test_quota_compliance_https_asymmetric_recv_constant_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_https_asymmetric_recv_constant_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.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 = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la
+test_quota_compliance_udp_asymmetric_recv_constant_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_udp_asymmetric_recv_constant_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la
+test_quota_compliance_udp_asymmetric_send_constant_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_udp_asymmetric_send_constant_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la 
 
 endif
 
index 895b5c36a3928eb9f52d65aaa530d9338e18f73d..d7f549b2d56ced38536cd0558dd6df96ce1d29a8 100644 (file)
@@ -680,6 +680,57 @@ main (int argc, char *argv[])
       is_udp = GNUNET_YES;
     }
 
+  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;
+
+  char * logger;
+  if (is_tcp == GNUNET_YES)
+  {
+         if (is_asymmetric_recv_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","asymmetric_recv_constant");
+         else if (is_asymmetric_send_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","asymmetric_send_constant");
+         else
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","tcp","symmetric");
+  }
+  if (is_udp == GNUNET_YES)
+  {
+         if (is_asymmetric_recv_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","asymmetric_recv_constant");
+         else if (is_asymmetric_send_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","asymmetric_send_constant");
+         else
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","udp","symmetric");
+  }
+  if (is_http == GNUNET_YES)
+  {
+         if (is_asymmetric_recv_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","asymmetric_recv_constant");
+         else if (is_asymmetric_send_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","asymmetric_send_constant");
+         else
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","http","symmetric");
+  }
+  if (is_https == GNUNET_YES)
+  {
+         if (is_asymmetric_recv_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","asymmetric_recv_constant");
+         else if (is_asymmetric_send_constant == GNUNET_YES)
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","asymmetric_send_constant");
+         else
+                 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","https","symmetric");
+  }
+
   GNUNET_log_setup ("test-quota-compliance",
 #if VERBOSE
                     "DEBUG",
@@ -698,26 +749,14 @@ main (int argc, char *argv[])
   struct GNUNET_GETOPT_CommandLineOption options[] = {
     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",
+                      argv1, logger , "nohelp",
                       options, &run, &ok);
   ret = ok;
   stop_arm (&p1);
   stop_arm (&p2);
+  GNUNET_free(logger);
   GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1");
   GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2");
   return ret;