From 5073cf5873c8c612f841e0a0e0cb0dd20e4c6140 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Sun, 25 Jul 2010 14:17:24 +0000 Subject: [PATCH] --- src/transport/Makefile.am | 17 +++++++++++++++-- src/transport/test_plugin_transport_https.c | 10 +++++----- src/transport/test_transport_api.c | 13 +++++++++++-- .../test_transport_api_http_peer1.conf | 9 ++++++++- .../test_transport_api_http_peer2.conf | 8 ++++++++ 5 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index f4824ab70..cf73faa9e 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -14,7 +14,9 @@ if HAVE_MHD test_transport_api_reliability_http HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la - HTTPS_PLUGIN_CHECK = test_plugin_transport_https + HTTPS_PLUGIN_CHECK = test_plugin_transport_https \ + test_transport_api_https \ + test_transport_api_reliability_https endif if USE_COVERAGE @@ -238,7 +240,18 @@ test_plugin_transport_https_LDADD = \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ @LIBCURL@ \ $(top_builddir)/src/util/libgnunetutil.la - + +test_transport_api_https_SOURCES = \ + test_transport_api.c +test_transport_api_https_LDADD = \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la + +test_transport_api_reliability_https_SOURCES = \ + test_transport_api_reliability.c +test_transport_api_reliability_https_LDADD = \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la endif EXTRA_DIST = \ diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 7c9229111..f22f6e95f 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c @@ -548,7 +548,7 @@ receive (void *cls, if ((ntohs(message->type)==32) && (ntohs(message->size) == GNUNET_SERVER_MAX_MESSAGE_SIZE-1)) { fail_msg_transmited_max_size = GNUNET_NO; - //shutdown_clean(); + shutdown_clean(); } return GNUNET_TIME_UNIT_ZERO; @@ -963,7 +963,7 @@ static void run_connection_tests( int phase , void * cls) { /* Connecting to peer without identification */ char * ident = ""; - GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); + GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer without any peer identification.\n")); test_no_ident.test_executed = GNUNET_YES; send_data ( &test_no_ident, host_str); @@ -974,7 +974,7 @@ static void run_connection_tests( int phase , void * cls) { char * ident = "AAAAAAAAAA"; /* Connecting to peer with too short identification */ - GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); + GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too short peer identification.\n")); test_too_short_ident.test_executed = GNUNET_YES; send_data ( &test_too_short_ident, host_str); @@ -987,7 +987,7 @@ static void run_connection_tests( int phase , void * cls) char * ident = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; /* Connecting to peer with too long identification */ - GNUNET_asprintf (&host_str, "http://%s/%s",test_addr,ident); + GNUNET_asprintf (&host_str, "https://%s/%s",test_addr,ident); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with too long peer identification.\n")); test_too_long_ident.test_executed = GNUNET_YES; send_data ( &test_too_long_ident, host_str); @@ -998,7 +998,7 @@ static void run_connection_tests( int phase , void * cls) { struct GNUNET_CRYPTO_HashAsciiEncoded ident; GNUNET_CRYPTO_hash_to_enc(&my_identity.hashPubKey,&ident); - GNUNET_asprintf (&host_str, "http://%s/%s%s",test_addr,(char *) &ident,";0"); + GNUNET_asprintf (&host_str, "https://%s/%s%s",test_addr,(char *) &ident,";0"); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connecting to peer with valid peer identification.\n")); test_valid_ident.test_executed = GNUNET_YES; send_data ( &test_valid_ident, host_str); diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 7aa81bff8..de75d5da3 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -82,6 +82,8 @@ static int is_udp_nat; static int is_http; +static int is_https; + static GNUNET_SCHEDULER_TaskIdentifier die_task; #if VERBOSE @@ -308,7 +310,11 @@ run (void *cls, setup_peer (&p1, "test_transport_api_http_peer1.conf"); setup_peer (&p2, "test_transport_api_http_peer2.conf"); } - + else if (is_https) + { + setup_peer (&p1, "test_transport_api_https_peer1.conf"); + setup_peer (&p2, "test_transport_api_https_peer2.conf"); + } GNUNET_assert(p1.th != NULL); GNUNET_assert(p2.th != NULL); @@ -441,7 +447,10 @@ main (int argc, char *argv[]) { is_http = GNUNET_YES; } - + else if (strstr(argv[0], "https") != NULL) + { + is_https = GNUNET_YES; + } GNUNET_log_setup ("test-transport-api", #if VERBOSE "DEBUG", diff --git a/src/transport/test_transport_api_http_peer1.conf b/src/transport/test_transport_api_http_peer1.conf index bb7027c0d..1430197d3 100644 --- a/src/transport/test_transport_api_http_peer1.conf +++ b/src/transport/test_transport_api_http_peer1.conf @@ -6,6 +6,13 @@ USE_IPv4 = YES #BINDTO4 = 127.0.0.1 #BINDTO6 = ::1 +[transport-https] +PORT = 42389 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 [fs] AUTOSTART = NO @@ -36,7 +43,7 @@ FRIENDS-ONLY = NO MINIMUM-FRIENDS = 0 [transport] -PLUGINS = http +PLUGINS = https #PLUGINS = tcp http DEBUG = YES ACCEPT_FROM6 = ::1; diff --git a/src/transport/test_transport_api_http_peer2.conf b/src/transport/test_transport_api_http_peer2.conf index 910a63c9c..cbdf981d4 100644 --- a/src/transport/test_transport_api_http_peer2.conf +++ b/src/transport/test_transport_api_http_peer2.conf @@ -6,6 +6,14 @@ USE_IPv4 = YES #BINDTO4 = 127.0.0.1 #BINDTO6 = ::1 +[transport-https] +PORT = 42388 +DEBUG = NO +USE_IPv6 = YES +USE_IPv4 = YES +#BINDTO4 = 127.0.0.1 +#BINDTO6 = ::1 + [fs] AUTOSTART = NO -- 2.25.1