]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
'nextpart' and 'grep -q' don't work together
authorMark Andrews <marka@isc.org>
Tue, 14 Oct 2025 05:41:50 +0000 (16:41 +1100)
committerMark Andrews <marka@isc.org>
Tue, 14 Oct 2025 06:47:25 +0000 (17:47 +1100)
'nextpart file | grep -q' doesn't work as expected.  'grep -q' is not
required to read all of the input and that causes 'nextpart' to fail.

bin/tests/system/addzone/tests.sh
bin/tests/system/ixfr/tests.sh
bin/tests/system/rpz/tests.sh

index 5809709656d21c766d7701d5233ad5b5eecbcc6c..66c76bca181cef0e1a29b7bf44a7e7ebc023b6fe 100755 (executable)
@@ -763,7 +763,7 @@ echo_i "checking addzone with nonexistent template ($n)"
 ret=0
 nextpart ns2/named.run >/dev/null
 $RNDCCMD 10.53.0.2 addzone 'wrong.example in external { template nope; };' 2>&1 | grep -qF "failure" || ret=1
-nextpart ns2/named.run | grep -qF "zone 'wrong.example': template 'nope' not found" || ret=1
+nextpart ns2/named.run | grep -F "zone 'wrong.example': template 'nope' not found" >/dev/null || ret=1
 test -f ns2/wrong-template.example.db && ret=1
 n=$((n + 1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
index ca5114723f437c4cac4f50b427e14ed2886cace6..864adefb09b7d4e2464debe90d4f8ec2c7f81552 100644 (file)
@@ -243,7 +243,7 @@ $DIG $DIGOPTS test.nil. TXT @10.53.0.1 >dig.out.test$n.2 || ret=1
 grep -q -F "serial 4, fallback AXFR" dig.out.test$n.2 || ret=1
 
 # Ensure the expected error is logged.
-nextpart ns1/named.run | grep -q -F "SOA name mismatch" || ret=1
+nextpart ns1/named.run | grep -F "SOA name mismatch" >/dev/null || ret=1
 
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
index ccf19af8ab39f3e07fbe07dad543bb6f5228ecaf..612e849d2804354d78ce674635aae0e7161c20ed 100644 (file)
@@ -562,7 +562,7 @@ nxdomain a3-1.stub                     # 13
 nxdomain a3-1.static-stub              # 14
 nochange_ns10 a3-1.stub-nomatch        # 15
 nochange_ns10 a3-1.static-stub-nomatch # 16
-nextpart ns3/named.run | grep -q "unrecognized NS rpz_rrset_find() failed: glue" \
+nextpart ns3/named.run | grep -F "unrecognized NS rpz_rrset_find() failed: glue" >/dev/null \
   && setret "seen: unrecognized NS rpz_rrset_find() failed: glue"
 end_group
 ckstats $ns3 test3 ns3 9
@@ -578,7 +578,7 @@ nxdomain a4-1.stub                     # 5
 nxdomain a4-1.static-stub              # 6
 nochange_ns10 a4-1.stub-nomatch        # 7
 nochange_ns10 a4-1.static-stub-nomatch # 8
-nextpart ns3/named.run | grep -q "unrecognized NS rpz_rrset_find() failed: glue" \
+nextpart ns3/named.run | grep -F "unrecognized NS rpz_rrset_find() failed: glue" >/dev/null \
   && setret "seen: unrecognized NS rpz_rrset_find() failed: glue"
 end_group