fix digdelv KEY-TAG test

also incidentally added several missing ret=0 statements,
and removed some duplicates.
This commit is contained in:
Evan Hunt
2019-09-14 10:51:42 -07:00
parent 8e9a58eaa7
commit 877b463bcc

View File

@@ -325,7 +325,6 @@ if [ -x "$DIG" ] ; then
echo_i "checking dig @IPv4addr -6 +mapped A a.example ($n)"
if "$TESTSOCK6" fd92:7065:b8e:ffff::2 2>/dev/null && [ "$(uname -s)" != "OpenBSD" ]
then
ret=0
ret=0
dig_with_opts +tcp @10.53.0.2 -6 +mapped A a.example > dig.out.test$n 2>&1 || ret=1
grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null || ret=1
@@ -339,7 +338,6 @@ if [ -x "$DIG" ] ; then
echo_i "checking dig +tcp @IPv4addr -6 +nomapped A a.example ($n)"
if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null
then
ret=0
ret=0
dig_with_opts +tcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1
grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null && ret=1
@@ -353,7 +351,6 @@ if [ -x "$DIG" ] ; then
echo_i "checking dig +notcp @IPv4addr -6 +nomapped A a.example ($n)"
if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null
then
ret=0
ret=0
dig_with_opts +notcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1
grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null && ret=1
@@ -538,14 +535,16 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that dig processes +ednsopt=key-tag and FORMERR is returned ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=key-tag a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; KEY-TAG$" dig.out.test$n > /dev/null || ret=1
grep "; KEY-TAG: *$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "check that dig processes +ednsopt=key-tag:<value-list> ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=key-tag:00010002 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; KEY-TAG: 1, 2$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null && ret=1
@@ -564,6 +563,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that dig processes +ednsopt=client-tag:value ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=client-tag:0001 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; CLIENT-TAG: 1$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null && ret=1
@@ -572,6 +572,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that FORMERR is returned for a too short client-tag ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=client-tag:01 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; CLIENT-TAG" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
@@ -580,6 +581,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that FORMERR is returned for a too long client-tag ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=client-tag:000001 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; CLIENT-TAG" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
@@ -588,6 +590,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that dig processes +ednsopt=server-tag:value ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=server-tag:0001 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; SERVER-TAG: 1$" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null && ret=1
@@ -596,6 +599,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that FORMERR is returned for a too short server-tag ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=server-tag:01 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; SERVER-TAG" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
@@ -604,6 +608,7 @@ if [ -x "$DIG" ] ; then
n=$((n+1))
echo_i "check that FORMERR is returned for a too long server-tag ($n)"
ret=0
dig_with_opts @10.53.0.3 +ednsopt=server-tag:000001 a.example +qr > dig.out.test$n 2>&1 || ret=1
grep "; SERVER-TAG" dig.out.test$n > /dev/null || ret=1
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1