summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-08-28 11:43:40 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-08-28 11:43:40 +0000
commit415c261ba0169b53235d5e96da4d058e5e1f2d00 (patch)
tree262d87a0bf229e8a97f10f6a68371797b31fcf28
parent2ec32745cf8b61bb257f4cb159f0d0ff83246e77 (diff)
tests
-rw-r--r--src/transport/Makefile.am96
-rw-r--r--src/transport/plugin_transport_http_client.c2
-rw-r--r--src/transport/plugin_transport_http_server.c27
-rw-r--r--src/transport/test_quota_compliance_https_asymmetric_peer1.conf9
-rw-r--r--src/transport/test_quota_compliance_https_asymmetric_peer2.conf6
-rw-r--r--src/transport/test_quota_compliance_https_peer1.conf7
-rw-r--r--src/transport/test_quota_compliance_https_peer2.conf4
-rw-r--r--src/transport/test_transport_api_https_peer1.conf4
-rw-r--r--src/transport/test_transport_api_https_peer2.conf4
-rw-r--r--src/transport/test_transport_api_reliability_https_peer1.conf7
-rw-r--r--src/transport/test_transport_api_reliability_https_peer2.conf4
-rw-r--r--src/transport/test_transport_api_timeout_https_peer1.conf9
-rw-r--r--src/transport/test_transport_api_timeout_https_peer2.conf6
13 files changed, 70 insertions, 115 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index a2fa0f0e9..d4f16379a 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -34,22 +34,12 @@ if HAVE_LIBCURL
HTTPS_API_TEST = test_transport_api_https
-endif
-endif
-
-if FALSE
-
- HTTP_REL_TEST = test_transport_api_reliability_http
- HTTP_NAT_REL_TEST = test_transport_api_reliability_http_nat
-
- HTTPS_NAT_API_TEST = test_transport_api_https_nat
HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https
HTTPS_REL_TEST = test_transport_api_reliability_https
- HTTPS_NAT_REL_TEST = test_transport_api_reliability_https_nat
HTTPS_QUOTA_TEST = test_quota_compliance_https \
- test_quota_compliance_https_asymmetric
+ test_quota_compliance_https_asymmetric
endif
-
+endif
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
@@ -705,6 +695,21 @@ test_quota_compliance_http_asymmetric_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/transport/libgnunettransporttesting.la
+test_quota_compliance_https_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_https_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+
+test_quota_compliance_https_asymmetric_SOURCES = \
+ test_quota_compliance.c
+test_quota_compliance_https_asymmetric_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
# HTTPS tests
test_transport_api_https_SOURCES = \
@@ -714,40 +719,15 @@ test_transport_api_https_LDADD = \
$(top_builddir)/src/hello/libgnunethello.la \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/transport/libgnunettransporttesting.la
-
-if FALSE
-
+
test_transport_api_timeout_https_SOURCES = \
test_transport_api_timeout.c
test_transport_api_timeout_https_LDADD = \
$(top_builddir)/src/transport/libgnunettransport.la \
$(top_builddir)/src/hello/libgnunethello.la \
$(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-test_transport_api_http_nat_SOURCES = \
- test_transport_api.c
-test_transport_api_http_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-test_transport_api_reliability_http_nat_SOURCES = \
- test_transport_api_reliability.c
-test_transport_api_reliability_http_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-test_transport_api_https_nat_SOURCES = \
- test_transport_api.c
-test_transport_api_https_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+
test_transport_api_reliability_https_SOURCES = \
test_transport_api_reliability.c
@@ -757,42 +737,6 @@ test_transport_api_reliability_https_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/transport/libgnunettransporttesting.la
-test_transport_api_reliability_https_nat_SOURCES = \
- test_transport_api_reliability.c
-test_transport_api_reliability_https_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-test_quota_compliance_http_SOURCES = \
- test_quota_compliance.c
-test_quota_compliance_http_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-
-test_quota_compliance_https_SOURCES = \
- test_quota_compliance.c
-test_quota_compliance_https_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-test_quota_compliance_https_asymmetric_SOURCES = \
- test_quota_compliance.c
-test_quota_compliance_https_asymmetric_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la
-
-
-endif
-
test_transport_api_unreliability_unix_SOURCES = \
test_transport_api_unreliability.c
test_transport_api_unreliability_unix_LDADD = \
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index eb601e30b..ebb4f9402 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -33,7 +33,7 @@
#endif
-#define VERBOSE_CURL GNUNET_YES
+#define VERBOSE_CURL GNUNET_NO
#include "platform.h"
#include "gnunet_protocols.h"
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 2ce844307..46734e144 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1857,8 +1857,11 @@ server_add_address (void *cls, int add_remove, const struct sockaddr *addr,
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Notifying transport to add address `%s'\n",
http_common_plugin_address_to_string(NULL, w->addr, w->addrlen));
-
+#if BUILD_HTTPS
+ plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, w->addrlen, "https_client");
+#else
plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, w->addrlen, "http_client");
+#endif
}
@@ -1889,7 +1892,11 @@ server_remove_address (void *cls, int add_remove, const struct sockaddr *addr,
"Notifying transport to remove address `%s'\n",
http_common_plugin_address_to_string (NULL, w->addr, w->addrlen));
GNUNET_CONTAINER_DLL_remove (plugin->addr_head, plugin->addr_tail, w);
+#if BUILD_HTTPS
+ plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, w->addrlen, "https_client");
+#else
plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, w->addrlen, "http_client");
+#endif
GNUNET_free (w->addr);
GNUNET_free (w);
}
@@ -2253,9 +2260,16 @@ server_notify_external_hostname (void *cls, const struct GNUNET_SCHEDULER_TaskCo
plugin->ext_addr_len = strlen (plugin->ext_addr) + 1;
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Notifying transport about external hostname address `%s'\n", plugin->ext_addr);
+
+#if BUILD_HTTPS
+ plugin->env->notify_address (plugin->env->cls, GNUNET_YES,
+ plugin->ext_addr, plugin->ext_addr_len,
+ "https_client");
+#else
plugin->env->notify_address (plugin->env->cls, GNUNET_YES,
plugin->ext_addr, plugin->ext_addr_len,
"http_client");
+#endif
}
@@ -2494,11 +2508,20 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
http_common_plugin_address_to_string (NULL,
plugin->ext_addr,
plugin->ext_addr_len));
+#if BUILD_HTTPS
plugin->env->notify_address (plugin->env->cls,
GNUNET_NO,
plugin->ext_addr,
plugin->ext_addr_len,
- "http_client");
+ "https_client");
+#else
+ plugin->env->notify_address (plugin->env->cls,
+ GNUNET_NO,
+ plugin->ext_addr,
+ plugin->ext_addr_len,
+ "http_client");
+#endif
+
}
/* Stop to report addresses to transport service */
diff --git a/src/transport/test_quota_compliance_https_asymmetric_peer1.conf b/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
index ad4aab0fd..092762781 100644
--- a/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
+++ b/src/transport/test_quota_compliance_https_asymmetric_peer1.conf
@@ -1,12 +1,9 @@
@INLINE@ template_cfg_peer1.conf
[PATHS]
SERVICEHOME = /tmp/test_quota_compliance_peer1/
-DEFAULTCONFIG = test_quota_compliance_https_peer1.conf
+DEFAULTCONFIG = test_quota_compliance_https_asymmetric_peer1.conf
-[transport-https]
-PORT = 4001
-KEY_FILE = https_key_quota_p1.key
-CERT_FILE = https_cert_quota_p1.crt
+[transport-https_client]
[arm]
PORT = 4006
@@ -26,7 +23,7 @@ UNIXPATH = /tmp/test_quota_compliance_https_peerinfo_peer1.sock
[transport]
PORT = 4002
-PLUGINS = https
+PLUGINS = https_client
UNIXPATH = /tmp/test_quota_compliance_https_transport_peer1.sock
diff --git a/src/transport/test_quota_compliance_https_asymmetric_peer2.conf b/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
index 94d7412af..6646a582c 100644
--- a/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
+++ b/src/transport/test_quota_compliance_https_asymmetric_peer2.conf
@@ -1,9 +1,9 @@
@INLINE@ template_cfg_peer2.conf
[PATHS]
SERVICEHOME = /tmp/test_quota_compliance_peer2
-DEFAULTCONFIG = test_quota_compliance_https_peer2.conf
+DEFAULTCONFIG = test_quota_compliance_https_asymmetric_peer2.conf
-[transport-https]
+[transport-https_server]
PORT = 3001
KEY_FILE = https_key_quota_p2.key
CERT_FILE = https_cert_qutoa_p2.crt
@@ -26,7 +26,7 @@ UNIXPATH = /tmp/test_quota_compliance_https_peerinfo_peer2.sock
[transport]
PORT = 3002
-PLUGINS = https
+PLUGINS = https_server
UNIXPATH = /tmp/https_transport_peer2.sock
diff --git a/src/transport/test_quota_compliance_https_peer1.conf b/src/transport/test_quota_compliance_https_peer1.conf
index ad4aab0fd..a23b2ad01 100644
--- a/src/transport/test_quota_compliance_https_peer1.conf
+++ b/src/transport/test_quota_compliance_https_peer1.conf
@@ -3,10 +3,7 @@
SERVICEHOME = /tmp/test_quota_compliance_peer1/
DEFAULTCONFIG = test_quota_compliance_https_peer1.conf
-[transport-https]
-PORT = 4001
-KEY_FILE = https_key_quota_p1.key
-CERT_FILE = https_cert_quota_p1.crt
+[transport-https_client]
[arm]
PORT = 4006
@@ -26,7 +23,7 @@ UNIXPATH = /tmp/test_quota_compliance_https_peerinfo_peer1.sock
[transport]
PORT = 4002
-PLUGINS = https
+PLUGINS = https_client
UNIXPATH = /tmp/test_quota_compliance_https_transport_peer1.sock
diff --git a/src/transport/test_quota_compliance_https_peer2.conf b/src/transport/test_quota_compliance_https_peer2.conf
index 94d7412af..490b97983 100644
--- a/src/transport/test_quota_compliance_https_peer2.conf
+++ b/src/transport/test_quota_compliance_https_peer2.conf
@@ -3,7 +3,7 @@
SERVICEHOME = /tmp/test_quota_compliance_peer2
DEFAULTCONFIG = test_quota_compliance_https_peer2.conf
-[transport-https]
+[transport-https_server]
PORT = 3001
KEY_FILE = https_key_quota_p2.key
CERT_FILE = https_cert_qutoa_p2.crt
@@ -26,7 +26,7 @@ UNIXPATH = /tmp/test_quota_compliance_https_peerinfo_peer2.sock
[transport]
PORT = 3002
-PLUGINS = https
+PLUGINS = https_server
UNIXPATH = /tmp/https_transport_peer2.sock
diff --git a/src/transport/test_transport_api_https_peer1.conf b/src/transport/test_transport_api_https_peer1.conf
index 8a93ca1e8..b387e5a10 100644
--- a/src/transport/test_transport_api_https_peer1.conf
+++ b/src/transport/test_transport_api_https_peer1.conf
@@ -3,7 +3,7 @@
SERVICEHOME = /tmp/test-transport/api-https-p1/
DEFAULTCONFIG = test_transport_api_https_peer1.conf
-[transport-https]
+[transport-https_client]
PORT = 12100
KEY_FILE = $SERVICEHOME/https_key_p1.key
CERT_FILE = $SERVICEHOME/https_cert_p1.crt
@@ -25,7 +25,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
[transport]
PORT = 12101
-PLUGINS = https
+PLUGINS = https_client
UNIXPATH = /tmp/gnunet-p1-service-transport.sock
DEBUG = NO
diff --git a/src/transport/test_transport_api_https_peer2.conf b/src/transport/test_transport_api_https_peer2.conf
index 0710f41ce..345ef1518 100644
--- a/src/transport/test_transport_api_https_peer2.conf
+++ b/src/transport/test_transport_api_https_peer2.conf
@@ -3,7 +3,7 @@
SERVICEHOME = /tmp/test-transport/api-https-p2/
DEFAULTCONFIG = test_transport_api_https_peer2.conf
-[transport-https]
+[transport-https_server]
PORT = 12110
KEY_FILE = $SERVICEHOME/https_key_p2.key
CERT_FILE = $SERVICEHOME/https_cert_p2.crt
@@ -26,7 +26,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
[transport]
PORT = 12111
-PLUGINS = https
+PLUGINS = https_server
UNIXPATH = /tmp/gnunet-p2-service-transport.sock
DEBUG = NO
diff --git a/src/transport/test_transport_api_reliability_https_peer1.conf b/src/transport/test_transport_api_reliability_https_peer1.conf
index 0699f69c8..4a2c0b5a6 100644
--- a/src/transport/test_transport_api_reliability_https_peer1.conf
+++ b/src/transport/test_transport_api_reliability_https_peer1.conf
@@ -3,10 +3,7 @@
SERVICEHOME = /tmp/test-transport/api-https-p1/
DEFAULTCONFIG = test_transport_api_reliability_https_peer1.conf
-[transport-https]
-PORT = 12300
-KEY_FILE = $SERVICEHOME/https_key_p1.key
-CERT_FILE = $SERVICEHOME/https_cert_p1.crt
+[transport-https_client]
[arm]
PORT = 12305
@@ -26,6 +23,6 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
[transport]
PORT = 12301
-PLUGINS = https
+PLUGINS = https_client
UNIXPATH = /tmp/gnunet-p1-service-transport.sock
diff --git a/src/transport/test_transport_api_reliability_https_peer2.conf b/src/transport/test_transport_api_reliability_https_peer2.conf
index bd344abc4..5a21188da 100644
--- a/src/transport/test_transport_api_reliability_https_peer2.conf
+++ b/src/transport/test_transport_api_reliability_https_peer2.conf
@@ -3,7 +3,7 @@
SERVICEHOME = /tmp/test-transport/api-https-p2/
DEFAULTCONFIG = test_transport_api_reliability_https_peer2.conf
-[transport-https]
+[transport-https_server]
PORT = 12310
KEY_FILE = $SERVICEHOME/https_key_p2.key
CERT_FILE = $SERVICEHOME/https_cert_p2.crt
@@ -26,7 +26,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
[transport]
PORT = 12311
-PLUGINS = https
+PLUGINS = https_server
UNIXPATH = /tmp/gnunet-p2-service-transport.sock
diff --git a/src/transport/test_transport_api_timeout_https_peer1.conf b/src/transport/test_transport_api_timeout_https_peer1.conf
index 8a93ca1e8..c8a26d2af 100644
--- a/src/transport/test_transport_api_timeout_https_peer1.conf
+++ b/src/transport/test_transport_api_timeout_https_peer1.conf
@@ -1,12 +1,9 @@
@INLINE@ template_cfg_peer1.conf
[PATHS]
SERVICEHOME = /tmp/test-transport/api-https-p1/
-DEFAULTCONFIG = test_transport_api_https_peer1.conf
+DEFAULTCONFIG = test_transport_api_timeout_https_peer1.conf
-[transport-https]
-PORT = 12100
-KEY_FILE = $SERVICEHOME/https_key_p1.key
-CERT_FILE = $SERVICEHOME/https_cert_p1.crt
+[transport-https_client]
[arm]
PORT = 12105
@@ -25,7 +22,7 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
[transport]
PORT = 12101
-PLUGINS = https
+PLUGINS = https_client
UNIXPATH = /tmp/gnunet-p1-service-transport.sock
DEBUG = NO
diff --git a/src/transport/test_transport_api_timeout_https_peer2.conf b/src/transport/test_transport_api_timeout_https_peer2.conf
index 0710f41ce..3daf94bb1 100644
--- a/src/transport/test_transport_api_timeout_https_peer2.conf
+++ b/src/transport/test_transport_api_timeout_https_peer2.conf
@@ -1,9 +1,9 @@
@INLINE@ template_cfg_peer2.conf
[PATHS]
SERVICEHOME = /tmp/test-transport/api-https-p2/
-DEFAULTCONFIG = test_transport_api_https_peer2.conf
+DEFAULTCONFIG = test_transport_api_timeout_https_peer2.conf
-[transport-https]
+[transport-https_server]
PORT = 12110
KEY_FILE = $SERVICEHOME/https_key_p2.key
CERT_FILE = $SERVICEHOME/https_cert_p2.crt
@@ -26,7 +26,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
[transport]
PORT = 12111
-PLUGINS = https
+PLUGINS = https_server
UNIXPATH = /tmp/gnunet-p2-service-transport.sock
DEBUG = NO