From e14f682ca1de9f26c90420dd33ffad215bfef45c Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 30 Nov 2010 14:02:25 +0000 Subject: added multi plugin transport api testcase --- src/transport/Makefile.am | 10 ++ src/transport/test_transport_api.c | 24 +++- src/transport/test_transport_api_multi_peer1.conf | 132 +++++++++++++++++++++ src/transport/test_transport_api_multi_peer2.conf | 134 ++++++++++++++++++++++ 4 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 src/transport/test_transport_api_multi_peer1.conf create mode 100644 src/transport/test_transport_api_multi_peer2.conf (limited to 'src') diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 313d94854..e2d5acda8 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -200,6 +200,7 @@ check_PROGRAMS = \ $(HTTP_API_TEST) \ $(HTTPS_PLUGIN_TEST) \ $(HTTPS_API_TEST) \ + test_transport_api_multi \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat \ test_transport_api_reliability_udp \ @@ -223,6 +224,7 @@ TESTS = \ $(HTTP_API_TEST) \ $(HTTPS_PLUGIN_TEST) \ $(HTTPS_API_TEST) \ + test_transport_api_multi \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat \ $(HTTP_REL_TEST) \ @@ -391,6 +393,12 @@ test_quota_compliance_udp_asymmetric_recv_constant_LDADD = \ # $(top_builddir)/src/transport/libgnunettransport.la \ # $(top_builddir)/src/util/libgnunetutil.la +test_transport_api_multi_SOURCES = \ + test_transport_api.c +test_transport_api_multi_LDADD = \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la + endif @@ -409,6 +417,8 @@ EXTRA_DIST = \ test_transport_api_http_peer2.conf \ test_transport_api_https_peer1.conf \ test_transport_api_https_peer2.conf \ + test_transport_api_multi_peer1.conf \ + test_transport_api_multi_peer2.conf \ test_transport_api_rel_http_peer1.conf \ test_transport_api_rel_http_peer2.conf \ test_transport_api_rel_https_peer1.conf \ diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 488471e7a..1f9c56974 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -82,6 +82,8 @@ static int is_http; static int is_https; +static int is_multi_protocol; + static GNUNET_SCHEDULER_TaskIdentifier die_task; static char * key_file_p1; @@ -344,6 +346,12 @@ run (void *cls, die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); + if (is_multi_protocol) + { + setup_peer (&p1, "test_transport_api_multi_peer1.conf"); + setup_peer (&p2, "test_transport_api_multi_peer2.conf"); + } + if (is_udp) { setup_peer (&p1, "test_transport_api_udp_peer1.conf"); @@ -559,10 +567,22 @@ main (int argc, char *argv[]) { is_http = GNUNET_YES; } + else if (strstr(argv[0], "multi") != NULL) + { + is_multi_protocol = GNUNET_YES; + } ret = check (); - GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2"); + if (is_multi_protocol) + { + GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/"); + GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/"); + } + else + { + GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1"); + GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2"); + } return ret; } diff --git a/src/transport/test_transport_api_multi_peer1.conf b/src/transport/test_transport_api_multi_peer1.conf new file mode 100644 index 000000000..0208ac29e --- /dev/null +++ b/src/transport/test_transport_api_multi_peer1.conf @@ -0,0 +1,132 @@ +[transport-tcp] +DISABLEV6 = YES +PORT = 30001 +BINDTO = 127.0.0.1 +BEHIND_NAT = NO +ALLOW_NAT = NO +ENABLE_UPNP = NO +INTERNAL_ADDRESS = 127.0.0.1 +EXTERNAL_ADDRESS = 127.0.0.1 + +[transport-udp] +PORT = 30001 + +[transport-http] +PORT = 30002 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 + +[transport-https] +PORT = 30003 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 + +[fs] +AUTOSTART = NO + +[datastore] +AUTOSTART = NO + +[core] +AUTOSTART = NO + +[hostlist] +HTTP-PROXY = +SERVERS = http://gnunet.org:8080/ +OPTIONS = -b +BINARY = gnunet-daemon-hostlist +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +HTTPPORT = 8080 + +[topology] +BINARY = gnunet-daemon-topology +CONFIG = $DEFAULTCONFIG +FRIENDS = $SERVICEHOME/friends +TARGET-CONNECTION-COUNT = 16 +AUTOCONNECT = YES +FRIENDS-ONLY = NO +MINIMUM-FRIENDS = 0 + +[transport] +PLUGINS = tcp udp http https +#DEBUG = YES +#PREFIX = xterm -T transport2 -e gdb --command=cmd --args +#PREFIX = valgrind --tool=memcheck --leak-check=full --log-file=transport%p +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +NEIGHBOUR_LIMIT = 50 +BINARY = gnunet-service-transport +#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 12365 +UNIXPATH = /tmp/gnunet-p1-service-transport.sock + +[peerinfo] +TRUST = $SERVICEHOME/data/credit/ +HOSTS = $SERVICEHOME/data/hosts/ +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-peerinfo +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 12369 +UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock + +[resolver] +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-resolver +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 1236 +UNIXPATH = /tmp/gnunet-p1-service-resolver.sock + +[statistics] +AUTOSTART = YES +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-statistics +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 12367 +UNIXPATH = /tmp/gnunet-p1-service-statistics.sock + +[arm] +DEFAULTSERVICES = transport +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-arm +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 12366 +UNIXPATH = /tmp/gnunet-p1-service-arm.sock + +[TESTING] +WEAKRANDOM = YES + +[gnunetd] +HOSTKEY = $SERVICEHOME/.hostkey + +[PATHS] +DEFAULTCONFIG = test_transport_api_multi_peer1.conf +SERVICEHOME = /tmp/test-gnunetd-transport-multi-peer-1/ + + +[dht] +AUTOSTART = NO + + diff --git a/src/transport/test_transport_api_multi_peer2.conf b/src/transport/test_transport_api_multi_peer2.conf new file mode 100644 index 000000000..d00f0a0be --- /dev/null +++ b/src/transport/test_transport_api_multi_peer2.conf @@ -0,0 +1,134 @@ +[transport-tcp] +DISABLEV6 = YES +PORT = 0 +BINDTO = 127.0.0.1 +BEHIND_NAT = NO +ALLOW_NAT = NO +ENABLE_UPNP = NO +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 + +[transport-udp] +PORT = 40001 + +[transport-http] +PORT = 40002 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 + +[transport-https] +PORT = 40003 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 + + +[core] +AUTOSTART = NO + +[fs] +AUTOSTART = NO + +[datastore] +AUTOSTART = NO + +[hostlist] +HTTP-PROXY = +SERVERS = http://gnunet.org:8080/ +OPTIONS = -b +BINARY = gnunet-daemon-hostlist +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +HTTPPORT = 8080 + +[topology] +BINARY = gnunet-daemon-topology +CONFIG = $DEFAULTCONFIG +FRIENDS = $SERVICEHOME/friends +TARGET-CONNECTION-COUNT = 16 +AUTOCONNECT = YES +FRIENDS-ONLY = NO +MINIMUM-FRIENDS = 0 + +[transport] +PLUGINS = tcp udp http https +#DEBUG = YES +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +NEIGHBOUR_LIMIT = 50 +#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport +BINARY = gnunet-service-transport +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 22365 +UNIXPATH = /tmp/gnunet-p2-service-transport.sock +#PREFIX = valgrind --tool=callgrind +#PREFIX = xterm -T transport2 -e gdb --command=cmd --args +#PREFIX = valgrind --leak-check=full + +[peerinfo] +TRUST = $SERVICEHOME/data/credit/ +HOSTS = $SERVICEHOME/data/hosts/ +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-peerinfo +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 22369 +UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock + +[resolver] +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-resolver +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 22364 +UNIXPATH = /tmp/gnunet-p2-service-resolver.sock + +[statistics] +AUTOSTART = YES +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-statistics +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 22367 +UNIXPATH = /tmp/gnunet-p2-service-statistics.sock + +[arm] +DEFAULTSERVICES = transport +ACCEPT_FROM6 = ::1; +ACCEPT_FROM = 127.0.0.1; +BINARY = gnunet-service-arm +CONFIG = $DEFAULTCONFIG +HOME = $SERVICEHOME +HOSTNAME = localhost +PORT = 22366 +UNIXPATH = /tmp/gnunet-p2-service-arm.sock + +[TESTING] +WEAKRANDOM = YES + +[gnunetd] +HOSTKEY = $SERVICEHOME/.hostkey + +[PATHS] +DEFAULTCONFIG = test_transport_api_multi_peer2.conf +SERVICEHOME = /tmp/test-gnunetd-transport-multi-peer-2/ + + +[dht] +AUTOSTART = NO + + -- cgit v1.2.3