From c349771211fea3e2c16de08979b883fd2ff0c683 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 14 Oct 2025 16:41:50 +1100 Subject: [PATCH] 'nextpart' and 'grep -q' don't work together '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. (cherry picked from commit 5beba4d292462d230a92f596c74ebbf9379c8ffe) --- bin/tests/system/ixfr/tests.sh | 2 +- bin/tests/system/rpz/tests.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index 508e6f511d..ff4c16cbfb 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -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)) diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh index 917887ebca..87e4118ca3 100644 --- a/bin/tests/system/rpz/tests.sh +++ b/bin/tests/system/rpz/tests.sh @@ -622,7 +622,7 @@ nochange_ns10 a3-1.static-stub-nomatch # 16 if [ "$MODE" = dnsrps ]; then addr 12.12.12.12 as-ns.tld5. # 17 qname-as-ns fi -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 if [ "$MODE" = dnsrps ]; then @@ -645,7 +645,7 @@ nochange_ns10 a4-1.static-stub-nomatch # 8 if [ "$MODE" = dnsrps ]; then addr 12.12.12.12 as-ns.tld5. # 9 ip-as-ns fi -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