summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/metadata
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 23:51:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 23:51:29 +0000
commit113ad32e9cd2dcda12f12aa8a72d56b73ff4f4cc (patch)
tree76bbb508aac2452b17d73bcd162adc8cc7602e69 /bin/tests/system/metadata
parentReleasing progress-linux version 1:9.16.44-1~deb11u1progress6u1. (diff)
downloadbind9-113ad32e9cd2dcda12f12aa8a72d56b73ff4f4cc.tar.xz
bind9-113ad32e9cd2dcda12f12aa8a72d56b73ff4f4cc.zip
Merging upstream version 1:9.16.48.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/tests/system/metadata')
-rw-r--r--bin/tests/system/metadata/clean.sh2
-rw-r--r--bin/tests/system/metadata/setup.sh25
-rw-r--r--bin/tests/system/metadata/tests.sh92
3 files changed, 59 insertions, 60 deletions
diff --git a/bin/tests/system/metadata/clean.sh b/bin/tests/system/metadata/clean.sh
index 58cd7ce..bac7f18 100644
--- a/bin/tests/system/metadata/clean.sh
+++ b/bin/tests/system/metadata/clean.sh
@@ -12,7 +12,7 @@
# information regarding copyright ownership.
rm -f K* dsset-* *.signed *.new
-rm -f zsk.key ksk.key parent.ksk.key parent.zsk.key
+rm -f zsk.key ksk.key parent.ksk.key parent.zsk.key
rm -f pending.key rolling.key standby.key inact.key
rm -f prerev.key postrev.key oldstyle.key
rm -f keys sigs
diff --git a/bin/tests/system/metadata/setup.sh b/bin/tests/system/metadata/setup.sh
index fd9ac60..143bc23 100644
--- a/bin/tests/system/metadata/setup.sh
+++ b/bin/tests/system/metadata/setup.sh
@@ -21,41 +21,40 @@ echo_i "generating keys"
# active zsk
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} $czone)
-echo $zsk > zsk.key
+echo $zsk >zsk.key
# not yet published or active
pending=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -P none -A none $czone)
-echo $pending > pending.key
+echo $pending >pending.key
# published but not active
standby=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -A none $czone)
-echo $standby > standby.key
+echo $standby >standby.key
# inactive
inact=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -P now-24h -A now-24h -I now $czone)
-echo $inact > inact.key
+echo $inact >inact.key
# active ksk
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -fk $czone)
-echo $ksk > ksk.key
+echo $ksk >ksk.key
# published but not YET active; will be active in 15 seconds
rolling=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -fk $czone)
-$SETTIME -A now+15s $rolling > /dev/null
-echo $rolling > rolling.key
+$SETTIME -A now+15s $rolling >/dev/null
+echo $rolling >rolling.key
# revoked
revoke1=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -fk $czone)
-echo $revoke1 > prerev.key
+echo $revoke1 >prerev.key
revoke2=$($REVOKE $revoke1)
-echo $revoke2 | sed -e 's#\./##' -e "s/\.key.*$//" > postrev.key
+echo $revoke2 | sed -e 's#\./##' -e "s/\.key.*$//" >postrev.key
pzsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} $pzone)
-echo $pzsk > parent.zsk.key
+echo $pzsk >parent.zsk.key
pksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -fk $pzone)
-echo $pksk > parent.ksk.key
+echo $pksk >parent.ksk.key
oldstyle=$($KEYGEN -Cq -a ${DEFAULT_ALGORITHM} $pzone)
-echo $oldstyle > oldstyle.key
-
+echo $oldstyle >oldstyle.key
diff --git a/bin/tests/system/metadata/tests.sh b/bin/tests/system/metadata/tests.sh
index 626559d..5f17e05 100644
--- a/bin/tests/system/metadata/tests.sh
+++ b/bin/tests/system/metadata/tests.sh
@@ -20,7 +20,7 @@ status=0
n=1
echo_i "setting key timers"
-$SETTIME -A now+15s $(cat rolling.key) > /dev/null
+$SETTIME -A now+15s $(cat rolling.key) >/dev/null
inact=$(keyfile_to_key_id "$(cat inact.key)")
ksk=$(keyfile_to_key_id "$(cat ksk.key)")
@@ -32,8 +32,8 @@ standby=$(keyfile_to_key_id "$(cat standby.key)")
zsk=$(keyfile_to_key_id "$(cat zsk.key)")
echo_i "signing zones"
-$SIGNER -Sg -o $czone $cfile > /dev/null
-$SIGNER -Sg -o $pzone $pfile > /dev/null
+$SIGNER -Sg -o $czone $cfile >/dev/null
+$SIGNER -Sg -o $pzone $pfile >/dev/null
awk '$2 ~ /RRSIG/ {
type = $3;
@@ -42,7 +42,7 @@ awk '$2 ~ /RRSIG/ {
if ($4 ~ /'${czone}'/) {
print type, id
}
-}' < ${cfile}.signed > sigs
+}' <${cfile}.signed >sigs
awk '$2 ~ /DNSKEY/ {
flags = $3;
@@ -50,65 +50,65 @@ awk '$2 ~ /DNSKEY/ {
getline;
id = $NF;
print flags, id;
-}' < ${cfile}.signed > keys
+}' <${cfile}.signed >keys
echo_i "checking that KSK signed DNSKEY only ($n)"
ret=0
-grep "DNSKEY $ksk"'$' sigs > /dev/null || ret=1
-grep "SOA $ksk"'$' sigs > /dev/null && ret=1
+grep "DNSKEY $ksk"'$' sigs >/dev/null || ret=1
+grep "SOA $ksk"'$' sigs >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that ZSK signed ($n)"
ret=0
-grep "SOA $zsk"'$' sigs > /dev/null || ret=1
+grep "SOA $zsk"'$' sigs >/dev/null || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that standby ZSK did not sign ($n)"
ret=0
-grep " $standby"'$' sigs > /dev/null && ret=1
+grep " $standby"'$' sigs >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that inactive key did not sign ($n)"
ret=0
-grep " $inact"'$' sigs > /dev/null && ret=1
+grep " $inact"'$' sigs >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that pending key was not published ($n)"
ret=0
-grep " $pending"'$' keys > /dev/null && ret=1
+grep " $pending"'$' keys >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that standby KSK did not sign but is delegated ($n)"
ret=0
-grep " $rolling"'$' sigs > /dev/null && ret=1
-grep " $rolling"'$' keys > /dev/null || ret=1
-grep -E "DS[ ]*$rolling[ ]" ${pfile}.signed > /dev/null || ret=1
+grep " $rolling"'$' sigs >/dev/null && ret=1
+grep " $rolling"'$' keys >/dev/null || ret=1
+grep -E "DS[ ]*$rolling[ ]" ${pfile}.signed >/dev/null || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that key was revoked ($n)"
ret=0
-grep " $prerev"'$' keys > /dev/null && ret=1
-grep " $postrev"'$' keys > /dev/null || ret=1
+grep " $prerev"'$' keys >/dev/null && ret=1
+grep " $postrev"'$' keys >/dev/null || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking that revoked key self-signed ($n)"
ret=0
-grep "DNSKEY $postrev"'$' sigs > /dev/null || ret=1
-grep "SOA $postrev"'$' sigs > /dev/null && ret=1
+grep "DNSKEY $postrev"'$' sigs >/dev/null || ret=1
+grep "SOA $postrev"'$' sigs >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -117,11 +117,11 @@ echo_i "waiting 20 seconds for key changes to occur"
sleep 20
echo_i "re-signing zone"
-$SIGNER -Sg -o $czone -f ${cfile}.new ${cfile}.signed > /dev/null
+$SIGNER -Sg -o $czone -f ${cfile}.new ${cfile}.signed >/dev/null
echo_i "checking that standby KSK is now active ($n)"
ret=0
-grep "DNSKEY $rolling"'$' sigs > /dev/null && ret=1
+grep "DNSKEY $rolling"'$' sigs >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -129,45 +129,45 @@ status=$((status + ret))
echo_i "checking update of an old-style key ($n)"
ret=0
# printing metadata should not work with an old-style key
-$SETTIME -pall $(cat oldstyle.key) > /dev/null 2>&1 && ret=1
-$SETTIME -f $(cat oldstyle.key) > /dev/null 2>&1 || ret=1
+$SETTIME -pall $(cat oldstyle.key) >/dev/null 2>&1 && ret=1
+$SETTIME -f $(cat oldstyle.key) >/dev/null 2>&1 || ret=1
# but now it should
-$SETTIME -pall $(cat oldstyle.key) > /dev/null 2>&1 || ret=1
+$SETTIME -pall $(cat oldstyle.key) >/dev/null 2>&1 || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking warning about permissions change on key with dnssec-settime ($n)"
-uname=$(uname -o 2> /dev/null)
-if [ Cygwin = "$uname" ]; then
- echo_i "Cygwin detected, skipping"
+uname=$(uname -o 2>/dev/null)
+if [ Cygwin = "$uname" ]; then
+ echo_i "Cygwin detected, skipping"
else
- ret=0
- # settime should print a warning about changing the permissions
- chmod 644 $(cat oldstyle.key).private
- $SETTIME -P none $(cat oldstyle.key) > settime1.test$n 2>&1 || ret=1
- grep "warning: Permissions on the file.*have changed" settime1.test$n > /dev/null 2>&1 || ret=1
- $SETTIME -P none $(cat oldstyle.key) > settime2.test$n 2>&1 || ret=1
- grep "warning: Permissions on the file.*have changed" settime2.test$n > /dev/null 2>&1 && ret=1
- n=$((n + 1))
- if [ $ret != 0 ]; then echo_i "failed"; fi
- status=$((status + ret))
+ ret=0
+ # settime should print a warning about changing the permissions
+ chmod 644 $(cat oldstyle.key).private
+ $SETTIME -P none $(cat oldstyle.key) >settime1.test$n 2>&1 || ret=1
+ grep "warning: Permissions on the file.*have changed" settime1.test$n >/dev/null 2>&1 || ret=1
+ $SETTIME -P none $(cat oldstyle.key) >settime2.test$n 2>&1 || ret=1
+ grep "warning: Permissions on the file.*have changed" settime2.test$n >/dev/null 2>&1 && ret=1
+ n=$((n + 1))
+ if [ $ret != 0 ]; then echo_i "failed"; fi
+ status=$((status + ret))
fi
echo_i "checking warning about delete date < inactive date with dnssec-settime ($n)"
ret=0
# settime should print a warning about delete < inactive
-$SETTIME -I now+15s -D now $(cat oldstyle.key) > tmp.out 2>&1 || ret=1
-grep "warning" tmp.out > /dev/null 2>&1 || ret=1
+$SETTIME -I now+15s -D now $(cat oldstyle.key) >tmp.out 2>&1 || ret=1
+grep "warning" tmp.out >/dev/null 2>&1 || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "checking no warning about delete date < inactive date with dnssec-settime when delete date is unset ($n)"
ret=0
-$SETTIME -D none $(cat oldstyle.key) > tmp.out 2>&1 || ret=1
-$SETTIME -p all $(cat oldstyle.key) > tmp.out 2>&1 || ret=1
-grep "warning" tmp.out > /dev/null 2>&1 && ret=1
+$SETTIME -D none $(cat oldstyle.key) >tmp.out 2>&1 || ret=1
+$SETTIME -p all $(cat oldstyle.key) >tmp.out 2>&1 || ret=1
+grep "warning" tmp.out >/dev/null 2>&1 && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -175,8 +175,8 @@ status=$((status + ret))
echo_i "checking warning about delete date < inactive date with dnssec-keygen ($n)"
ret=0
# keygen should print a warning about delete < inactive
-$KEYGEN -q -a ${DEFAULT_ALGORITHM} -I now+15s -D now $czone > tmp.out 2>&1 || ret=1
-grep "warning" tmp.out > /dev/null 2>&1 || ret=1
+$KEYGEN -q -a ${DEFAULT_ALGORITHM} -I now+15s -D now $czone >tmp.out 2>&1 || ret=1
+grep "warning" tmp.out >/dev/null 2>&1 || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -202,9 +202,9 @@ echo_i "checking calculation of dates for a successor key ($n)"
ret=0
oldkey=$($KEYGEN -a ${DEFAULT_ALGORITHM} -q $czone)
newkey=$($KEYGEN -a ${DEFAULT_ALGORITHM} -q $czone)
-$SETTIME -A -2d -I +2d $oldkey > settime1.test$n 2>&1 || ret=1
-$SETTIME -i 1d -S $oldkey $newkey > settime2.test$n 2>&1 || ret=1
-$SETTIME -pA $newkey | grep "1970" > /dev/null && ret=1
+$SETTIME -A -2d -I +2d $oldkey >settime1.test$n 2>&1 || ret=1
+$SETTIME -i 1d -S $oldkey $newkey >settime2.test$n 2>&1 || ret=1
+$SETTIME -pA $newkey | grep "1970" >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))