]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Revert "Merge branch '782-cygwin-grep-CRLF-issue' into 'master'"
authorOndřej Surý <ondrej@sury.org>
Mon, 17 Dec 2018 11:23:14 +0000 (12:23 +0100)
committerOndřej Surý <ondrej@sury.org>
Mon, 17 Dec 2018 11:23:14 +0000 (12:23 +0100)
This reverts commit 4af9f9718989212480f2a5243a79886b8e7934c2, reversing
changes made to 0289f3f28135282514d46cbc17a01aed100bd1de.

bin/tests/system/builtin/tests.sh
bin/tests/system/digdelv/tests.sh
bin/tests/system/dns64/tests.sh
bin/tests/system/rndc/tests.sh
bin/tests/system/rpzrecurse/tests.sh

index 48bea2c20ddc8ce73b856ef77556e919947a4a15..391c239b614ae412af2b9bfbbc9c19d27cf06c85 100644 (file)
@@ -178,28 +178,28 @@ n=`expr $n + 1`
 ret=0
 echo_i "Checking that default version works for query ($n)"
 $DIG $DIGOPTS +short version.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-tr -d '\r' < dig.out.ns1.$n | grep "^\"$VERSION\"$" > /dev/null || ret=1
+grep "^\"$VERSION\"$" dig.out.ns1.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that custom version works for query ($n)"
 $DIG $DIGOPTS +short version.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this is a test of version\"$" > /dev/null || ret=1
+grep "^\"this is a test of version\"$" dig.out.ns3.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that default hostname works for query ($n)"
 $DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-tr -d '\r' < dig.out.ns1.$n | grep "^\"$HOSTNAME\"$" > /dev/null || ret=1
+grep "^\"$HOSTNAME\"$" dig.out.ns1.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that custom hostname works for query ($n)"
 $DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this.is.a.test.of.hostname\"$" > /dev/null || ret=1
+grep "^\"this.is.a.test.of.hostname\"$" dig.out.ns3.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
@@ -214,28 +214,28 @@ n=`expr $n + 1`
 ret=0
 echo_i "Checking that server-id hostname works for query ($n)"
 $DIG $DIGOPTS +short id.server txt ch @10.53.0.2 > dig.out.ns2.$n
-tr -d '\r' < dig.out.ns2.$n | grep "^\"$HOSTNAME\"$" > /dev/null || ret=1
+grep "^\"$HOSTNAME\"$" dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that server-id hostname works for EDNS name server ID request ($n)"
 $DIG $DIGOPTS +norec +nsid foo @10.53.0.2 > dig.out.ns2.$n
-tr -d '\r' < dig.out.ns2.$n | grep "^; NSID: .* (\"$HOSTNAME\")$" > /dev/null || ret=1
+grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that custom server-id works for query ($n)"
 $DIG $DIGOPTS +short id.server txt ch @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^\"this.is.a.test.of.server-id\"$" > /dev/null || ret=1
+grep "^\"this.is.a.test.of.server-id\"$" dig.out.ns3.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 n=`expr $n + 1`
 ret=0
 echo_i "Checking that custom server-id works for EDNS name server ID request ($n)"
 $DIG $DIGOPTS +norec +nsid foo @10.53.0.3 > dig.out.ns3.$n
-tr -d '\r' < dig.out.ns3.$n | grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" > /dev/null || ret=1
+grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.$n > /dev/null || ret=1
 if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
 
 echo_i "exit status: $status"
index fcc7b574c958273fbcdce63e6b450515fde3bc1f..11408b4d7b55285103661fe0b4a09cbfcef15130 100644 (file)
@@ -76,7 +76,7 @@ if [ -x "$DIG" ] ; then
   echo_i "checking dig over TCP works ($n)"
   ret=0
   dig_with_opts +tcp @10.53.0.3 a a.example > dig.out.test$n || ret=1
-  tr -d '\r' < dig.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
+  grep "10\\.0\\.0\\.1$" < dig.out.test$n > /dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
 
@@ -124,7 +124,7 @@ if [ -x "$DIG" ] ; then
   echo_i "checking dig +short +rrcomments works($n)"
   ret=0
   dig_with_opts +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
-  tr -d '\r' < dig.out.test$n | grep -q "$KEYDATA  ; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID\$" > /dev/null || ret=1
+  grep -q "$KEYDATA  ; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID\$" < dig.out.test$n || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
 
@@ -158,7 +158,7 @@ if [ -x "$DIG" ] ; then
   echo_i "checking dig +short +rrcomments works($n)"
   ret=0
   dig_with_opts +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
-  tr -d '\r' < dig.out.test$n | grep -q "$KEYDATA  ; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID\$" > /dev/null || ret=1
+  grep -q "$KEYDATA  ; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID\$" < dig.out.test$n || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
 
@@ -474,7 +474,7 @@ if [ -x "$DIG" ] ; then
   n=$((n+1))
   echo_i "check that dig processes +ednsopt=key-tag and FORMERR is returned ($n)"
   dig_with_opts @10.53.0.3 +ednsopt=key-tag a.example +qr > dig.out.test$n 2>&1 || ret=1
-  tr -d '\r' < dig.out.test$n | grep "; KEY-TAG$" > /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))
@@ -482,7 +482,7 @@ if [ -x "$DIG" ] ; then
   n=$((n+1))
   echo_i "check that dig processes +ednsopt=key-tag:<value-list> ($n)"
   dig_with_opts @10.53.0.3 +ednsopt=key-tag:00010002 a.example +qr > dig.out.test$n 2>&1 || ret=1
-  tr -d '\r' < dig.out.test$n | grep "; KEY-TAG: 1, 2$" > /dev/null || 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
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
@@ -520,7 +520,7 @@ if [ -x "$DIG" ] ; then
   echo_i "check that dig -q -m works ($n)"
   ret=0
   dig_with_opts @10.53.0.3 -q -m > dig.out.test$n 2>&1
-  tr -d '\r' < dig.out.test$n | grep '^;-m\..*IN.*A$' > /dev/null || ret=1
+  grep '^;-m\..*IN.*A$' dig.out.test$n > /dev/null || ret=1
   grep "Dump of all outstanding memory allocations" dig.out.test$n > /dev/null && ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
@@ -622,7 +622,7 @@ if [ -x "$DELV" ] ; then
   echo_i "checking delv over TCP works ($n)"
   ret=0
   delv_with_opts +tcp @10.53.0.3 a a.example > delv.out.test$n || ret=1
-  tr -d '\r' < delv.out.test$n | grep "10\\.0\\.0\\.1$" > /dev/null || ret=1
+  grep "10\\.0\\.0\\.1$" < delv.out.test$n > /dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status+ret))
 
@@ -680,7 +680,7 @@ if [ -x "$DELV" ] ; then
   echo_i "checking delv +short +nosplit +norrcomments works ($n)"
   ret=0
   delv_with_opts +tcp @10.53.0.3 +short +nosplit +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
-  tr -d '\r' < delv.out.test$n | grep -q "$NOSPLIT\$" > /dev/null || ret=1
+  grep -q "$NOSPLIT\$" < delv.out.test$n || ret=1
   test "$(wc -l < delv.out.test$n)" -eq 1 || ret=1
   test "$(awk '{print NF}' < delv.out.test$n)" -eq 4 || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
index 86ab4a4463ce3c2b6a1a8dd7a169fa0d48c282b2..ce5287efc6c28c66a1c7891254c5e6587c173c69 100644 (file)
@@ -1278,7 +1278,7 @@ status=`expr $status + $ret`
 echo_i "checking reverse mapping ($n)"
 ret=0
 $DIG $DIGOPTS -x 2001:aaaa::10.0.0.1 @10.53.0.2 > dig.out.ns2.test$n || ret=1
-tr -d '\r' < dig.out.ns2.test$n | grep -i "CNAME.1.0.0.10.IN-ADDR.ARPA.$" > /dev/null || ret=1
+grep -i "CNAME.1.0.0.10.IN-ADDR.ARPA.$" dig.out.ns2.test$n > /dev/null || ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
index 909ff7781440724aaba3deb6401092a7b7155f7d..b9dda3827edd0ce1ffd8edd1a549efbdd9571f75 100644 (file)
@@ -229,7 +229,7 @@ do
 done
 serial=`awk '$3 == "serial" {print $1}' ns2/other.db`
 newserial=`expr $serial + 1`
-sed "s/$serial/$newserial/" ns2/other.db > ns2/other.db.new
+sed s/$serial/$newserial/ ns2/other.db > ns2/other.db.new
 echo 'frozen TXT "frozen addition"' >> ns2/other.db.new
 mv -f ns2/other.db.new ns2/other.db
 $RNDCCMD 10.53.0.2 thaw 2>&1 | sed 's/^/ns2 /' | cat_i
@@ -272,7 +272,7 @@ do
 done
 serial=`awk '$3 == "serial" {print $1}' ns2/nil.db`
 newserial=`expr $serial + 1`
-sed "s/$serial/$newserial/" ns2/nil.db > ns2/nil.db.new
+sed s/$serial/$newserial/ ns2/nil.db > ns2/nil.db.new
 echo 'frozen TXT "frozen addition"' >> ns2/nil.db.new
 mv -f ns2/nil.db.new ns2/nil.db
 $RNDCCMD 10.53.0.2 thaw 2>&1 | sed 's/^/ns2 /' | cat_i
@@ -452,7 +452,7 @@ $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf querylog on >/dev/null 2>&1
 grep "query logging is now on" ns4/named.run > /dev/null || ret=1
 # query for builtin and check if query was logged (without +subnet)
 $DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo12345.bind > /dev/null || ret=1
-tr -d '\r' < ns4/named.run | grep "query: foo12345.bind CH TXT.*(.*)$" > /dev/null || ret=1
+grep "query: foo12345.bind CH TXT.*(.*)$" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (with +subnet=127.0.0.1)
 $DIG +subnet=127.0.0.1 @10.53.0.4 -p ${PORT} -c ch -t txt foo12346.bind > /dev/null || ret=1
 grep "query: foo12346.bind CH TXT.*\[ECS 127\.0\.0\.1\/32\/0]" ns4/named.run > /dev/null || ret=1
@@ -467,7 +467,7 @@ $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf querylog > /dev/null 2>&1 |
 grep "query logging is now off" ns4/named.run > /dev/null || ret=1
 # query for another builtin zone and check if query was logged (without +subnet)
 $DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo9876.bind > /dev/null || ret=1
-tr -d '\r' < ns4/named.run | grep "query: foo9876.bind CH TXT.*(.*)$" > /dev/null && ret=1
+grep "query: foo9876.bind CH TXT.*(.*)$" ns4/named.run > /dev/null && ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
index ebd0596c6b64e16dc587053ff087ac3fea28b382..2e1813622de48755724ffa16e7d6f471ab1ae11e 100644 (file)
@@ -478,7 +478,7 @@ for mode in native dnsrps; do
   echo_i "testing for invalid prefix length error (${t})"
   add_test_marker 10.53.0.2
   run_server invalidprefixlength
-  tr -d '\r' < ns2/named.run | grep "invalid rpz IP address \"1000.4.0.53.10.rpz-client-ip.invalidprefixlength\"; invalid prefix length of 1000$" > /dev/null || {
+  grep "invalid rpz IP address \"1000.4.0.53.10.rpz-client-ip.invalidprefixlength\"; invalid prefix length of 1000$" ns2/named.run > /dev/null || {
     echo_i " failed: expected that invalid prefix length error would be logged"
     status=1
   }