gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33344 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r33344 - gnunet/src/transport
Date: Tue, 20 May 2014 18:00:16 +0200

Author: wachs
Date: 2014-05-20 18:00:16 +0200 (Tue, 20 May 2014)
New Revision: 33344

Added:
   gnunet/src/transport/test_transport_address_switch_udp_peer1.conf
   gnunet/src/transport/test_transport_address_switch_udp_peer2.conf
Modified:
   gnunet/src/transport/Makefile.am
   gnunet/src/transport/test_transport_address_switch.c
   
gnunet/src/transport/test_transport_test_transport_address_switch_tcp_peer1.conf
Log:
address switch test


Modified: gnunet/src/transport/Makefile.am
===================================================================
--- gnunet/src/transport/Makefile.am    2014-05-20 15:32:25 UTC (rev 33343)
+++ gnunet/src/transport/Makefile.am    2014-05-20 16:00:16 UTC (rev 33344)
@@ -33,11 +33,13 @@
  HTTP_REL_TEST = test_transport_api_reliability_http
  HTTP_QUOTA_TEST = test_quota_compliance_http \
                   test_quota_compliance_http_asymmetric
+ HTTP_SWITCH = test_transport_address_switch_http 
  HTTPS_API_TEST = test_transport_api_https
  HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https
  HTTPS_REL_TEST = test_transport_api_reliability_https
  HTTPS_QUOTA_TEST = test_quota_compliance_https \
                test_quota_compliance_https_asymmetric
+ HTTPS_SWITCH = test_transport_address_switch_https 
 endif
 endif
 
@@ -402,6 +404,7 @@
  test_transport_api_tcp_nat \
  test_transport_api_udp \
  test_transport_api_timeout_udp \
+ test_transport_address_switch_udp \
  $(UNIX_PLUGIN_TEST) \
  $(UNIX_PLUGIN_TIMEOUT_TEST) \
  $(UNIX_API_ABSTRACT_TEST) \
@@ -409,8 +412,10 @@
  $(HTTP_API_TEST) \
  $(HTTP_REVERSE_API_TEST) \
  $(HTTP_API_TIMEOUT_TEST) \
+ $(HTTP_SWITCH) \
  $(HTTPS_API_TEST) \
  $(HTTPS_API_TIMEOUT_TEST) \
+ $(HTTPS_SWITCH) \
  $(WLAN_API_TEST) \
  $(WLAN_TIMEOUT_TEST) \
  $(BT_API_TEST) \
@@ -470,14 +475,17 @@
  test_transport_api_tcp_nat \
  test_transport_api_udp \
  test_transport_api_timeout_udp \
+ test_transport_address_switch_udp \
  $(UNIX_PLUGIN_TEST) \
  $(UNIX_PLUGIN_TIMEOUT_TEST) \
  $(UNIX_API_ABSTRACT_TEST) \
  test_transport_api_udp_nat \
  $(HTTP_API_TEST) \
  $(HTTP_API_TIMEOUT_TEST) \
+ $(HTTP_SWITCH) \
  $(HTTPS_API_TEST) \
  $(HTTPS_API_TIMEOUT_TEST) \
+ $(HTTPS_SWITCH) \
  $(WLAN_API_TEST) \
  $(WLAN_TIMEOUT_TEST) \
  $(BT_API_TEST) \
@@ -1023,6 +1031,34 @@
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/transport/libgnunettransporttesting.la
+ 
+ test_transport_address_switch_udp_SOURCES = \
+ test_transport_address_switch.c
+test_transport_address_switch_udp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+ 
+ 
+ test_transport_address_switch_http_SOURCES = \
+ test_transport_address_switch.c
+test_transport_address_switch_http_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+ 
+ test_transport_address_switch_https_SOURCES = \
+ test_transport_address_switch.c
+test_transport_address_switch_https_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
 
 test_quota_compliance_tcp_SOURCES = \
  test_quota_compliance.c
@@ -1215,6 +1251,12 @@
 test_transport_api_reliability_wlan_peer2.conf\
 test_transport_api_reliability_bluetooth_peer1.conf\
 test_transport_api_reliability_bluetooth_peer2.conf\
+test_transport_test_transport_address_switch_http_peer1.conf\
+test_transport_test_transport_address_switch_http_peer2.conf\
+test_transport_test_transport_address_switch_https_peer1.conf\
+test_transport_test_transport_address_switch_https_peer2.conf\
+test_transport_test_transport_address_switch_udp_peer1.conf\
+test_transport_test_transport_address_switch_udp_peer2.conf\
 test_transport_test_transport_address_switch_tcp_peer1.conf\
 test_transport_test_transport_address_switch_tcp_peer2.conf\
 test_transport_api_wlan_peer1.conf\

Modified: gnunet/src/transport/test_transport_address_switch.c
===================================================================
--- gnunet/src/transport/test_transport_address_switch.c        2014-05-20 
15:32:25 UTC (rev 33343)
+++ gnunet/src/transport/test_transport_address_switch.c        2014-05-20 
16:00:16 UTC (rev 33344)
@@ -97,10 +97,12 @@
 static unsigned int p1_switch_attempts;
 static unsigned int p1_switch_success;
 static unsigned int p1_switch_fail;
+static unsigned int p1_addresses_avail;
 
 static unsigned int p2_switch_attempts;
 static unsigned int p2_switch_success;
 static unsigned int p2_switch_fail;
+static unsigned int p2_addresses_avail;
 
 static unsigned long long bytes_sent_total;
 static unsigned long long bytes_recv_total;
@@ -169,6 +171,9 @@
 stat_fail_attempt_cb (void *cls, const char *subsystem, const char *name,
     uint64_t value, int is_persistent)
 {
+  if (value == 0)
+    return GNUNET_OK;
+
   if (cls == p1)
   {
     p1_switch_fail++;
@@ -183,7 +188,22 @@
   return GNUNET_OK;
 }
 
+static int
+stat_addresses_available (void *cls, const char *subsystem, const char *name,
+    uint64_t value, int is_persistent)
+{
+  if (cls == p1)
+  {
+    p1_addresses_avail++;
+  }
+  if (cls == p2)
+  {
+    p2_addresses_avail++;
+  }
 
+  return GNUNET_OK;
+}
+
 static void
 clean_up ()
 {
@@ -220,6 +240,9 @@
     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
         "# Failed attempts to switch addresses (no response)",
         stat_fail_attempt_cb, p1);
+    GNUNET_STATISTICS_watch (p1_stat, "transport",
+        "# transport addresses",
+        stat_addresses_available, p1);
     GNUNET_STATISTICS_destroy (p1_stat, GNUNET_NO);
     p1_stat = NULL;
   }
@@ -238,6 +261,9 @@
     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
         "# Failed attempts to switch addresses (no response)",
         stat_fail_attempt_cb, p2);
+    GNUNET_STATISTICS_watch (p1_stat, "transport",
+        "# transport addresses",
+        stat_addresses_available, p1);
     GNUNET_STATISTICS_destroy (p2_stat, GNUNET_NO);
     p2_stat = NULL;
   }
@@ -289,6 +315,11 @@
     if (p1_switch_success != p1_switch_attempts)
       result ++;
   }
+  else
+  {
+    FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to 
switch\n",
+        p1_addresses_avail);
+  }
   if (p2_switch_attempts > 0)
   {
     FPRINTF (stderr, "Peer 2 tried %u times to switch and succeeded %u times, 
failed %u times\n",
@@ -296,6 +327,11 @@
     if (p2_switch_success != p2_switch_attempts)
       result ++;
   }
+  else
+  {
+    FPRINTF (stderr, "Peer 2 had %u addresses available, but did not try to 
switch\n",
+        p2_addresses_avail);
+  }
 
   if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
        (bytes_sent_after_switch == 0) )
@@ -322,6 +358,11 @@
   die_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
 
+  FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to 
switch\n",
+      p1_addresses_avail);
+  FPRINTF (stderr, "Peer 2 had %u addresses available, but did not try to 
switch\n",
+      p2_addresses_avail);
+
   if (test_connected == GNUNET_YES)
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n");
   else
@@ -566,6 +607,9 @@
   GNUNET_STATISTICS_watch (p1_stat, "transport",
       "# Failed attempts to switch addresses (no response)",
       stat_fail_attempt_cb, p1);
+  GNUNET_STATISTICS_watch (p1_stat, "transport",
+      "# transport addresses",
+      stat_addresses_available, p1);
 
   p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p2, 2,
       &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
@@ -586,6 +630,9 @@
   GNUNET_STATISTICS_watch (p2_stat, "transport",
       "# Failed attempts to switch addresses (no response)",
       stat_fail_attempt_cb, p2);
+  GNUNET_STATISTICS_watch (p2_stat, "transport",
+      "# transport addresses",
+      stat_addresses_available, p2);
 
   if ((p1 == NULL )|| (p2 == NULL))
   {

Added: gnunet/src/transport/test_transport_address_switch_udp_peer1.conf
===================================================================
--- gnunet/src/transport/test_transport_address_switch_udp_peer1.conf           
                (rev 0)
+++ gnunet/src/transport/test_transport_address_switch_udp_peer1.conf   
2014-05-20 16:00:16 UTC (rev 33344)
@@ -0,0 +1,49 @@
address@hidden@ template_cfg_peer1.conf
+[PATHS]
+GNUNET_TEST_HOME = /tmp/test-transport/api-tcp-p1/
+
+[ats]
+UNSPECIFIED_QUOTA_IN = 8 KiB
+UNSPECIFIED_QUOTA_OUT = 8 KiB
+# LOOPBACK
+LOOPBACK_QUOTA_IN = 8 KiB
+LOOPBACK_QUOTA_OUT = 8 KiB
+# LAN
+LAN_QUOTA_IN = 8 KiB
+LAN_QUOTA_OUT = 8 KiB
+# WAN
+WAN_QUOTA_IN = 8 KiB
+WAN_QUOTA_OUT = 8 KiB
+# WLAN
+WLAN_QUOTA_IN = 8 KiB
+WLAN_QUOTA_OUT = 8 KiB
+# BLUETOOTH
+BLUETOOTH_QUOTA_IN = 8 KiB
+BLUETOOTH_QUOTA_OUT = 8 KiB
+
+[transport-tcp]
+PORT = 12000
+TIMEOUT = 5 s
+
+[arm]
+PORT = 12005
+DEFAULTSERVICES = transport
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock
+
+[statistics]
+PORT = 12004
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-statistics.sock
+
+[resolver]
+PORT = 12003
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-resolver.sock
+
+[peerinfo]
+PORT = 12002
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-peerinfo.sock
+
+[transport]
+PORT = 12001
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-transport.sock
+PLUGINS = udp
+

Added: gnunet/src/transport/test_transport_address_switch_udp_peer2.conf
===================================================================
--- gnunet/src/transport/test_transport_address_switch_udp_peer2.conf           
                (rev 0)
+++ gnunet/src/transport/test_transport_address_switch_udp_peer2.conf   
2014-05-20 16:00:16 UTC (rev 33344)
@@ -0,0 +1,49 @@
address@hidden@ template_cfg_peer2.conf
+[PATHS]
+GNUNET_TEST_HOME = /tmp/test-transport/api-tcp-p2/
+
+[ats]
+UNSPECIFIED_QUOTA_IN = 8 KiB
+UNSPECIFIED_QUOTA_OUT = 8 KiB
+# LOOPBACK
+LOOPBACK_QUOTA_IN = 8 KiB
+LOOPBACK_QUOTA_OUT = 8 KiB
+# LAN
+LAN_QUOTA_IN = 8 KiB
+LAN_QUOTA_OUT = 8 KiB
+# WAN
+WAN_QUOTA_IN = 8 KiB
+WAN_QUOTA_OUT = 8 KiB
+# WLAN
+WLAN_QUOTA_IN = 8 KiB
+WLAN_QUOTA_OUT = 8 KiB
+# BLUETOOTH
+BLUETOOTH_QUOTA_IN = 8 KiB
+BLUETOOTH_QUOTA_OUT = 8 KiB
+
+[transport-tcp]
+PORT = 12015
+TIMEOUT = 5 s
+
+[arm]
+PORT = 12014
+DEFAULTSERVICES = transport
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-arm.sock
+
+[statistics]
+PORT = 12013
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-statistics.sock
+
+[resolver]
+PORT = 12012
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-resolver.sock
+
+[peerinfo]
+PORT = 12011
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-peerinfo.sock
+
+[transport]
+PORT = 12010
+PLUGINS = udp
+UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-transport.sock
+

Modified: 
gnunet/src/transport/test_transport_test_transport_address_switch_tcp_peer1.conf
===================================================================
--- 
gnunet/src/transport/test_transport_test_transport_address_switch_tcp_peer1.conf
    2014-05-20 15:32:25 UTC (rev 33343)
+++ 
gnunet/src/transport/test_transport_test_transport_address_switch_tcp_peer1.conf
    2014-05-20 16:00:16 UTC (rev 33344)
@@ -1,4 +1,5 @@
 @INLINE@ template_cfg_peer1.conf
+
 [ats]
 UNSPECIFIED_QUOTA_IN = 8 KiB
 UNSPECIFIED_QUOTA_OUT = 8 KiB
@@ -18,7 +19,6 @@
 BLUETOOTH_QUOTA_IN = 8 KiB
 BLUETOOTH_QUOTA_OUT = 8 KiB
 
-
 [PATHS]
 GNUNET_TEST_HOME = /tmp/test-transport/quota-tcp-p1/
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]