From 2404cc2c8e879cecda08f37fc44cfb5990b538c1 Mon Sep 17 00:00:00 2001 From: Sara Dickinson Date: Sat, 15 Aug 2015 15:27:58 +0100 Subject: [PATCH] Extend regression test --- src/context.c | 3 ++- src/test/tests_transports.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/context.c b/src/context.c index ae59b018..ad6a55b0 100644 --- a/src/context.c +++ b/src/context.c @@ -1764,7 +1764,8 @@ getdns_context_set_upstream_recursive_servers(struct getdns_context *context, upstream->addr.ss_family = addr.ss_family; upstream_init(upstream, upstreams, ai); upstream->transport = getdns_upstream_transports[j]; - if (getdns_upstream_transports[j] == GETDNS_TRANSPORT_TLS) { + if (getdns_upstream_transports[j] == GETDNS_TRANSPORT_TLS || + getdns_upstream_transports[j] == GETDNS_TRANSPORT_STARTTLS) { if ((r = getdns_dict_get_bindata( dict, "tls_auth_name", &tls_auth_name)) == GETDNS_RETURN_GOOD) { /*TODO: VALIDATE THIS STRING!*/ diff --git a/src/test/tests_transports.sh b/src/test/tests_transports.sh index a3c18681..98c3aec3 100755 --- a/src/test/tests_transports.sh +++ b/src/test/tests_transports.sh @@ -2,7 +2,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) SERVER_IP="8.8.8.8" -TLS_SERVER_IP="185.49.141.38" +TLS_SERVER_IP="185.49.141.38~www.dnssec-name-and-shame.com" GOOD_RESULT_SYNC="Status was: At least one response was returned" GOOD_RESULT_ASYNC="successfull" BAD_RESULT_SYNC="1 'Generic error'" @@ -58,6 +58,7 @@ usage () { ehco " -p path to getdns_query binary" echo " -s server configured for only TCP and UDP" echo " -t server configured for TLS, STARTTLS, TCP and UDP" + echo " (This must include the hostname e.g. 185.49.141.38~www.dnssec-name-and-shame.com)" } while getopts ":p:s:t:dh" opt; do @@ -70,6 +71,9 @@ while getopts ":p:s:t:dh" opt; do esac done +TLS_SERVER_IP_NO_NAME=`echo ${TLS_SERVER_IP%~*}` +echo $TLS_SERVER_IP_NO_NAME + GOOD_QUERIES=( "-s -A -q getdnsapi.net -l U @${SERVER_IP} " "-s -A -q getdnsapi.net -l T @${SERVER_IP} " @@ -78,13 +82,15 @@ GOOD_QUERIES=( GOOD_FALLBACK_QUERIES=( "-s -A -q getdnsapi.net -l LT @${SERVER_IP}" -"-s -A -q getdnsapi.net -l LU @${SERVER_IP}" +"-s -A -q getdnsapi.net -l LT @${SERVER_IP}" +"-s -A -q getdnsapi.net -l LT @${TLS_SERVER_IP_NO_NAME}" "-s -A -q getdnsapi.net -l L @${SERVER_IP} @${TLS_SERVER_IP}" "-s -G -q DNSKEY getdnsapi.net -l UT @${SERVER_IP} -b 512 -D") NOT_AVAILABLE_QUERIES=( "-s -A -q getdnsapi.net -l L @${SERVER_IP} " "-s -A -q getdnsapi.net -l S @${SERVER_IP} " +"-s -A -q getdnsapi.net -l L @${TLS_SERVER_IP_NO_NAME} " "-s -G -q DNSKEY getdnsapi.net -l U @${SERVER_IP} -b 512 -D") echo "Starting transport test"