Add a test to reproduce issue #3554
authorDavid Barksdale <amatus.amongus@gmail.com>
Thu, 1 Jan 2015 19:22:03 +0000 (19:22 +0000)
committerDavid Barksdale <amatus.amongus@gmail.com>
Thu, 1 Jan 2015 19:22:03 +0000 (19:22 +0000)
src/transport/Makefile.am
src/transport/test_delay [new file with mode: 0755]
src/transport/test_transport_api_slow_ats_peer1.conf [new file with mode: 0644]
src/transport/test_transport_api_slow_ats_peer2.conf [new file with mode: 0644]

index 6866ea0eec97a0324cfa9b8c781ec0944f4a2b4b..d2dcd4236035f7b5b2d66e2e4274aa05da037cb1 100644 (file)
@@ -486,7 +486,8 @@ check_PROGRAMS = \
  $(HTTP_QUOTA_TEST) \
  $(HTTPS_QUOTA_TEST) \
  $(WLAN_QUOTA_TEST) \
- $(BT_QUOTA_TEST)
+ $(BT_QUOTA_TEST) \
+ test_transport_api_slow_ats
 endif
 
 if ENABLE_TEST_RUN
@@ -555,7 +556,8 @@ TESTS = \
  test_quota_compliance_udp \
  $(UNIX_QUOTA_TEST) \
  $(HTTP_QUOTA_TEST) \
- $(HTTPS_QUOTA_TEST)
+ $(HTTPS_QUOTA_TEST) \
+ test_transport_api_slow_ats
 endif
 
 test_transport_testing_startstop_SOURCES = \
@@ -1211,10 +1213,19 @@ test_transport_api_monitor_validation_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettransporttesting.la
 
+test_transport_api_slow_ats_SOURCES = \
+ test_transport_api.c
+test_transport_api_slow_ats_LDADD = \
+ libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ libgnunettransporttesting.la
+
 
 EXTRA_DIST = \
 test_plugin_hostkey \
 test_plugin_hostkey.ecc \
+test_delay \
 template_cfg_peer1.conf\
 template_cfg_peer2.conf\
 test_plugin_transport_data.conf\
@@ -1340,5 +1351,6 @@ test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf \
 test_transport_api_http_reverse_peer1.conf \
 test_transport_api_http_reverse_peer2.conf \
 perf_tcp_peer1.conf \
-perf_tcp_peer2.conf
-
+perf_tcp_peer2.conf \
+test_transport_api_slow_ats_peer1.conf \
+test_transport_api_slow_ats_peer2.conf
diff --git a/src/transport/test_delay b/src/transport/test_delay
new file mode 100755 (executable)
index 0000000..31c7777
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+TEMP=$(getopt -o t: -- "$@")
+
+if [ $? != 0 ] ; then
+  exit 1
+fi
+
+eval set -- "$TEMP"
+
+while true ; do
+  case "$1" in
+    (-t) sleep "$2" ; shift 2 ;;
+    (--) shift ; break ;;
+    (*) echo "Error parsing getopt output" ; exit 1 ;;
+  esac
+done
+exec "$@"
diff --git a/src/transport/test_transport_api_slow_ats_peer1.conf b/src/transport/test_transport_api_slow_ats_peer1.conf
new file mode 100644 (file)
index 0000000..5d50d53
--- /dev/null
@@ -0,0 +1,7 @@
+@INLINE@ template_cfg_peer1.conf
+[PATHS]
+GNUNET_TEST_HOME = /tmp/test-transport/api-slow-ats-p1/
+
+[transport]
+PLUGINS = tcp
+
diff --git a/src/transport/test_transport_api_slow_ats_peer2.conf b/src/transport/test_transport_api_slow_ats_peer2.conf
new file mode 100644 (file)
index 0000000..4895e4c
--- /dev/null
@@ -0,0 +1,9 @@
+@INLINE@ template_cfg_peer2.conf
+[PATHS]
+GNUNET_TEST_HOME = /tmp/test-transport/api-slow-ats-p2/
+
+[transport]
+PLUGINS = tcp
+
+[ats]
+PREFIX = ./test_delay -t 30 --