From ff883fd75fa673bc76a8a93f4200a7808b79000f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 8 Sep 2022 10:35:31 +1000 Subject: [PATCH] Suppress manykeys test on duplicate key ids If there are duplicate key ids across multiple algorithms expected output is no met. We have fixed this in on main but decided to not back port the fix as it will change the statistics channel output. This change detects when there are duplicate key id across algorithms as skips the sub test. (cherry picked from commit ea1d3476a8b0c8a582b80a1bfdffa614bb553ab6) --- bin/tests/system/statschannel/tests.sh | 43 ++++++++++++++++---------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/bin/tests/system/statschannel/tests.sh b/bin/tests/system/statschannel/tests.sh index 3b1e19165e..58bbd43678 100644 --- a/bin/tests/system/statschannel/tests.sh +++ b/bin/tests/system/statschannel/tests.sh @@ -278,6 +278,7 @@ ksk13_id=`cat ns2/$zone.ksk13.id` zsk13_id=`cat ns2/$zone.zsk13.id` ksk14_id=`cat ns2/$zone.ksk14.id` zsk14_id=`cat ns2/$zone.zsk14.id` +num_ids=$( (echo $ksk8_id; echo $zsk8_id; echo $ksk13_id; echo $zsk13_id; echo $ksk14_id; echo $zsk14_id;) | sort -u | wc -l) # The dnssec zone has 10 RRsets to sign (including NSEC) with the ZSKs and one # RRset (DNSKEY) with the KSKs. So starting named with signatures that expire # almost right away, this should trigger 10 zsk and 1 ksk sign operations per @@ -298,15 +299,20 @@ cat zones.expect | sort > zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after zone maintenance at startup ($n)" -if [ $PERL_XML ]; then - getzones xml $zone x$n || ret=1 - cmp zones.out.x$n zones.expect.$n || ret=1 +if test $num_ids -eq 6 +then + if [ $PERL_XML ]; then + getzones xml $zone x$n || ret=1 + cmp zones.out.x$n zones.expect.$n || ret=1 + fi + if [ $PERL_JSON ]; then + getzones json 2 j$n || ret=1 + cmp zones.out.j$n zones.expect.$n || ret=1 + fi + if [ $ret != 0 ]; then echo_i "failed"; fi +else + echo_i "skipped: duplicate key id detected (fixed in BIND 9.19)" fi -if [ $PERL_JSON ]; then - getzones json 2 j$n || ret=1 - cmp zones.out.j$n zones.expect.$n || ret=1 -fi -if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` @@ -336,15 +342,20 @@ cat zones.expect | sort > zones.expect.$n rm -f zones.expect # Fetch and check the dnssec sign statistics. echo_i "fetching zone '$zone' stats data after dynamic update ($n)" -if [ $PERL_XML ]; then - getzones xml $zone x$n || ret=1 - cmp zones.out.x$n zones.expect.$n || ret=1 +if test $num_ids -eq 6 +then + if [ $PERL_XML ]; then + getzones xml $zone x$n || ret=1 + cmp zones.out.x$n zones.expect.$n || ret=1 + fi + if [ $PERL_JSON ]; then + getzones json 2 j$n || ret=1 + cmp zones.out.j$n zones.expect.$n || ret=1 + fi + if [ $ret != 0 ]; then echo_i "failed"; fi +else + echo_i "skipped: duplicate key id detected (fixed in BIND 9.19)" fi -if [ $PERL_JSON ]; then - getzones json 2 j$n || ret=1 - cmp zones.out.j$n zones.expect.$n || ret=1 -fi -if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1`