]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
digdelv test fixed for CRLF issue
authorCurtis Blackburn <ckb@isc.org>
Fri, 14 Dec 2018 00:22:49 +0000 (16:22 -0800)
committerEvan Hunt <each@isc.org>
Sat, 15 Dec 2018 03:45:37 +0000 (19:45 -0800)
bin/tests/system/digdelv/tests.sh

index 24aa7b3736bc68d12a3f0648d7ea72721d58ec4d..cfacb363f38779ba3e141a3b890dbf051f896150 100644 (file)
@@ -53,7 +53,7 @@ if [ -x ${DIG} ] ; then
   echo_i "checking dig over TCP works ($n)"
   ret=0
   $DIG $DIGOPTS +tcp @10.53.0.3 a a.example > dig.out.test$n || ret=1
-  grep "10\.0\.0\.1$" < dig.out.test$n > /dev/null || ret=1
+  tr -d '\r' < dig.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -93,7 +93,7 @@ if [ -x ${DIG} ] ; then
   echo_i "checking dig +short +nosplit works($n)"
   ret=0
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > dig.out.test$n || ret=1
-  grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < dig.out.test$n > /dev/null || ret=1
+  tr -d '\r' < dig.out.test$n | grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -101,7 +101,7 @@ if [ -x ${DIG} ] ; then
   echo_i "checking dig +short +rrcomments works($n)"
   ret=0
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
+  tr -d '\r' < dig.out.test$n | grep -q "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -117,7 +117,7 @@ if [ -x ${DIG} ] ; then
   echo_i "checking dig +short +rrcomments works($n)"
   ret=0
   $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1
+  tr -d '\r' < dig.out.test$n | grep -q "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -416,7 +416,7 @@ ret=0
   n=`expr $n + 1`
   echo_i "check that dig processes +ednsopt=key-tag and FORMERR is returned ($n)"
   $DIG $DIGOPTS @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
+  tr -d '\r' < dig.out.test$n | grep "; KEY-TAG$" > /dev/null || ret=1
   grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
@@ -424,7 +424,7 @@ ret=0
   n=`expr $n + 1`
   echo_i "check that dig processes +ednsopt=key-tag:<value-list> ($n)"
   $DIG $DIGOPTS @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
+  tr -d '\r' < dig.out.test$n | grep "; KEY-TAG: 1, 2$" > /dev/null || ret=1
   grep "status: FORMERR" dig.out.test$n > /dev/null && ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
@@ -450,7 +450,7 @@ ret=0
   echo_i "check that dig -q -m works ($n)"
   ret=0
   $DIG $DIGOPTS @10.53.0.3 -q -m > dig.out.test$n 2>&1
-  grep '^;-m\..*IN.*A$' dig.out.test$n > /dev/null || ret=1
+  tr -d '\r' < dig.out.test$n | grep '^;-m\..*IN.*A$' > /dev/null || ret=1
   grep "Dump of all outstanding memory allocations" dig.out.test$n > /dev/null && ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
@@ -556,7 +556,7 @@ if [ -x ${DELV} ] ; then
   echo_i "checking delv over TCP works ($n)"
   ret=0
   $DELV $DELVOPTS +tcp @10.53.0.3 a a.example > delv.out.test$n || ret=1
-  grep "10\.0\.0\.1$" < delv.out.test$n > /dev/null || ret=1
+  tr -d '\r' < delv.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -596,7 +596,7 @@ if [ -x ${DELV} ] ; then
   echo_i "checking delv +short +rrcomments works ($n)"
   ret=0
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
-  grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" < delv.out.test$n > /dev/null || ret=1
+  tr -d '\r' < delv.out.test$n | grep "S8M=  ; ZSK; alg = RSAMD5 ; key id = 30795$" > /dev/null || ret=1
   if [ $ret != 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`
 
@@ -615,7 +615,7 @@ if [ -x ${DELV} ] ; then
   echo_i "checking delv +short +nosplit +norrcomments works ($n)"
   ret=0
   $DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
-  grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < delv.out.test$n > /dev/null || ret=1
+  tr -d '\r' < delv.out.test$n | grep -q "$NOSPLIT\$" > /dev/null || ret=1
   if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
   f=`awk '{print NF}' < delv.out.test$n`
   test "${f:-0}" -eq 4 || ret=1