transport testing testcase
[oweals/gnunet.git] / src / transport / Makefile.am
index e4a266871fe569f8a0da72df8fc4b9b72eb31ea3..5fe5aa32fb1dd6a4fc1a4330e1921fac62f4fbd9 100644 (file)
@@ -1,39 +1,42 @@
-INCLUDES = -I$(top_srcdir)/src/include
+INCLUDES = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
 
 plugindir = $(libdir)/gnunet
 
-if MINGW
-  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
-  NATBIN = gnunet-nat-server gnunet-nat-client
-  NATSERVER = gnunet-nat-server-windows.c
-  NATCLIENT = gnunet-nat-client-windows.c
-else
-  NATSERVER = gnunet-nat-server.c
-  NATCLIENT = gnunet-nat-client.c
-endif
 
 if HAVE_MHD
  GN_LIBMHD = -lmicrohttpd
  HTTP_PLUGIN_LA = libgnunet_plugin_transport_http.la
- HTTP_PLUGIN_TEST = test_plugin_transport_http
+# 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 \
                   test_quota_compliance_http_asymmetric_recv_constant
  HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
- HTTPS_PLUGIN_TEST = test_plugin_transport_https
+# 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 \
                test_quota_compliance_https_asymmetric_recv_constant
 endif
 
+if HAVE_LIBGLPK
+ TRANSPORT_ATS_SRC = gnunet-service-transport_ats.c
+ TEST_TRANSPORT_ATS = \
+   test_transport_ats \
+   test_transport_ats_multiple_peers 
+  GN_GLPK = -lglpk
+if HAVE_BENCHMARKS
+ ATS_TRANSPORT_BENCHMARKS = \
+   perf_transport_ats 
+endif
+endif
+
 if USE_COVERAGE
   AM_CFLAGS = --coverage -O0
 endif
 
-if HAVE_PCAP
 if LINUX
+if HAVE_EXPERIMENTAL
  WLAN_BIN = gnunet-transport-wlan-helper
  WLAN_BIN_DUMMY = gnunet-transport-wlan-helper-dummy
  WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la
@@ -43,6 +46,14 @@ if LINUX
 endif
 endif
 
+if LINUX
+install-exec-hook:
+       chown root:root $(bindir)/gnunet-transport-wlan-helper || true
+       chmod u+s $(bindir)/gnunet-transport-wlan-helper || true
+else
+install-exec-hook:
+endif
+
 if !MINGW
 UNIX_PLUGIN_LA = libgnunet_plugin_transport_unix.la
 UNIX_PLUGIN_TEST = test_transport_api_unix 
@@ -50,25 +61,23 @@ UNIX_REL_TEST = test_transport_api_unreliability_unix
 UNIX_QUOTA_TEST = test_quota_compliance_unix \
      test_quota_compliance_unix_asymmetric_recv_constant
 endif
-     
-if LINUX
-NATBIN = gnunet-nat-server gnunet-nat-client
-install-exec-hook:
-       chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-transport-wlan-helper || true
-       chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-transport-wlan-helper || true
-else
-install-exec-hook:
-endif
 
-#noinst_PROGRAMS = ${check_PROGRAMS}
+noinst_PROGRAMS = $(WLAN_BIN_DUMMY)
+
 
 lib_LTLIBRARIES = \
-  libgnunettransport.la
+  libgnunettransport.la \
+  libgnunettransporttesting.la
+libgnunettransporttesting_la_SOURCES = \
+       transport-testing.c
 
 libgnunettransport_la_SOURCES = \
   transport_api.c transport.h \
   transport_api_blacklist.c \
-  transport_api_address_lookup.c 
+  transport_api_address_lookup.c \
+  transport_api_peer_address_lookup.c \
+  transport_api_address_iterate.c
 libgnunettransport_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/util/libgnunetutil.la \
@@ -77,24 +86,31 @@ libgnunettransport_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
   -version-info 0:0:0
 
-
 bin_PROGRAMS = \
  gnunet-transport \
  $(WLAN_BIN) \
- gnunet-service-transport $(NATBIN) \
- $(WLAN_BIN_DUMMY)
-
-bin_SCRIPTS = \
+ gnunet-service-transport \
+ gnunet-service-transport-new \
+ gnunet-transport-list-connections \
  gnunet-transport-certificate-creation
 
-gnunet_nat_server_SOURCES = \
- $(NATSERVER)
+#bin_SCRIPTS = \
+# gnunet-transport-certificate-creation
 
+gnunet_transport_certificate_creation_SOURCES = \
+ gnunet-transport-certificate-creation.c
+gnunet_transport_certificate_creation_LDADD = \
+  $(top_builddir)/src/util/libgnunetutil.la
 
 gnunet_transport_wlan_helper_SOURCES = \
- wlan/radiotap-parser.c \
- wlan/helper_common.c \
- gnunet-transport-wlan-helper.c
+ wlan/byteorder.h \
+ wlan/crctable_osdep.h \
+ wlan/helper_common.c wlan/helper_common.h \
+ wlan/ieee80211.h \
+ wlan/ieee80211_radiotap.h \
+ wlan/loopback_helper.h \
+ wlan/radiotap-parser.c wlan/radiotap-parser.h \
+ gnunet-transport-wlan-helper.c gnunet-transport-wlan-helper.h
 
 gnunet_transport_wlan_helper_dummy_SOURCES = \
  wlan/radiotap-parser.c \
@@ -102,15 +118,19 @@ gnunet_transport_wlan_helper_dummy_SOURCES = \
  test_plugin_transport_wlan_dummy.c
 
 gnunet_transport_wlan_helper_LDADD = \
-  $(top_builddir)/src/util/libgnunetutil.la \
- -lpcap
+  $(top_builddir)/src/util/libgnunetutil.la 
 
 gnunet_transport_wlan_helper_dummy_LDADD = \
+  $(top_builddir)/src/util/libgnunetutil.la 
+
+gnunet_transport_list_connections_SOURCES = \
+ gnunet-transport-list-connections.c         
+gnunet_transport_list_connections_LDADD = \
+  $(top_builddir)/src/transport/libgnunettransport.la \
   $(top_builddir)/src/util/libgnunetutil.la \
- -lpcap
-gnunet_nat_client_SOURCES = \
- $(NATCLIENT)         
+  $(GN_LIBINTL)
+gnunet_transport_list_connections_DEPENDENCIES = \
+  libgnunettransport.la
 
 gnunet_transport_SOURCES = \
  gnunet-transport.c         
@@ -121,12 +141,8 @@ gnunet_transport_LDADD = \
 gnunet_transport_DEPENDENCIES = \
   libgnunettransport.la                                
 
-if HAVE_LIBGLPK
-  GN_GLPK = -lglpk
-endif
-
 gnunet_service_transport_SOURCES = \
- gnunet-service-transport.c
+ gnunet-service-transport.c $(TRANSPORT_ATS_SRC)
 gnunet_service_transport_LDADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
@@ -134,8 +150,23 @@ gnunet_service_transport_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_GLPK) \
   $(GN_LIBINTL)
-gnunet_service_transport_DEPENDENCIES = \
-  libgnunettransport.la                                  
+
+gnunet_service_transport_new_SOURCES = \
+ gnunet-service-transport-new.c gnunet-service-transport.h \
+ gnunet-service-transport_ats-new.h gnunet-service-transport_ats-new.c \
+ gnunet-service-transport_blacklist.h gnunet-service-transport_blacklist.c \
+ gnunet-service-transport_clients.h gnunet-service-transport_clients.c \
+ gnunet-service-transport_hello.h gnunet-service-transport_hello.c \
+ gnunet-service-transport_neighbours.h gnunet-service-transport_neighbours.c \
+ gnunet-service-transport_plugins.h gnunet-service-transport_plugins.c \
+ gnunet-service-transport_validation.h gnunet-service-transport_validation.c 
+gnunet_service_transport_new_LDADD = \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(GN_GLPK) \
+  $(GN_LIBINTL)
 
 plugin_LTLIBRARIES = \
   libgnunet_plugin_transport_tcp.la \
@@ -145,7 +176,6 @@ plugin_LTLIBRARIES = \
   $(HTTPS_PLUGIN_LA) \
   $(WLAN_PLUGIN_LA) \
   libgnunet_plugin_transport_template.la
-# TODO: add nat, etc.
 
 libgnunet_plugin_transport_tcp_la_SOURCES = \
   plugin_transport_tcp.c
@@ -166,25 +196,28 @@ libgnunet_plugin_transport_template_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
 libgnunet_plugin_transport_wlan_la_SOURCES = \
-       plugin_transport_wlan.c
+  plugin_transport_wlan.c plugin_transport_wlan.h
 libgnunet_plugin_transport_wlan_la_LIBADD = \
-       $(top_builddir)/src/hello/libgnunethello.la \
-       $(top_builddir)/src/statistics/libgnunetstatistics.la \
-       $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
-       $(top_builddir)/src/util/libgnunetutil.la 
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/fragmentation/libgnunetfragmentation.la \
+  $(top_builddir)/src/util/libgnunetutil.la 
 libgnunet_plugin_transport_wlan_la_LDFLAGS = \
-       $(GN_PLUGIN_LDFLAGS)
+  $(GN_PLUGIN_LDFLAGS)
 
 libgnunet_plugin_transport_udp_la_SOURCES = \
   plugin_transport_udp.c
 libgnunet_plugin_transport_udp_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/fragmentation/libgnunetfragmentation.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/nat/libgnunetnat.la \
   $(top_builddir)/src/util/libgnunetutil.la 
 libgnunet_plugin_transport_udp_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
+
 libgnunet_plugin_transport_unix_la_SOURCES = \
   plugin_transport_unix.c
 libgnunet_plugin_transport_unix_la_LIBADD = \
@@ -202,10 +235,15 @@ libgnunet_plugin_transport_http_la_LIBADD = \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   @LIBCURL@ \
+  $(top_builddir)/src/nat/libgnunetnat.la \
   $(top_builddir)/src/util/libgnunetutil.la 
 libgnunet_plugin_transport_http_la_LDFLAGS = \
  $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
+libgnunet_plugin_transport_http_la_CFLAGS = \
+ $(CFLAGS) 
+libgnunet_plugin_transport_http_la_CPPFLAGS = \
+ @LIBCURL_CPPFLAGS@
 
 libgnunet_plugin_transport_https_la_SOURCES = \
   plugin_transport_http.c
@@ -214,17 +252,22 @@ libgnunet_plugin_transport_https_la_LIBADD = \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   @LIBCURL@ \
+  $(top_builddir)/src/nat/libgnunetnat.la \
   $(top_builddir)/src/util/libgnunetutil.la 
 libgnunet_plugin_transport_https_la_LDFLAGS = \
  $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_https_la_CFLAGS = \
- $(CFLAGS) -DBUILD_HTTPS  
+ $(CFLAGS) -DBUILD_HTTPS 
+libgnunet_plugin_transport_https_la_CPPFLAGS = \
+ @LIBCURL_CPPFLAGS@
 
 
 check_PROGRAMS = \
- test_transport_ats \
- test_transport_ats_perf \
+ test_transport_testing \
+ test_transport_api_disconnect \
+ $(TEST_TRANSPORT_ATS) \
+ $(ATS_TRANSPORT_BENCHMARKS) \
  test_transport_api_tcp \
  test_transport_api_tcp_nat \
  test_transport_api_udp \
@@ -241,6 +284,7 @@ check_PROGRAMS = \
  $(UNIX_REL_TEST) \
  $(HTTP_REL_TEST) \
  $(HTTPS_REL_TEST) \
+ test_transport_api_multiaddress_tcp \
  test_quota_compliance_tcp \
  test_quota_compliance_tcp_asymmetric_recv_constant \
  test_quota_compliance_udp \
@@ -251,12 +295,13 @@ check_PROGRAMS = \
  $(WLAN_API_TEST) \
  $(WLAN_REL_TEST) \
  $(WLAN_UREL_TEST)
-# TODO: add tests for nat, etc.
 
-if !DISABLE_TEST_RUN
+if ENABLE_TEST_RUN
 TESTS = \
- test_transport_ats \
- test_transport_ats_perf \
+ test_transport_testing \
+ test_transport_api_disconnect \
+ $(TEST_TRANSPORT_ATS) \
+ $(ATS_TRANSPORT_BENCHMARKS) \
  test_transport_api_tcp \
  test_transport_api_tcp_nat \
  test_transport_api_udp \
@@ -266,6 +311,7 @@ TESTS = \
  $(HTTP_API_TEST) \
  $(HTTPS_PLUGIN_TEST) \
  $(HTTPS_API_TEST) \
+ test_transport_api_multiaddress_tcp \
  test_transport_api_multi \
  test_transport_api_reliability_tcp \
  test_transport_api_reliability_tcp_nat \
@@ -280,27 +326,49 @@ TESTS = \
  $(UNIX_QUOTA_TEST) \
  $(HTTP_QUOTA_TEST) \
  $(HTTPS_QUOTA_TEST) \
+ $(WLAN_API_TEST) \
+ $(WLAN_REL_TEST) \
  $(WLAN_UREL_TEST)
 endif
 
-# $(WLAN_API_TEST) 
-# $(WLAN_REL_TEST) 
+test_transport_testing_SOURCES = \
+ test_transport_testing.c
+test_transport_testing_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
+
+test_transport_api_disconnect_SOURCES = \
+ test_transport_api_disconnect.c
+test_transport_api_disconnect_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/testing/libgnunettesting.la \
+ $(top_builddir)/src/util/libgnunetutil.la 
+
 
 test_transport_ats_SOURCES = \
- test_transport_ats.c
+ test_transport_ats.c $(TRANSPORT_ATS_SRC)
 test_transport_ats_LDADD = -lm \
+ -lglpk \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la 
 
-test_transport_ats_perf_SOURCES = \
- test_transport_ats_perf.c
-test_transport_ats_perf_LDADD = \
+test_transport_ats_multiple_peers_SOURCES = \
+ test_transport_ats_multiple_peers.c $(TRANSPORT_ATS_SRC)
+test_transport_ats_multiple_peers_LDADD = -lm \
+ -lglpk \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
- $(GN_GLPK) \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
+perf_transport_ats_SOURCES = \
+ perf_transport_ats.c
+perf_transport_ats_LDADD = \
+ -lglpk \
  $(top_builddir)/src/util/libgnunetutil.la  
 
 test_transport_api_tcp_SOURCES = \
@@ -324,6 +392,13 @@ test_transport_api_reliability_tcp_LDADD = \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la  
 
+test_transport_api_multiaddress_tcp_SOURCES = \
+ test_transport_api_multiaddress.c
+test_transport_api_multiaddress_tcp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  
+
 test_transport_api_reliability_tcp_nat_SOURCES = \
  test_transport_api_reliability.c
 test_transport_api_reliability_tcp_nat_LDADD = \
@@ -337,7 +412,7 @@ test_transport_api_reliability_wlan_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la
+
 test_transport_api_unreliability_wlan_SOURCES = \
  test_transport_api_unreliability.c
 test_transport_api_unreliability_wlan_LDADD = \
@@ -366,14 +441,13 @@ test_transport_api_unix_LDADD = \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la 
 
-test_plugin_transport_http_SOURCES = \
- test_plugin_transport_http.c
-test_plugin_transport_http_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/statistics/libgnunetstatistics.la \
- @LIBCURL@ \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la  
+#test_plugin_transport_http_SOURCES = \
+# test_plugin_transport_http.c
+#test_plugin_transport_http_LDADD = \
+# $(top_builddir)/src/statistics/libgnunetstatistics.la \
+# @LIBCURL@ \
+# $(top_builddir)/src/hello/libgnunethello.la \
+# $(top_builddir)/src/util/libgnunetutil.la  
 
 test_transport_api_http_SOURCES = \
  test_transport_api.c
@@ -389,14 +463,13 @@ test_transport_api_reliability_http_LDADD = \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la
 
-test_plugin_transport_https_SOURCES = \
- test_plugin_transport_https.c
-test_plugin_transport_https_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/statistics/libgnunetstatistics.la \
- @LIBCURL@ \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la  
+#test_plugin_transport_https_SOURCES = \
+# test_plugin_transport_https.c
+#test_plugin_transport_https_LDADD = \
+# $(top_builddir)/src/statistics/libgnunetstatistics.la \
+# @LIBCURL@ \
+# $(top_builddir)/src/hello/libgnunethello.la \
+# $(top_builddir)/src/util/libgnunetutil.la  
 
 test_transport_api_https_SOURCES = \
  test_transport_api.c
@@ -426,7 +499,6 @@ test_transport_api_unreliability_udp_LDADD = \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la
 
-if HAVE_PCAP
 if LINUX
 test_transport_api_wlan_SOURCES = \
  test_transport_api.c
@@ -435,7 +507,6 @@ test_transport_api_wlan_LDADD = \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la  
 endif
-endif
 
 test_quota_compliance_tcp_SOURCES = \
  test_quota_compliance.c
@@ -540,6 +611,8 @@ test_transport_api_multi_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la  
 EXTRA_DIST = \
   gnunet-transport-certificate-creation \
+  ats_mlp_p100_m400.problem \
+  test_transport_defaults.conf \
   test_transport_api_data.conf \
   test_transport_api_tcp_peer1.conf \
   test_transport_api_tcp_peer2.conf \
@@ -576,4 +649,8 @@ EXTRA_DIST = \
   test_quota_compliance_udp_peer1.conf \
   test_quota_compliance_udp_peer2.conf \
   test_quota_compliance_unix_peer1.conf \
-  test_quota_compliance_unix_peer2.conf
+  test_quota_compliance_unix_peer2.conf \
+  test_plugin_transport_data_udp.conf \
+  test_transport_ats_1addr.conf \
+  test_transport_ats_2addr.conf \
+  test_transport_ats_4addr.conf