From f7aba615ec0145ae0d7fdb5964d977a28529f823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 3 Apr 2024 18:49:28 +0200 Subject: [PATCH] Give some time to server to initialize --- Sanity/caching-resolver-dnssec/test.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Sanity/caching-resolver-dnssec/test.sh b/Sanity/caching-resolver-dnssec/test.sh index 70f212a..60f4cab 100755 --- a/Sanity/caching-resolver-dnssec/test.sh +++ b/Sanity/caching-resolver-dnssec/test.sh @@ -66,16 +66,16 @@ buCheckSecureNameservers() { return 1 fi for NS in ${SERVERS}; do + # use tcp to fail faster on ipv6 global route not available if [ -n "$bu_DELV" ]; then - - if $bu_DELV @$NS | grep -q '^; fully validated'; then + if $bu_DELV +tcp @$NS | grep -q '^; fully validated'; then bu_SECURE_SERVERS+="$NS " else bu_FAILED_SERVERS+="$NS " fi elif [ -n "$bu_DIG" ]; then - if $bu_DIG +noall +answer +dnssec @$NS | grep -qw RRSIG; then + if $bu_DIG +tcp +noall +answer +dnssec @$NS | grep -qw RRSIG; then bu_SECURE_SERVERS+="$NS " else bu_FAILED_SERVERS+="$NS " @@ -242,14 +242,19 @@ rlJournalStart fi rlAssertExists $bu_ROOT_HINTS # use buCheckSecureNameservers - rlRun "HINTS4=$(buGetRootServerAddresses4 $bu_ROOT_HINTS)" - rlRun "HINTS6=$(buGetRootServerAddresses6 $bu_ROOT_HINTS)" + rlRun "HINTS4=\"$(buGetRootServerAddresses4 $bu_ROOT_HINTS)\"" + rlRun "HINTS6=\"$(buGetRootServerAddresses6 $bu_ROOT_HINTS)\"" SKIP_TEST='' - if ! rlRun buCheckSecureNameservers \"$HINTS4 $HINTS6\" + if ! rlRun "buCheckSecureNameservers \"$HINTS4 $HINTS6\"" then SKIP_TEST=y rlLogWarning "No root-servers reachable, skipping the test." fi + WORKING_NUM=0 + for NSIP in ${bu_SECURE_SERVERS}; do + WORKING_NUM=$((WORKING_NUM+1)) + done + rlAssertGreater "Check we have at least some working servers" "$WORKING_NUM" 3 rlLog "Working root-servers: $bu_SECURE_SERVERS" [ -n "$bu_FAILED_SERVERS" ] && rlLogWarning "Failed root-servers: $bu_FAILED_SERVERS" @@ -262,6 +267,8 @@ if [ "$SKIP_TEST" != y ]; then for I in {1..3}; do rlPhaseStartTest "Basic test #$I" rlRun "rlServiceStart named" + # give it chance to warm up + sleep 5 buDigSuccessSecure @localhost . DNSKEY buDigSuccessSecure @localhost @@ -272,6 +279,7 @@ for I in {1..3}; do rlRun "grep \"^./RSASHA256/$KEYID\" /var/named/data/named.secroots" 0 "Check trust anchor is trusted" [ "$HAS_MANAGED_KEYS" = y ] && rlRun "rndc managed-keys status" rlPhaseEnd + sleep 5 done rlPhaseStartTest "Host tests #$I"