From 1d706f328c87e0dfc3a74593c6d6944a9616fb96 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 15 Oct 2021 00:05:36 -0700 Subject: [PATCH] Remove leftover test code for Windows - Removed all code that only runs under CYGWIN, and made all code that doesn't run under CYGWIN non-optional. - Removed the $TP variable which was used to add optional trailing dots to filenames; they're no longer optional. - Removed references to pssuspend and dos2unix. - No need to use environment variables for diff and kill. - Removed uses of "tr -d '\r'"; this was a workaround for a cygwin regex bug that is no longer needed. --- bin/tests/system/autosign/ns1/keygen.sh | 2 +- bin/tests/system/autosign/ns2/keygen.sh | 8 +- bin/tests/system/autosign/ns3/keygen.sh | 44 ++--- bin/tests/system/cds/tests.sh | 6 +- bin/tests/system/checkds/ns2/setup.sh | 2 +- bin/tests/system/checkzone/tests.sh | 2 +- bin/tests/system/conf.sh.common | 2 - bin/tests/system/conf.sh.in | 14 -- bin/tests/system/cookie/tests.sh | 2 +- bin/tests/system/digdelv/tests.sh | 16 +- bin/tests/system/dnssec/ns1/sign.sh | 10 +- bin/tests/system/dnssec/ns2/sign.sh | 7 +- bin/tests/system/dnssec/ns3/sign.sh | 12 +- bin/tests/system/dnssec/tests.sh | 29 ++- bin/tests/system/dsdigest/ns1/sign.sh | 4 +- bin/tests/system/dsdigest/ns2/sign.sh | 4 +- bin/tests/system/forward/tests.sh | 2 +- bin/tests/system/inline/tests.sh | 4 +- bin/tests/system/kasp/tests.sh | 2 +- bin/tests/system/keepalive/tests.sh | 2 +- bin/tests/system/masterfile/tests.sh | 4 +- bin/tests/system/names/tests.sh | 2 +- bin/tests/system/notify/tests.sh | 9 +- bin/tests/system/nsupdate/tests.sh | 20 +- bin/tests/system/pending/ns1/sign.sh | 4 +- bin/tests/system/pipelined/tests.sh | 12 +- bin/tests/system/qmin/tests.sh | 92 +++++----- bin/tests/system/redirect/tests.sh | 16 +- bin/tests/system/resolver/ns6/keygen.sh | 2 +- bin/tests/system/rootkeysentinel/ns1/sign.sh | 2 +- bin/tests/system/rpz/setup.sh | 2 +- bin/tests/system/rpz/tests.sh | 6 +- bin/tests/system/rpzrecurse/tests.sh | 183 ++++++++----------- bin/tests/system/rrchecker/tests.sh | 6 +- bin/tests/system/rrl/tests.sh | 5 +- bin/tests/system/rrsetorder/tests.sh | 154 ++++++++-------- bin/tests/system/rsabigexponent/ns1/sign.sh | 2 +- bin/tests/system/run.sh.in | 2 +- bin/tests/system/runall.sh | 18 +- bin/tests/system/runtime/setup.sh | 8 +- bin/tests/system/runtime/tests.sh | 10 +- bin/tests/system/sfcache/ns1/sign.sh | 2 +- bin/tests/system/sortlist/tests.sh | 2 +- bin/tests/system/staticstub/ns3/sign.sh | 2 +- bin/tests/system/statistics/tests.sh | 24 +-- bin/tests/system/stop.pl | 10 +- bin/tests/system/unknown/tests.sh | 30 +-- bin/tests/system/wildcard/ns1/sign.sh | 4 +- bin/tests/system/xfer/tests.sh | 2 - bin/tests/system/xferquota/tests.sh | 6 +- 50 files changed, 361 insertions(+), 454 deletions(-) diff --git a/bin/tests/system/autosign/ns1/keygen.sh b/bin/tests/system/autosign/ns1/keygen.sh index 604d1fc692..53f9477dd7 100644 --- a/bin/tests/system/autosign/ns1/keygen.sh +++ b/bin/tests/system/autosign/ns1/keygen.sh @@ -19,7 +19,7 @@ infile=root.db.in (cd ../ns2 && $SHELL keygen.sh ) -cat $infile ../ns2/dsset-example$TP > $zonefile +cat $infile ../ns2/dsset-example. > $zonefile zskact=`$KEYGEN -3 -a RSASHA1 -q $zone` zskvanish=`$KEYGEN -3 -a RSASHA1 -q $zone` diff --git a/bin/tests/system/autosign/ns2/keygen.sh b/bin/tests/system/autosign/ns2/keygen.sh index dc2928d951..ec45cac86c 100644 --- a/bin/tests/system/autosign/ns2/keygen.sh +++ b/bin/tests/system/autosign/ns2/keygen.sh @@ -19,18 +19,18 @@ for subdomain in secure nsec3 autonsec3 optout rsasha256 rsasha512 nsec3-to-nsec oldsigs sync \ dname-at-apex-nsec3 do - cp ../ns3/dsset-$subdomain.example$TP . + cp ../ns3/dsset-$subdomain.example. . done # Create keys and pass the DS to the parent. zone=example zonefile="${zone}.db" infile="${zonefile}.in" -cat $infile dsset-*.example$TP > $zonefile +cat $infile dsset-*.example. > $zonefile kskname=`$KEYGEN -a RSASHA1 -3 -q -fk $zone` $KEYGEN -a RSASHA1 -3 -q $zone > /dev/null -$DSFROMKEY $kskname.key > dsset-${zone}$TP +$DSFROMKEY $kskname.key > dsset-${zone}. # Create keys for a private secure zone. zone=private.secure.example @@ -53,4 +53,4 @@ do cp $i `echo $i | sed s/X/K/` done $KEYGEN -a RSASHA1 -q $zone > /dev/null -$DSFROMKEY Kbar.+005+30804.key > dsset-bar$TP +$DSFROMKEY Kbar.+005+30804.key > dsset-bar. diff --git a/bin/tests/system/autosign/ns3/keygen.sh b/bin/tests/system/autosign/ns3/keygen.sh index 386e1db69c..e9016f05e1 100644 --- a/bin/tests/system/autosign/ns3/keygen.sh +++ b/bin/tests/system/autosign/ns3/keygen.sh @@ -33,7 +33,7 @@ setup secure.example cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # NSEC3/NSEC test zone @@ -42,7 +42,7 @@ setup secure.nsec3.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # NSEC3/NSEC3 test zone @@ -51,7 +51,7 @@ setup nsec3.nsec3.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # Jitter/NSEC3 test zone @@ -75,16 +75,16 @@ setup optout.nsec3.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A nsec3 zone (non-optout). # setup nsec3.example -cat $infile dsset-*.${zone}$TP > $zonefile +cat $infile dsset-*.${zone}. > $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # An NSEC3 zone, with NSEC3 parameters set prior to signing @@ -95,7 +95,7 @@ ksk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.ou echo $ksk > ../autoksk.key zsk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out echo $zsk > ../autozsk.key -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # OPTOUT/NSEC test zone @@ -104,7 +104,7 @@ setup secure.optout.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # OPTOUT/NSEC3 test zone @@ -113,7 +113,7 @@ setup nsec3.optout.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # OPTOUT/OPTOUT test zone @@ -122,16 +122,16 @@ setup optout.optout.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A optout nsec3 zone. # setup optout.example -cat $infile dsset-*.${zone}$TP > $zonefile +cat $infile dsset-*.${zone}. > $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A RSASHA256 zone. @@ -140,7 +140,7 @@ setup rsasha256.example cp $infile $zonefile ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a RSASHA256 -b 1024 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A RSASHA512 zone. @@ -149,7 +149,7 @@ setup rsasha512.example cp $infile $zonefile ksk=`$KEYGEN -q -a RSASHA512 -b 2048 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a RSASHA512 -b 1024 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # NSEC-only zone. @@ -158,7 +158,7 @@ setup nsec.example cp $infile $zonefile ksk=`$KEYGEN -q -a RSASHA1 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a RSASHA1 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # Signature refresh test zone. Signatures are set to expire long @@ -301,7 +301,7 @@ setup sync.example cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. echo ns3/$ksk > ../sync.key # @@ -311,7 +311,7 @@ setup kskonly.example cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A zone that has a published inactive key that is autosigned. @@ -320,7 +320,7 @@ setup inacksk2.example cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -Pnow -A now+3600 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A zone that has a published inactive key that is autosigned. @@ -329,7 +329,7 @@ setup inaczsk2.example cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A zone that starts with a active KSK + ZSK and a inactive ZSK. @@ -339,7 +339,7 @@ cp $infile $zonefile $KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 -fk $zone > kg.out 2>&1 || dumpit kg.out ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A zone that starts with a active KSK + ZSK and a inactive ZSK. @@ -349,7 +349,7 @@ cp $infile $zonefile ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out $KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. # # A zone that starts with an active KSK + ZSK and an inactive ZSK, with the @@ -369,4 +369,4 @@ setup dname-at-apex-nsec3.example cp $infile $zonefile ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out -$DSFROMKEY $ksk.key > dsset-${zone}$TP +$DSFROMKEY $ksk.key > dsset-${zone}. diff --git a/bin/tests/system/cds/tests.sh b/bin/tests/system/cds/tests.sh index c43bf72a15..84fb8a5fda 100644 --- a/bin/tests/system/cds/tests.sh +++ b/bin/tests/system/cds/tests.sh @@ -52,7 +52,7 @@ check_stderr() { } check_stdout() { - $DIFF out.$n "${out:-empty}" >/dev/null && return + diff out.$n "${out:-empty}" >/dev/null && return echo_d "stdout did not match '$out'" ( echo "wanted" cat "$out" @@ -128,10 +128,10 @@ name='in-place backup correct modification time' testcase 0 $PERL checkmtime.pl 7200 DS.inplace.bak name='in-place correct output' -testcase 0 $DIFF DS.1 DS.inplace +testcase 0 diff DS.1 DS.inplace name='in-place backup unmodified' -testcase 0 $DIFF DS.1 DS.inplace.bak +testcase 0 diff DS.1 DS.inplace.bak name='one mangled DS' err='found RRSIG by key' diff --git a/bin/tests/system/checkds/ns2/setup.sh b/bin/tests/system/checkds/ns2/setup.sh index 57c7f0a506..bdec45e59a 100644 --- a/bin/tests/system/checkds/ns2/setup.sh +++ b/bin/tests/system/checkds/ns2/setup.sh @@ -21,7 +21,7 @@ for subdomain in dspublished reference missing-dspublished bad-dspublished \ dswithdrawn missing-dswithdrawn bad-dswithdrawn \ multiple-dswithdrawn incomplete-dswithdrawn bad2-dswithdrawn do - cp "../ns9/dsset-$subdomain.checkds$TP" . + cp "../ns9/dsset-$subdomain.checkds." . done zone="checkds" diff --git a/bin/tests/system/checkzone/tests.sh b/bin/tests/system/checkzone/tests.sh index 95c3b26b12..442dbba6bc 100644 --- a/bin/tests/system/checkzone/tests.sh +++ b/bin/tests/system/checkzone/tests.sh @@ -192,7 +192,7 @@ status=`expr $status + $ret` ret=0 # Step 3: Ensure that output conversion from stdin is the same as the output conversion from a file. -$DIFF zones/zone1_file.txt zones/zone1_stdin.txt >/dev/null 2>&1 || ret=1 +diff zones/zone1_file.txt zones/zone1_stdin.txt >/dev/null 2>&1 || ret=1 status=`expr $status + $ret` if [ $ret != 0 ]; then echo_i "failed"; fi diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common index ce7b923b23..4f6066e468 100644 --- a/bin/tests/system/conf.sh.common +++ b/bin/tests/system/conf.sh.common @@ -714,7 +714,6 @@ export ARPANAME export BIGKEY export CDS export CHECKZONE -export CYGWIN export DESCRIPTION export DIG export FEATURETEST @@ -738,7 +737,6 @@ export NSUPDATE export NZD2NZF export PERL export PIPEQUERIES -export PSSUSPEND export PYTHON export RESOLVE export RNDC diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in index fc5d264f98..da9a934ca0 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -23,9 +23,6 @@ TOP_SRCDIR=@abs_top_srcdir@ # Provide TMPDIR variable for tests that need it. TMPDIR=${TMPDIR:-/tmp} -# This is not the windows build. -CYGWIN="" - # Load common values . $TOP_SRCDIR/bin/tests/system/conf.sh.common @@ -100,14 +97,6 @@ PARALLELDIRS="$PARALLEL_COMMON $PARALLEL_UNIX" SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS" - -# Things that are different on Windows -KILL=kill -DIFF=diff -DOS2UNIX=true -# There's no trailing period on Windows -TP=. - # Use the CONFIG_SHELL detected by configure for tests SHELL=@SHELL@ @@ -126,9 +115,6 @@ XSLTPROC=@XSLTPROC@ # PERL will be an empty string if no perl interpreter was found. PERL=$(command -v "@PERL@") -# Windows process management leave empty -PSSUSPEND= - PYTHON=$(command -v "@PYTHON@" || true) PYTEST=@PYTEST@ diff --git a/bin/tests/system/cookie/tests.sh b/bin/tests/system/cookie/tests.sh index 9b1a3c7c3d..ac3bd087cd 100755 --- a/bin/tests/system/cookie/tests.sh +++ b/bin/tests/system/cookie/tests.sh @@ -22,7 +22,7 @@ n=0 getcookie() { awk '$2 == "COOKIE:" { print $3; - }' < $1 | tr -d '\r' + }' < $1 } fullcookie() { diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index f4db8a4389..28a765d129 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -576,7 +576,7 @@ if [ -x "$DIG" ] ; then ret=0 dig_with_opts @10.53.0.3 +ednsopt=llq:0001000200001234567812345678fefefefe +qr a.example > dig.out.test$n 2>&1 || ret=1 pat='LLQ: Version: 1, Opcode: 2, Error: 0, Identifier: 1311768465173141112, Lifetime: 4278124286$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -675,7 +675,7 @@ if [ -x "$DIG" ] ; then # First defined EDE code, additional text "foo". dig_with_opts @10.53.0.3 +ednsopt=ede:0000666f6f a.example +qr > dig.out.test$n 2>&1 || ret=1 pat='^; EDE: 0 (Other): (foo)$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -684,7 +684,7 @@ if [ -x "$DIG" ] ; then # Last defined EDE code, no additional text. dig_with_opts @10.53.0.3 +ednsopt=ede:0018 a.example +qr > dig.out.test$n 2>&1 || ret=1 pat='^; EDE: 24 (Invalid Data)$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -693,7 +693,7 @@ if [ -x "$DIG" ] ; then # First undefined EDE code, additional text "foo". dig_with_opts @10.53.0.3 +ednsopt=ede:0019666f6f a.example +qr > dig.out.test$n 2>&1 || ret=1 pat='^; EDE: 25: (foo)$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -702,7 +702,7 @@ if [ -x "$DIG" ] ; then # EDE payload is too short dig_with_opts @10.53.0.3 +ednsopt=ede a.example +qr > dig.out.test$n 2>&1 || ret=1 pat='^; EDE:$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -711,7 +711,7 @@ if [ -x "$DIG" ] ; then # EDE payload is too short dig_with_opts @10.53.0.3 +ednsopt=ede:00 a.example +qr > dig.out.test$n 2>&1 || ret=1 pat='^; EDE: 00 (".")$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -799,7 +799,7 @@ if [ -x "$DIG" ] ; then ret=0 dig_with_opts @10.53.0.3 -q -m > dig.out.test$n 2>&1 pat='^;-m\..*IN.*A$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" 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)) @@ -913,7 +913,7 @@ if [ -x "$DIG" ] ; then ret=0 dig_with_opts @10.53.0.3 +short +expandaaaa AAAA ns2.example > dig.out.test$n 2>&1 || ret=1 pat='^fd92:7065:0b8e:ffff:0000:0000:0000:0002$' - tr -d '\r' < dig.out.test$n | grep "$pat" > /dev/null || ret=1 + grep "$pat" dig.out.test$n > /dev/null || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) diff --git a/bin/tests/system/dnssec/ns1/sign.sh b/bin/tests/system/dnssec/ns1/sign.sh index bc2e3b92c0..21c6d71b7d 100644 --- a/bin/tests/system/dnssec/ns1/sign.sh +++ b/bin/tests/system/dnssec/ns1/sign.sh @@ -26,12 +26,12 @@ zonefile=root.db echo_i "ns1/sign.sh" -cp "../ns2/dsset-example$TP" . -cp "../ns2/dsset-in-addr.arpa$TP" . -cp "../ns2/dsset-too-many-iterations$TP" . +cp "../ns2/dsset-example." . +cp "../ns2/dsset-in-addr.arpa." . +cp "../ns2/dsset-too-many-iterations." . -grep "$DEFAULT_ALGORITHM_NUMBER [12] " "../ns2/dsset-algroll$TP" > "dsset-algroll$TP" -cp "../ns6/dsset-optout-tld$TP" . +grep "$DEFAULT_ALGORITHM_NUMBER [12] " "../ns2/dsset-algroll." > "dsset-algroll." +cp "../ns6/dsset-optout-tld." . ksk=$("$KEYGEN" -q -fk -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone") zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone") diff --git a/bin/tests/system/dnssec/ns2/sign.sh b/bin/tests/system/dnssec/ns2/sign.sh index d39a991805..47248a4941 100644 --- a/bin/tests/system/dnssec/ns2/sign.sh +++ b/bin/tests/system/dnssec/ns2/sign.sh @@ -24,8 +24,8 @@ echo_i "ns2/sign.sh" # Get the DS records for the "trusted." and "managed." zones. for subdomain in secure unsupported disabled enabled do - cp "../ns3/dsset-$subdomain.managed$TP" . - cp "../ns3/dsset-$subdomain.trusted$TP" . + cp "../ns3/dsset-$subdomain.managed." . + cp "../ns3/dsset-$subdomain.trusted." . done # Sign the "trusted." and "managed." zones. @@ -65,7 +65,7 @@ for subdomain in secure badds bogus dynamic keyless nsec3 optout \ dnskey-nsec3-unknown managed-future revkey \ dname-at-apex-nsec3 occluded do - cp "../ns3/dsset-$subdomain.example$TP" . + cp "../ns3/dsset-$subdomain.example." . done # Sign the "example." zone. @@ -83,7 +83,6 @@ cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile" zonefiletmp=$(mktemp "$zonefile.XXXXXX") || exit 1 "$CHECKZONE" -D -q -i local "$zone" "$zonefile.signed" | -tr -d '\r' | awk ' tolower($1) == "bad-cname.example." && $4 == "RRSIG" && $5 == "CNAME" { for (i = 1; i <= NF; i++ ) { diff --git a/bin/tests/system/dnssec/ns3/sign.sh b/bin/tests/system/dnssec/ns3/sign.sh index 8cd6b2acbb..abe548eefa 100644 --- a/bin/tests/system/dnssec/ns3/sign.sh +++ b/bin/tests/system/dnssec/ns3/sign.sh @@ -275,7 +275,7 @@ cat "$infile" "$keyname.key" > "$zonefile" awk '$4 == "DNSKEY" { $7 = 100 } $4 == "RRSIG" { $6 = 100 } { print }' ${zonefile}.tmp > ${zonefile}.signed -DSFILE="dsset-${zone}${TP}" +DSFILE="dsset-${zone}." $DSFROMKEY -A -f ${zonefile}.signed "$zone" > "$DSFILE" # @@ -294,7 +294,7 @@ cat "$infile" "$keyname.key" > "$zonefile" awk '$4 == "DNSKEY" { $7 = 255 } $4 == "RRSIG" { $6 = 255 } { print }' ${zonefile}.tmp > ${zonefile}.signed -DSFILE="dsset-${zone}${TP}" +DSFILE="dsset-${zone}." $DSFROMKEY -A -f ${zonefile}.signed "$zone" > "$DSFILE" # @@ -328,7 +328,7 @@ cat "$infile" "$keyname.key" > "$zonefile" awk '$4 == "DNSKEY" { $7 = 100; print } $4 == "RRSIG" { $6 = 100; print } { print }' ${zonefile}.tmp > ${zonefile}.signed -DSFILE="dsset-${zone}${TP}" +DSFILE="dsset-${zone}." $DSFROMKEY -A -f ${zonefile}.signed "$zone" > "$DSFILE" # @@ -606,7 +606,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone cat "$infile" "$keyname.key" > "$zonefile" "$SIGNER" -P -o "$zone" "$zonefile" > /dev/null -sed -e 's/bogus/badds/g' < dsset-bogus.example$TP > dsset-badds.example$TP +sed -e 's/bogus/badds/g' < dsset-bogus.example. > dsset-badds.example. # # A zone with future signatures. @@ -668,7 +668,7 @@ kskname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -fk "$zone") zskname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" "$zone") dnskeyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -fk "delegation.$zone") keyname=$("$KEYGEN" -q -a DH -b 1024 -n HOST -T KEY "delegation.$zone") -$DSFROMKEY "$dnskeyname.key" > "dsset-delegation.${zone}$TP" +$DSFROMKEY "$dnskeyname.key" > "dsset-delegation.${zone}." cat "$infile" "${kskname}.key" "${zskname}.key" "${keyname}.key" \ - "${dnskeyname}.key" "dsset-delegation.${zone}$TP" >"$zonefile" + "${dnskeyname}.key" "dsset-delegation.${zone}." >"$zonefile" "$SIGNER" -P -o "$zone" "$zonefile" > /dev/null diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh index fd0933ffa9..340fa1d3b9 100644 --- a/bin/tests/system/dnssec/tests.sh +++ b/bin/tests/system/dnssec/tests.sh @@ -109,12 +109,11 @@ stripns () { # Ensure there is not a blank line before "Secure roots:". # check_secroots_layout () { - tr -d '\r' < "$1" | \ awk '$0 == "" { if (empty) exit(1); empty=1; next } /Start view/ { if (!empty) exit(1) } /Secure roots:/ { if (empty) exit(1) } /Negative trust anchors:/ { if (!empty) exit(1) } - { empty=0 }' + { empty=0 }' $1 return $? } @@ -1422,7 +1421,6 @@ status=$((status+ret)) get_rsasha1_key_ids_from_sigs() { zone=$1 - tr -d '\r' < signer/$zone.db.signed | \ awk ' NF < 8 { next } $(NF-5) != "RRSIG" { next } @@ -1432,8 +1430,7 @@ get_rsasha1_key_ids_from_sigs() { getline; print $3; } - ' | \ - sort -u + ' signer/$zone.db.signed | sort -u } # Test dnssec-signzone ZSK prepublish smooth rollover. @@ -2152,7 +2149,7 @@ status=$((status+ret)) ret=0 echo_i "killing ns4 with SIGTERM" -$KILL -TERM "$(cat ns4/named.pid)" +kill -TERM "$(cat ns4/named.pid)" rm -f ns4/named.pid # @@ -2214,7 +2211,7 @@ grep "status: SERVFAIL" dig.out.ns4.test$n.2 > /dev/null && ret=1 grep "flags:[^;]* ad[^;]*;" dig.out.ns4.test$n.2 > /dev/null || ret=1 echo_i "killing ns4 with SIGTERM" -$KILL -TERM "$(cat ns4/named.pid)" +kill -TERM "$(cat ns4/named.pid)" rm -f ns4/named.pid echo_i "sleeping for an additional 4 seconds for ns4 to fully shutdown" @@ -2272,7 +2269,7 @@ grep "status: SERVFAIL" dig.out.ns4.test$n.2 > /dev/null && ret=1 grep "flags:[^;]* ad[^;]*;" dig.out.ns4.test$n.2 > /dev/null || ret=1 echo_i "killing ns4 with SIGTERM" -$KILL -TERM "$(cat ns4/named.pid)" +kill -TERM "$(cat ns4/named.pid)" rm -f named.pid echo_i "sleeping for an additional 4 seconds for ns4 to fully shutdown" @@ -2320,7 +2317,7 @@ n=$((n+1)) echo_i "testing loading out of bounds lifetime from NTA file ($n)" echo_i "killing ns4 with SIGTERM" -$KILL -TERM "$(cat ns4/named.pid)" +kill -TERM "$(cat ns4/named.pid)" rm -f ns4/named.pid echo_i "sleeping for an additional 4 seconds for ns4 to fully shutdown" @@ -2882,8 +2879,8 @@ awk '{ for (i=1;i<7;i++) printf("%s ", $i); for (i=7;i<=NF;i++) printf("%s", $i); printf("\n"); -}' < ns1/dsset-algroll$TP > canonical2.$n || ret=1 -$DIFF -b canonical1.$n canonical2.$n > /dev/null 2>&1 || ret=1 +}' < ns1/dsset-algroll. > canonical2.$n || ret=1 +diff -b canonical1.$n canonical2.$n > /dev/null 2>&1 || ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" status=$((status+ret)) @@ -2942,7 +2939,7 @@ ret=0 dig_with_answeropts +nottlid nosign.example ns @10.53.0.3 | \ grep RRSIG | sed 's/[ ][ ]*/ /g' > dig.out.ns3.test$n 2>&1 # the NS RRSIG should not be changed -$DIFF nosign.before dig.out.ns3.test$n > /dev/null|| ret=1 +diff nosign.before dig.out.ns3.test$n > /dev/null|| ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" status=$((status+ret)) @@ -3460,7 +3457,7 @@ echo send dig_with_opts +noall +answer @10.53.0.2 cds cds-update.secure > dig.out.test$n lines=$(awk '$4 == "CDS" {print}' dig.out.test$n | wc -l) test "${lines:-10}" -eq 1 || ret=1 -lines=$(tr -d '\r' < dig.out.test$n | awk '$4 == "CDS" && $5 == "0" && $6 == "0" && $7 == "0" && $8 == "00" {print}' | wc -l) +lines=$(awk '$4 == "CDS" && $5 == "0" && $6 == "0" && $7 == "0" && $8 == "00" {print}' dig.out.test$n | wc -l) test "$lines" -eq 1 || ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" @@ -3532,7 +3529,7 @@ lines=$(awk -v id="${keyid}" '$4 == "RRSIG" && $5 == "CDS" && $11 == id {print}' test "$lines" -eq 1 || ret=1 lines=$(awk '$4 == "CDS" {print}' dig.out.test$n | wc -l) test "$lines" -eq 1 || ret=1 -lines=$(tr -d '\r' < dig.out.test$n | awk '$4 == "CDS" && $5 == "0" && $6 == "0" && $7 == "0" && $8 == "00" {print}' | wc -l) +lines=$(awk '$4 == "CDS" && $5 == "0" && $6 == "0" && $7 == "0" && $8 == "00" {print}' dig.out.test$n | wc -l) test "$lines" -eq 1 || ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" @@ -3673,7 +3670,7 @@ echo send dig_with_opts +noall +answer @10.53.0.2 cdnskey cdnskey-update.secure > dig.out.test$n lines=$(awk '$4 == "CDNSKEY" {print}' dig.out.test$n | wc -l) test "${lines:-10}" -eq 1 || ret=1 -lines=$(tr -d '\r' < dig.out.test$n | awk '$4 == "CDNSKEY" && $5 == "0" && $6 == "3" && $7 == "0" && $8 == "AA==" {print}' | wc -l) +lines=$(awk '$4 == "CDNSKEY" && $5 == "0" && $6 == "3" && $7 == "0" && $8 == "AA==" {print}' dig.out.test$n | wc -l) test "${lines:-10}" -eq 1 || ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" @@ -3750,7 +3747,7 @@ lines=$(awk -v id="${keyid}" '$4 == "RRSIG" && $5 == "CDNSKEY" && $11 == id {pri test "$lines" -eq 1 || ret=1 lines=$(awk '$4 == "CDNSKEY" {print}' dig.out.test$n | wc -l) test "$lines" -eq 1 || ret=1 -lines=$(tr -d '\r' < dig.out.test$n | awk '$4 == "CDNSKEY" && $5 == "0" && $6 == "3" && $7 == "0" && $8 == "AA==" {print}' | wc -l) +lines=$(awk '$4 == "CDNSKEY" && $5 == "0" && $6 == "3" && $7 == "0" && $8 == "AA==" {print}' dig.out.test$n | wc -l) test "${lines:-10}" -eq 1 || ret=1 n=$((n+1)) test "$ret" -eq 0 || echo_i "failed" diff --git a/bin/tests/system/dsdigest/ns1/sign.sh b/bin/tests/system/dsdigest/ns1/sign.sh index 766c7f54c8..a91b958394 100644 --- a/bin/tests/system/dsdigest/ns1/sign.sh +++ b/bin/tests/system/dsdigest/ns1/sign.sh @@ -19,8 +19,8 @@ zonefile=root.db (cd ../ns2 && $SHELL sign.sh) -cp ../ns2/dsset-good$TP . -cp ../ns2/dsset-bad$TP . +cp ../ns2/dsset-good. . +cp ../ns2/dsset-bad. . key1=`$KEYGEN -q -a RSASHA1 -b 1024 -n zone $zone` key2=`$KEYGEN -q -a RSASHA1 -b 2048 -n zone -f KSK $zone` diff --git a/bin/tests/system/dsdigest/ns2/sign.sh b/bin/tests/system/dsdigest/ns2/sign.sh index 3b5bb5d814..9329729f98 100644 --- a/bin/tests/system/dsdigest/ns2/sign.sh +++ b/bin/tests/system/dsdigest/ns2/sign.sh @@ -31,8 +31,8 @@ cat $infile2 $keyname21.key $keyname22.key >$zonefile2 $SIGNER -P -g -o $zone1 $zonefile1 > /dev/null $SIGNER -P -g -o $zone2 $zonefile2 > /dev/null -DSFILENAME1=dsset-${zone1}${TP} -DSFILENAME2=dsset-${zone2}${TP} +DSFILENAME1=dsset-${zone1}. +DSFILENAME2=dsset-${zone2}. $DSFROMKEY -a SHA-256 $keyname12 > $DSFILENAME1 $DSFROMKEY -a SHA-256 $keyname22 > $DSFILENAME2 diff --git a/bin/tests/system/forward/tests.sh b/bin/tests/system/forward/tests.sh index 1de0de4442..2f24a381a6 100644 --- a/bin/tests/system/forward/tests.sh +++ b/bin/tests/system/forward/tests.sh @@ -166,7 +166,7 @@ count_sent() ( logfile="$1" start_pattern="$2" pattern="$3" - nextpartpeek "$logfile" | tr -d '\r' | sed -n "/$start_pattern/,/^\$/p" | grep -c "$pattern" + nextpartpeek "$logfile" | sed -n "/$start_pattern/,/^\$/p" | grep -c "$pattern" ) check_sent() ( diff --git a/bin/tests/system/inline/tests.sh b/bin/tests/system/inline/tests.sh index 31d23d83f5..8d4026bd0d 100755 --- a/bin/tests/system/inline/tests.sh +++ b/bin/tests/system/inline/tests.sh @@ -967,7 +967,7 @@ do done # Sanity check: the SOA record should be unchanged $DIG $DIGOPTS +short @10.53.0.3 primary SOA > dig.out.ns3.test$n.2 || ret=1 -$DIFF dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null || ret=1 +diff dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -991,7 +991,7 @@ _includefile_loaded() { retry_quiet 10 _includefile_loaded # Sanity check: the SOA record should be changed $DIG $DIGOPTS +short @10.53.0.3 primary SOA > dig.out.ns3.test$n.2 || ret=1 -$DIFF dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null && ret=1 +diff dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/kasp/tests.sh b/bin/tests/system/kasp/tests.sh index 7eaa06cf95..27d4e3f500 100644 --- a/bin/tests/system/kasp/tests.sh +++ b/bin/tests/system/kasp/tests.sh @@ -161,7 +161,7 @@ cp "$STATE_FILE" "$CMP_FILE" $SETTIME -P +3600 "$BASE_FILE" > /dev/null || log_error "settime failed" grep "; Publish: " "$KEY_FILE" > /dev/null || log_error "mismatch published in $KEY_FILE" grep "Publish: " "$PRIVATE_FILE" > /dev/null || log_error "mismatch published in $PRIVATE_FILE" -$DIFF "$CMP_FILE" "$STATE_FILE" || log_error "unexpected file change in $STATE_FILE" +diff "$CMP_FILE" "$STATE_FILE" || log_error "unexpected file change in $STATE_FILE" test "$ret" -eq 0 || echo_i "failed" status=$((status+ret)) diff --git a/bin/tests/system/keepalive/tests.sh b/bin/tests/system/keepalive/tests.sh index 27704cb886..124ca24acd 100644 --- a/bin/tests/system/keepalive/tests.sh +++ b/bin/tests/system/keepalive/tests.sh @@ -71,7 +71,7 @@ echo_i "checking re-configured value ($n)" ret=0 n=`expr $n + 1` $RNDCCMD tcp-timeouts 300 300 300 200 > output -$DIFF -b output expected || ret=1 +diff -b output expected || ret=1 $DIG $DIGOPTS +vc +keepalive foo.example @10.53.0.2 > dig.out.test$n grep "; TCP KEEPALIVE: 20.0 secs" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi diff --git a/bin/tests/system/masterfile/tests.sh b/bin/tests/system/masterfile/tests.sh index 890855deb3..6ca4ea5b0a 100644 --- a/bin/tests/system/masterfile/tests.sh +++ b/bin/tests/system/masterfile/tests.sh @@ -29,7 +29,7 @@ $DIG $DIGOPTS +nostats +nocmd ttl2. axfr @10.53.0.1 >>dig.out.$n echo_i "test of master file RFC1035 TTL and \$TTL semantics ($n)" $DIG $DIGOPTS +nostats +nocmd ttl2. axfr @10.53.0.1 >>dig.out.$n -$DIFF dig.out.$n knowngood.dig.out || status=1 +diff dig.out.$n knowngood.dig.out || status=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -53,7 +53,7 @@ ret=0 n=`expr $n + 1` echo_i "test owner inheritance after "'$INCLUDE'" ($n)" $CHECKZONE -Dq example zone/inheritownerafterinclude.db > checkzone.out$n -$DIFF checkzone.out$n zone/inheritownerafterinclude.good || ret=1 +diff checkzone.out$n zone/inheritownerafterinclude.good || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/names/tests.sh b/bin/tests/system/names/tests.sh index d16857229b..d6495707a7 100644 --- a/bin/tests/system/names/tests.sh +++ b/bin/tests/system/names/tests.sh @@ -30,7 +30,7 @@ cat dig.compdis.test |grep -v ';;' |sort > dig.compdis.sorted.test # the compression disabled message should be at least twice as large as with # compression disabled, but the content should be the same echo_i "Checking if responses are identical other than in message size" -$DIFF dig.compdis.sorted.test dig.compen.sorted.test >/dev/null +diff dig.compdis.sorted.test dig.compen.sorted.test >/dev/null ret=$? if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh index ccf9a067d5..85458ae117 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -94,13 +94,8 @@ nextpart ns3/named.run > /dev/null sleep 1 # make sure filesystem time stamp is newer for reload. rm -f ns2/example.db cp -f ns2/example2.db ns2/example.db -if [ ! "$CYGWIN" ]; then - echo_i "reloading with example2 using HUP and waiting up to 45 seconds" - $KILL -HUP `cat ns2/named.pid` -else - echo_i "reloading with example2 using rndc and waiting up to 45 seconds" - rndc_reload ns2 10.53.0.2 -fi +echo_i "reloading with example2 using HUP and waiting up to 45 seconds" +kill -HUP `cat ns2/named.pid` try=0 while test $try -lt 45 diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index e21676ca0e..7316fe327c 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -357,7 +357,7 @@ digcomp dig.out.ns1 dig.out.ns2 || ret=1 echo_i "SIGKILL and restart server ns1" cd ns1 -$KILL -KILL `cat named.pid` +kill -KILL `cat named.pid` rm named.pid cd .. sleep 10 @@ -400,13 +400,8 @@ END sleep 5 -if [ ! "$CYGWIN" ]; then - echo_i "SIGHUP secondary" - $KILL -HUP `cat ns2/named.pid` -else - echo_i "reload secondary" - rndc_reload ns2 10.53.0.2 -fi +echo_i "SIGHUP secondary" +kill -HUP `cat ns2/named.pid` sleep 5 @@ -424,13 +419,8 @@ END sleep 5 -if [ ! "$CYGWIN" ]; then - echo_i "SIGHUP secondary again" - $KILL -HUP `cat ns2/named.pid` -else - echo_i "reload secondary again" - rndc_reload ns2 10.53.0.2 -fi +echo_i "SIGHUP secondary again" +kill -HUP `cat ns2/named.pid` sleep 5 diff --git a/bin/tests/system/pending/ns1/sign.sh b/bin/tests/system/pending/ns1/sign.sh index 7e52ac3953..cadccb8ebe 100644 --- a/bin/tests/system/pending/ns1/sign.sh +++ b/bin/tests/system/pending/ns1/sign.sh @@ -19,8 +19,8 @@ zonefile=root.db (cd ../ns2 && $SHELL -e sign.sh ) -cp ../ns2/dsset-example$TP . -cp ../ns2/dsset-example.com$TP . +cp ../ns2/dsset-example. . +cp ../ns2/dsset-example.com. . keyname1=`$KEYGEN -q -a RSASHA256 -b 1024 -n zone $zone` keyname2=`$KEYGEN -q -a RSASHA256 -b 2048 -f KSK -n zone $zone` diff --git a/bin/tests/system/pipelined/tests.sh b/bin/tests/system/pipelined/tests.sh index 90d3ec0cde..34a105f5f7 100644 --- a/bin/tests/system/pipelined/tests.sh +++ b/bin/tests/system/pipelined/tests.sh @@ -23,8 +23,8 @@ ret=0 $PIPEQUERIES -p ${PORT} < input > raw || ret=1 awk '{ print $1 " " $5 }' < raw > output sort < output > output-sorted -$DIFF ref output-sorted || { ret=1 ; echo_i "diff sorted failed"; } -$DIFF ref output > /dev/null && { ret=1 ; echo_i "diff out of order failed"; } +diff ref output-sorted || { ret=1 ; echo_i "diff sorted failed"; } +diff ref output > /dev/null && { ret=1 ; echo_i "diff out of order failed"; } if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -35,8 +35,8 @@ sleep 1 $MDIG $MDIGOPTS +noall +answer +vc -f input -b 10.53.0.4 @10.53.0.4 > raw.mdig awk '{ print $1 " " $5 }' < raw.mdig > output.mdig sort < output.mdig > output-sorted.mdig -$DIFF ref output-sorted.mdig || { ret=1 ; echo_i "diff sorted failed"; } -$DIFF ref output.mdig > /dev/null && { ret=1 ; echo_i "diff out of order failed"; } +diff ref output-sorted.mdig || { ret=1 ; echo_i "diff sorted failed"; } +diff ref output.mdig > /dev/null && { ret=1 ; echo_i "diff out of order failed"; } if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -46,7 +46,7 @@ $RNDCCMD 10.53.0.4 flush sleep 1 $PIPEQUERIES -p ${PORT} ++ < inputb > rawb || ret=1 awk '{ print $1 " " $5 }' < rawb > outputb -$DIFF refb outputb || ret=1 +diff refb outputb || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -56,7 +56,7 @@ $RNDCCMD 10.53.0.4 flush sleep 1 $MDIG $MDIGOPTS +noall +answer +vc -f inputb -b 10.53.0.7 @10.53.0.4 > rawb.mdig awk '{ print $1 " " $5 }' < rawb.mdig > outputb.mdig -$DIFF refb outputb.mdig || ret=1 +diff refb outputb.mdig || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/qmin/tests.sh b/bin/tests/system/qmin/tests.sh index 6141aae892..f2b2d4c3ad 100755 --- a/bin/tests/system/qmin/tests.sh +++ b/bin/tests/system/qmin/tests.sh @@ -28,15 +28,15 @@ $DIG $DIGOPTS icky.icky.icky.ptang.zoop.boing.good. @10.53.0.5 > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.good. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 -cat << __EOF | $DIFF ans2/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log - > /dev/null || ret=1 ADDR icky.icky.icky.ptang.zoop.boing.good. ADDR ns3.good. ADDR ns3.good. ADDR a.bit.longer.ns.name.good. ADDR a.bit.longer.ns.name.good. __EOF -echo "ADDR icky.icky.icky.ptang.zoop.boing.good." | $DIFF ans3/query.log - > /dev/null || ret=1 -echo "ADDR icky.icky.icky.ptang.zoop.boing.good." | $DIFF ans4/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.good." | diff ans3/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.good." | diff ans4/query.log - > /dev/null || ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -50,15 +50,15 @@ $DIG $DIGOPTS icky.icky.icky.ptang.zoop.boing.bad. @10.53.0.5 > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.bad. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 -cat << __EOF | $DIFF ans2/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log - > /dev/null || ret=1 ADDR icky.icky.icky.ptang.zoop.boing.bad. ADDR ns3.bad. ADDR ns3.bad. ADDR a.bit.longer.ns.name.bad. ADDR a.bit.longer.ns.name.bad. __EOF -echo "ADDR icky.icky.icky.ptang.zoop.boing.bad." | $DIFF ans3/query.log - > /dev/null || ret=1 -echo "ADDR icky.icky.icky.ptang.zoop.boing.bad." | $DIFF ans4/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.bad." | diff ans3/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.bad." | diff ans4/query.log - > /dev/null || ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -73,15 +73,15 @@ sleep 5 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.slow. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 -cat << __EOF | $DIFF ans2/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log - > /dev/null || ret=1 ADDR icky.icky.icky.ptang.zoop.boing.slow. ADDR ns3.slow. ADDR ns3.slow. ADDR a.bit.longer.ns.name.slow. ADDR a.bit.longer.ns.name.slow. __EOF -echo "ADDR icky.icky.icky.ptang.zoop.boing.slow." | $DIFF ans3/query.log - > /dev/null || ret=1 -echo "ADDR icky.icky.icky.ptang.zoop.boing.slow." | $DIFF ans4/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.slow." | diff ans3/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.slow." | diff ans4/query.log - > /dev/null || ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -96,15 +96,15 @@ sleep 5 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.ugly. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 -cat << __EOF | $DIFF ans2/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log - > /dev/null || ret=1 ADDR icky.icky.icky.ptang.zoop.boing.ugly. ADDR ns3.ugly. ADDR ns3.ugly. ADDR a.bit.longer.ns.name.ugly. ADDR a.bit.longer.ns.name.ugly. __EOF -echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | $DIFF ans3/query.log - > /dev/null || ret=1 -echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | $DIFF ans4/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | diff ans3/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | diff ans4/query.log - > /dev/null || ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -119,7 +119,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.good. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR a.bit.longer.ns.name.good. ADDR a.bit.longer.ns.name.good. ADDR ns2.good. @@ -129,12 +129,12 @@ NS boing.good. NS good. NS zoop.boing.good. __EOF -cat << __EOF | $DIFF ans3/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans3/query.log - > /dev/null || ret=1 NS zoop.boing.good. NS ptang.zoop.boing.good. NS icky.ptang.zoop.boing.good. __EOF -cat << __EOF | $DIFF ans4/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log - > /dev/null || ret=1 NS icky.ptang.zoop.boing.good. NS icky.icky.ptang.zoop.boing.good. ADDR icky.icky.icky.ptang.zoop.boing.good. @@ -153,7 +153,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.good. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR _.boing.good. ADDR _.zoop.boing.good. ADDR a.bit.longer.ns.name.good. @@ -162,11 +162,11 @@ ADDR ns2.good. ADDR ns3.good. ADDR ns3.good. __EOF -cat << __EOF | $DIFF ans3/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans3/query.log - > /dev/null || ret=1 ADDR _.ptang.zoop.boing.good. ADDR _.icky.ptang.zoop.boing.good. __EOF -cat << __EOF | $DIFF ans4/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log - > /dev/null || ret=1 ADDR _.icky.icky.ptang.zoop.boing.good. ADDR icky.icky.icky.ptang.zoop.boing.good. __EOF @@ -183,7 +183,7 @@ $DIG $DIGOPTS icky.icky.icky.ptang.zoop.boing.bad. @10.53.0.6 > dig.out.test$n grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR ns2.bad. NS bad. NS boing.bad. @@ -202,7 +202,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.bad. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR _.boing.bad. ADDR _.zoop.boing.bad. ADDR a.bit.longer.ns.name.bad. @@ -211,11 +211,11 @@ ADDR ns2.bad. ADDR ns3.bad. ADDR ns3.bad. __EOF -cat << __EOF | $DIFF ans3/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans3/query.log - > /dev/null || ret=1 ADDR _.ptang.zoop.boing.bad. ADDR _.icky.ptang.zoop.boing.bad. __EOF -cat << __EOF | $DIFF ans4/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log - > /dev/null || ret=1 ADDR _.icky.icky.ptang.zoop.boing.bad. ADDR icky.icky.icky.ptang.zoop.boing.bad. __EOF @@ -232,7 +232,7 @@ $DIG $DIGOPTS icky.icky.icky.ptang.zoop.boing.ugly. @10.53.0.6 > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR ns2.ugly. NS boing.ugly. NS ugly. @@ -253,7 +253,7 @@ grep "icky.icky.icky.ptang.zoop.boing.ugly. 1 IN A 192.0.2.1" dig.out.test$n > / sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR _.boing.ugly. ADDR a.bit.longer.ns.name.ugly. ADDR a.bit.longer.ns.name.ugly. @@ -262,8 +262,8 @@ ADDR ns2.ugly. ADDR ns3.ugly. ADDR ns3.ugly. __EOF -echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | $DIFF ans3/query.log - > /dev/null || ret=1 -echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | $DIFF ans4/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | diff ans3/query.log - > /dev/null || ret=1 +echo "ADDR icky.icky.icky.ptang.zoop.boing.ugly." | diff ans4/query.log - > /dev/null || ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -286,7 +286,7 @@ sleep 5 grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "icky.icky.icky.ptang.zoop.boing.slow. 1 IN A 192.0.2.1" dig.out.test$n > /dev/null || ret=1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR a.bit.longer.ns.name.slow. ADDR a.bit.longer.ns.name.slow. ADDR ns2.slow. @@ -296,12 +296,12 @@ NS boing.slow. NS slow. NS zoop.boing.slow. __EOF -cat << __EOF | $DIFF ans3/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans3/query.log - > /dev/null || ret=1 NS zoop.boing.slow. NS ptang.zoop.boing.slow. NS icky.ptang.zoop.boing.slow. __EOF -cat << __EOF | $DIFF ans4/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log - > /dev/null || ret=1 NS icky.ptang.zoop.boing.slow. NS icky.icky.ptang.zoop.boing.slow. ADDR icky.icky.icky.ptang.zoop.boing.slow. @@ -320,7 +320,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.f.4.0.1.0.0.2.ip6.arpa. 1 IN PTR nee.com." dig.out.test$n > /dev/null || ret=1 sleep 1 grep -v ADDR ans2/query.log > ans2/query.log.trimmed -cat << __EOF | $DIFF ans2/query.log.trimmed - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.trimmed - > /dev/null || ret=1 NS 1.0.0.2.ip6.arpa. NS 8.f.4.0.1.0.0.2.ip6.arpa. NS 0.0.0.0.8.f.4.0.1.0.0.2.ip6.arpa. @@ -342,7 +342,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "more.icky.icky.icky.ptang.zoop.boing.good. 1 IN A 192.0.2.2" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR a.bit.longer.ns.name.good. ADDR a.bit.longer.ns.name.good. ADDR ns2.good. @@ -352,13 +352,13 @@ NS boing.good. NS good. NS zoop.boing.good. __EOF -cat << __EOF | $DIFF ans3/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans3/query.log - > /dev/null || ret=1 NS zoop.boing.good. NS ptang.zoop.boing.good. NS icky.ptang.zoop.boing.good. __EOF # There's no NS icky.icky.icky.ptang.zoop.boing.good. query - we skipped it. -cat << __EOF | $DIFF ans4/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log - > /dev/null || ret=1 NS icky.ptang.zoop.boing.good. NS icky.icky.ptang.zoop.boing.good. ADDR more.icky.icky.icky.ptang.zoop.boing.good. @@ -376,7 +376,7 @@ $DIG $DIGOPTS a.bit.longer.ns.name.fwd. @10.53.0.7 > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a.bit.longer.ns.name.fwd. 1 IN A 10.53.0.4" dig.out.test$n >/dev/null || ret=1 sleep 1 -cat << __EOF | $DIFF ans2/query.log - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log - > /dev/null || ret=1 ADDR a.bit.longer.ns.name.fwd. __EOF for ans in ans2; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done @@ -413,8 +413,8 @@ $DIG $DIGOPTS @10.53.0.5 txt a.b.stale. > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*peekaboo" dig.out.test$n > /dev/null || ret=1 sleep 1 -echo "TXT a.b.stale." | $DIFF ans2/query.log - > /dev/null || ret=1 -echo "TXT a.b.stale." | $DIFF ans3/query.log - > /dev/null || ret=1 +echo "TXT a.b.stale." | diff ans2/query.log - > /dev/null || ret=1 +echo "TXT a.b.stale." | diff ans3/query.log - > /dev/null || ret=1 test -f ans4/query.log && ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -430,7 +430,7 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*hooray" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR ns.b.stale. ADDR ns2.stale. NS b.stale. @@ -438,7 +438,7 @@ NS stale. __EOF test -f ans3/query.log && ret=1 sort ans4/query.log > ans4/query.log.sorted -cat << __EOF | $DIFF ans4/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log.sorted - > /dev/null || ret=1 ADDR ns.b.stale. NS b.stale. TXT a.b.stale. @@ -457,14 +457,14 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*hooray" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR _.b.stale. ADDR ns.b.stale. ADDR ns2.stale. __EOF test -f ans3/query.log && ret=1 sort ans4/query.log > ans4/query.log.sorted -cat << __EOF | $DIFF ans4/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log.sorted - > /dev/null || ret=1 ADDR ns.b.stale. TXT a.b.stale. __EOF @@ -483,8 +483,8 @@ $DIG $DIGOPTS @10.53.0.5 txt a.b.stale. > dig.out.test$n grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*peekaboo" dig.out.test$n > /dev/null || ret=1 sleep 1 -echo "TXT a.b.stale." | $DIFF ans2/query.log - > /dev/null || ret=1 -echo "TXT a.b.stale." | $DIFF ans3/query.log - > /dev/null || ret=1 +echo "TXT a.b.stale." | diff ans2/query.log - > /dev/null || ret=1 +echo "TXT a.b.stale." | diff ans3/query.log - > /dev/null || ret=1 test -f ans4/query.log && ret=1 for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -499,13 +499,13 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*hooray" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 NS b.stale. NS stale. __EOF test -f ans3/query.log && ret=1 sort ans4/query.log > ans4/query.log.sorted -cat << __EOF | $DIFF ans4/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log.sorted - > /dev/null || ret=1 NS b.stale. TXT a.b.stale. __EOF @@ -522,12 +522,12 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 grep "a\.b\.stale\..*1.*IN.*TXT.*hooray" dig.out.test$n > /dev/null || ret=1 sleep 1 sort ans2/query.log > ans2/query.log.sorted -cat << __EOF | $DIFF ans2/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans2/query.log.sorted - > /dev/null || ret=1 ADDR _.b.stale. __EOF test -f ans3/query.log && ret=1 sort ans4/query.log > ans4/query.log.sorted -cat << __EOF | $DIFF ans4/query.log.sorted - > /dev/null || ret=1 +cat << __EOF | diff ans4/query.log.sorted - > /dev/null || ret=1 TXT a.b.stale. __EOF for ans in ans2 ans3 ans4; do mv -f $ans/query.log query-$ans-$n.log 2>/dev/null || true; done diff --git a/bin/tests/system/redirect/tests.sh b/bin/tests/system/redirect/tests.sh index 0e0ef10b7f..70ba727bc7 100644 --- a/bin/tests/system/redirect/tests.sh +++ b/bin/tests/system/redirect/tests.sh @@ -54,11 +54,11 @@ echo_i "checking A zone redirect updates statistics ($n)" ret=0 rm ns2/named.stats 2>/dev/null $RNDCCMD 10.53.0.2 stats || ret=1 -PRE=`tr -d '\r' < ns2/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p"` +PRE=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p" ns2/named.stats` $DIG $DIGOPTS nonexist. @10.53.0.2 -b 10.53.0.2 a > dig.out.ns2.test$n || ret=1 rm ns2/named.stats 2>/dev/null $RNDCCMD 10.53.0.2 stats || ret=1 -POST=`tr -d '\r' < ns2/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p"` +POST=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p" ns2/named.stats` if [ `expr $POST - $PRE` != 1 ]; then ret=1; fi n=`expr $n + 1` if [ $ret != 0 ]; then echo_i "failed"; fi @@ -352,8 +352,8 @@ status=`expr $status + $ret` echo_i "checking that redirect zones reload correctly" ret=0 sleep 1 # ensure file mtime will have changed -tr -d '\r' < ns2/example.db.in | sed -e 's/0 0 0 0 0/1 0 0 0 0/' > ns2/example.db -tr -d '\r' < ns2/redirect.db.in | sed -e 's/0 0 0 0 0/1 0 0 0 0/' -e 's/\.1$/.2/' > ns2/redirect.db +cat ns2/example.db.in | sed -e 's/0 0 0 0 0/1 0 0 0 0/' > ns2/example.db +cat ns2/redirect.db.in | sed -e 's/0 0 0 0 0/1 0 0 0 0/' -e 's/\.1$/.2/' > ns2/redirect.db rndc_reload ns2 10.53.0.2 for i in 1 2 3 4 5 6 7 8 9; do tmp=0 @@ -384,8 +384,8 @@ echo_i "checking AAAA nxdomain-redirect works for nonexist ($n)" ret=0 rm ns4/named.stats 2>/dev/null $RNDCCMD 10.53.0.4 stats || ret=1 -PRE_RED=`tr -d '\r' < ns4/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p"` -PRE_SUC=`tr -d '\r' < ns4/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected and resulted in a successful remote lookup$/\1/p"` +PRE_RED=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p" ns4/named.stats` +PRE_SUC=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected and resulted in a successful remote lookup$/\1/p" ns4/named.stats` $DIG $DIGOPTS nonexist. @10.53.0.4 -b 10.53.0.2 aaaa > dig.out.ns4.test$n || ret=1 grep "status: NOERROR" dig.out.ns4.test$n > /dev/null || ret=1 grep "nonexist. .*2001:ffff:ffff::6464:6401" dig.out.ns4.test$n > /dev/null || ret=1 @@ -397,8 +397,8 @@ echo_i "checking AAAA nxdomain-redirect updates statistics ($n)" ret=0 rm ns4/named.stats 2>/dev/null $RNDCCMD 10.53.0.4 stats || ret=1 -POST_RED=`tr -d '\r' < ns4/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p"` -POST_SUC=`tr -d '\r' < ns4/named.stats | sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected and resulted in a successful remote lookup$/\1/p"` +POST_RED=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected$/\1/p" ns4/named.stats` +POST_SUC=`sed -n -e "s/[ ]*\([0-9]*\).queries resulted in NXDOMAIN that were redirected and resulted in a successful remote lookup$/\1/p" ns4/named.stats` if [ `expr $POST_RED - $PRE_RED` != 1 ]; then ret=1; fi if [ `expr $POST_SUC - $PRE_SUC` != 1 ]; then ret=1; fi n=`expr $n + 1` diff --git a/bin/tests/system/resolver/ns6/keygen.sh b/bin/tests/system/resolver/ns6/keygen.sh index 864916d46e..9a0d7123da 100644 --- a/bin/tests/system/resolver/ns6/keygen.sh +++ b/bin/tests/system/resolver/ns6/keygen.sh @@ -28,7 +28,7 @@ infile="${zonefile}.in" cp $infile $zonefile ksk=`$KEYGEN -q -a rsasha256 -fk $zone` zsk=`$KEYGEN -q -a rsasha256 $zone` -cat $ksk.key $zsk.key dsset-ds.example.net$TP >> $zonefile +cat $ksk.key $zsk.key dsset-ds.example.net. >> $zonefile $SIGNER -P -o $zone $zonefile > /dev/null # Configure a static key to be used by delv diff --git a/bin/tests/system/rootkeysentinel/ns1/sign.sh b/bin/tests/system/rootkeysentinel/ns1/sign.sh index 9d7d35d717..8a8249213b 100644 --- a/bin/tests/system/rootkeysentinel/ns1/sign.sh +++ b/bin/tests/system/rootkeysentinel/ns1/sign.sh @@ -22,7 +22,7 @@ keyid=`expr ${keyname} : 'K.+008+\(.*\)'` (cd ../ns2 && $SHELL sign.sh ${keyid:-00000} ) -cp ../ns2/dsset-example$TP . +cp ../ns2/dsset-example. . cat $infile $keyname.key > $zonefile diff --git a/bin/tests/system/rpz/setup.sh b/bin/tests/system/rpz/setup.sh index b1321ad0da..e679a8aab2 100644 --- a/bin/tests/system/rpz/setup.sh +++ b/bin/tests/system/rpz/setup.sh @@ -90,7 +90,7 @@ signzone () { cat $1/$3 $1/$KEYNAME.key > $1/tmp $SIGNER -P -K $1 -o $2 -f $1/$4 $1/tmp >/dev/null sed -n -e 's/\(.*\) IN DNSKEY \([0-9]\{1,\} [0-9]\{1,\} [0-9]\{1,\}\) \(.*\)/trust-anchors {"\1" static-key \2 "\3";};/p' $1/$KEYNAME.key >>trusted.conf - DSFILENAME=dsset-${2}${TP} + DSFILENAME=dsset-${2}. rm $DSFILENAME $1/tmp } signzone ns2 tld2s base-tld2s.db tld2s.db diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh index 816a0b78d0..12fb767648 100644 --- a/bin/tests/system/rpz/tests.sh +++ b/bin/tests/system/rpz/tests.sh @@ -205,7 +205,7 @@ restart () { PID=`cat ns$1/named.pid 2>/dev/null` if test -n "$PID"; then echo_i "killing ns$1 server $PID" - $KILL -9 $PID + kill -9 $PID fi fi fi @@ -381,7 +381,7 @@ addr () { digcmd $2 >$DIGNM #ckalive "$2" "server crashed by 'dig $2'" || return 1 ADDR_ESC=`echo "$ADDR" | sed -e 's/\./\\\\./g'` - ADDR_TTL=`tr -d '\r' < $DIGNM | sed -n -e "s/^[-.a-z0-9]\{1,\}[ ]*\([0-9]*\) IN AA* ${ADDR_ESC}\$/\1/p"` + ADDR_TTL=`sed -n -e "s/^[-.a-z0-9]\{1,\}[ ]*\([0-9]*\) IN AA* ${ADDR_ESC}\$/\1/p" $DIGNM` if test -z "$ADDR_TTL"; then setret "'dig $2' wrong; no address $ADDR record in $DIGNM" return 1 @@ -768,7 +768,7 @@ EOF if [ "$mode" = dnsrps ]; then echo_i "checking that dnsrpzd is automatically restarted" OLD_PID=`cat dnsrpzd.pid` - $KILL "$OLD_PID" + kill "$OLD_PID" n=0 while true; do NEW_PID=`cat dnsrpzd.pid 2>/dev/null` diff --git a/bin/tests/system/rpzrecurse/tests.sh b/bin/tests/system/rpzrecurse/tests.sh index d5704fd84c..2ac213fff7 100644 --- a/bin/tests/system/rpzrecurse/tests.sh +++ b/bin/tests/system/rpzrecurse/tests.sh @@ -238,112 +238,89 @@ for mode in native dnsrps; do expect_recurse 5a 5 expect_recurse 5a 6 - if [ ! "$CYGWIN" -o -n "$PSSUSPEND" ] - then - # Group 6 - echo_i "check recursive behavior consistency during policy update races" - run_server 6a + # Group 6 + echo_i "check recursive behavior consistency during policy update races" + run_server 6a + sleep 1 + t=`expr $t + 1` + echo_i "running dig to cache CNAME record (${t})" + add_test_marker 10.53.0.1 10.53.0.2 + $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t} + sleep 1 + echo_i "suspending authority server" + PID=`cat ns1/named.pid` + kill -STOP $PID + echo_i "adding an NSDNAME policy" + cp ns2/db.6a.00.policy.local ns2/saved.policy.local + cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local + $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i + test -f dnsrpzd.pid && kill -USR1 `cat dnsrpzd.pid` + sleep 1 + t=`expr $t + 1` + echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})" + add_test_marker 10.53.0.2 + $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} & + sleep 1 + echo_i "removing the NSDNAME policy" + cp ns2/db.6c.00.policy.local ns2/db.6a.00.policy.local + $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i + test -f dnsrpzd.pid && kill -USR1 `cat dnsrpzd.pid` + sleep 1 + echo_i "resuming authority server" + PID=`cat ns1/named.pid` + kill -CONT $PID + add_test_marker 10.53.0.1 + for n in 1 2 3 4 5 6 7 8 9 + do sleep 1 - t=`expr $t + 1` - echo_i "running dig to cache CNAME record (${t})" - add_test_marker 10.53.0.1 10.53.0.2 - $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t} - sleep 1 - echo_i "suspending authority server" - PID=`cat ns1/named.pid` - if [ "$CYGWIN" ] - then - $PSSUSPEND $PID - else - $KILL -STOP $PID - fi - echo_i "adding an NSDNAME policy" - cp ns2/db.6a.00.policy.local ns2/saved.policy.local - cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local - $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i - test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid` - sleep 1 - t=`expr $t + 1` - echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})" - add_test_marker 10.53.0.2 - $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} & - sleep 1 - echo_i "removing the NSDNAME policy" - cp ns2/db.6c.00.policy.local ns2/db.6a.00.policy.local - $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i - test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid` - sleep 1 - echo_i "resuming authority server" - PID=`cat ns1/named.pid` - if [ "$CYGWIN" ] - then - $PSSUSPEND -r $PID - else - $KILL -CONT $PID - fi - add_test_marker 10.53.0.1 - for n in 1 2 3 4 5 6 7 8 9 - do - sleep 1 - [ -s dig.out.${t} ] || continue - grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break - done - grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || { - echo_i "test ${t} failed" - status=1 - } + [ -s dig.out.${t} ] || continue + grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break + done + grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || { + echo_i "test ${t} failed" + status=1 + } - echo_i "check recursive behavior consistency during policy removal races" - cp ns2/saved.policy.local ns2/db.6a.00.policy.local - run_server 6a + echo_i "check recursive behavior consistency during policy removal races" + cp ns2/saved.policy.local ns2/db.6a.00.policy.local + run_server 6a + sleep 1 + t=`expr $t + 1` + echo_i "running dig to cache CNAME record (${t})" + add_test_marker 10.53.0.1 10.53.0.2 + $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t} + sleep 1 + echo_i "suspending authority server" + PID=`cat ns1/named.pid` + kill -STOP $PID + echo_i "adding an NSDNAME policy" + cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local + $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i + test -f dnsrpzd.pid && kill -USR1 `cat dnsrpzd.pid` + sleep 1 + t=`expr $t + 1` + echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})" + add_test_marker 10.53.0.2 + $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} & + sleep 1 + echo_i "removing the policy zone" + cp ns2/named.default.conf ns2/named.conf + rndc_reconfig ns2 10.53.0.2 + test -f dnsrpzd.pid && kill -USR1 `cat dnsrpzd.pid` + sleep 1 + echo_i "resuming authority server" + PID=`cat ns1/named.pid` + kill -CONT $PID + add_test_marker 10.53.0.1 + for n in 1 2 3 4 5 6 7 8 9; do sleep 1 - t=`expr $t + 1` - echo_i "running dig to cache CNAME record (${t})" - add_test_marker 10.53.0.1 10.53.0.2 - $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org CNAME > dig.out.${t} - sleep 1 - echo_i "suspending authority server" - PID=`cat ns1/named.pid` - if [ "$CYGWIN" ] - then - $PSSUSPEND $PID - else - $KILL -STOP $PID - fi - echo_i "adding an NSDNAME policy" - cp ns2/db.6b.00.policy.local ns2/db.6a.00.policy.local - $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 6a.00.policy.local 2>&1 | sed 's/^/ns2 /' | cat_i - test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid` - sleep 1 - t=`expr $t + 1` - echo_i "running dig to follow CNAME (blocks, so runs in the background) (${t})" - add_test_marker 10.53.0.2 - $DIG $DIGOPTS @10.53.0.2 -p ${PORT} www.test.example.org A +time=5 > dig.out.${t} & - sleep 1 - echo_i "removing the policy zone" - cp ns2/named.default.conf ns2/named.conf - rndc_reconfig ns2 10.53.0.2 - test -f dnsrpzd.pid && $KILL -USR1 `cat dnsrpzd.pid` - sleep 1 - echo_i "resuming authority server" - PID=`cat ns1/named.pid` - if [ "$CYGWIN" ] - then - $PSSUSPEND -r $PID - else - $KILL -CONT $PID - fi - add_test_marker 10.53.0.1 - for n in 1 2 3 4 5 6 7 8 9; do - sleep 1 - [ -s dig.out.${t} ] || continue - grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break - done - grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || { - echo_i "test ${t} failed" - status=1 - } - fi + [ -s dig.out.${t} ] || continue + grep "status: .*," dig.out.${t} > /dev/null 2>&1 && break + done + grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || { + echo_i "test ${t} failed" + status=1 + } # Check maximum number of RPZ zones (64) t=`expr $t + 1` diff --git a/bin/tests/system/rrchecker/tests.sh b/bin/tests/system/rrchecker/tests.sh index 90696c73c7..0e493eb936 100644 --- a/bin/tests/system/rrchecker/tests.sh +++ b/bin/tests/system/rrchecker/tests.sh @@ -19,17 +19,17 @@ n=0 n=`expr $n + 1` echo_i "class list ($n)" $RRCHECKER -C > classlist.out -$DIFF classlist.out classlist.good || { echo_i "failed"; status=`expr $status + 1`; } +diff classlist.out classlist.good || { echo_i "failed"; status=`expr $status + 1`; } n=`expr $n + 1` echo_i "type list ($n)" $RRCHECKER -T > typelist.out -$DIFF typelist.out typelist.good || { echo_i "failed"; status=`expr $status + 1`; } +diff typelist.out typelist.good || { echo_i "failed"; status=`expr $status + 1`; } n=`expr $n + 1` echo_i "private type list ($n)" $RRCHECKER -P > privatelist.out -$DIFF privatelist.out privatelist.good || { echo_i "failed"; status=`expr $status + 1`; } +diff privatelist.out privatelist.good || { echo_i "failed"; status=`expr $status + 1`; } myecho() { cat << EOF diff --git a/bin/tests/system/rrl/tests.sh b/bin/tests/system/rrl/tests.sh index a5f4902a48..ff03a3176d 100644 --- a/bin/tests/system/rrl/tests.sh +++ b/bin/tests/system/rrl/tests.sh @@ -84,7 +84,6 @@ burst () { done ARGS="+burst +nocookie +continue +time=1 +tries=1 -p ${PORT} $* @$ns2 $DOMS" $MDIG $ARGS 2>&1 | \ - tr -d '\r' | \ tee -a full-$FILENAME | \ sed -n -e '/^;; AUTHORITY/,/^$/d' \ -e '/^;; ADDITIONAL/,/^$/d' \ @@ -152,7 +151,7 @@ ckstats () { LABEL="$1"; shift TYPE="$1"; shift EXPECTED="$1"; shift - C=`tr -d '\r' < ns2/named.stats | + C=`cat ns2/named.stats | sed -n -e "s/[ ]*\([0-9]*\).responses $TYPE for rate limits.*/\1/p" | tail -1` C=`expr 0$C + 0` @@ -284,7 +283,7 @@ sleep 2 grep "min-table-size 1" broken.out > /dev/null || setret "min-table-size 0 was not changed to 1" if [ -f named.pid ]; then - $KILL `cat named.pid` + kill `cat named.pid` setret "named should not have started, but did" fi diff --git a/bin/tests/system/rrsetorder/tests.sh b/bin/tests/system/rrsetorder/tests.sh index 153ad95e8b..24e63aba48 100644 --- a/bin/tests/system/rrsetorder/tests.sh +++ b/bin/tests/system/rrsetorder/tests.sh @@ -37,7 +37,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1 - $DIFF dig.out.fixed dig.out.fixed.good >/dev/null || ret=1 + diff dig.out.fixed dig.out.fixed.good >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -52,15 +52,15 @@ else if [ $i -le 4 ]; then cp dig.out.fixed dig.out.$j else - $DIFF dig.out.fixed dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.fixed dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done - $DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 - $DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 - $DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 - $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 - $DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 - $DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 + diff dig.out.0 dig.out.1 >/dev/null && ret=1 + diff dig.out.0 dig.out.2 >/dev/null && ret=1 + diff dig.out.0 dig.out.3 >/dev/null && ret=1 + diff dig.out.1 dig.out.2 >/dev/null && ret=1 + diff dig.out.1 dig.out.3 >/dev/null && ret=1 + diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -79,15 +79,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else - $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -105,15 +105,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else - $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -129,7 +129,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -154,7 +154,7 @@ done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do $DIGCMD @10.53.0.1 none.example > dig.out.test$i || ret=1 - $DIFF dig.out.none dig.out.test$i >/dev/null || ret=1 + diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -168,7 +168,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1 - $DIFF dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -187,15 +187,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else - $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -213,15 +213,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else - $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -238,7 +238,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -263,7 +263,7 @@ done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do $DIGCMD @10.53.0.2 none.example > dig.out.test$i || ret=1 - $DIFF dig.out.none dig.out.test$i >/dev/null || ret=1 + diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -293,7 +293,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1 - $DIFF dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -312,15 +312,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else - $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -338,15 +338,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else - $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -363,7 +363,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -388,7 +388,7 @@ done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do $DIGCMD @10.53.0.2 none.example > dig.out.test$i || ret=1 - $DIFF dig.out.none dig.out.test$i >/dev/null || ret=1 + diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -402,7 +402,7 @@ if $test_fixed; then for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do $DIGCMD @10.53.0.3 fixed.example > dig.out.fixed || ret=1 - $DIFF dig.out.fixed dig.out.fixed.good || ret=1 + diff dig.out.fixed dig.out.fixed.good || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -423,15 +423,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else - $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -451,15 +451,15 @@ do if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else - $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` + diff dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1` fi done -$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1 -$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1 -$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1 +diff dig.out.0 dig.out.1 >/dev/null && ret=1 +diff dig.out.0 dig.out.2 >/dev/null && ret=1 +diff dig.out.0 dig.out.3 >/dev/null && ret=1 +diff dig.out.1 dig.out.2 >/dev/null && ret=1 +diff dig.out.1 dig.out.3 >/dev/null && ret=1 +diff dig.out.2 dig.out.3 >/dev/null && ret=1 if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -476,7 +476,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -500,7 +500,7 @@ done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do $DIGCMD @10.53.0.3 none.example > dig.out.test$i || ret=1 - $DIFF dig.out.none dig.out.test$i >/dev/null || ret=1 + diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` @@ -517,7 +517,7 @@ do match=0 for j in $GOOD_RANDOM do - eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" + eval "diff dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1" if [ $match -eq 1 ]; then break; fi done if [ $match -eq 0 ]; then ret=1; fi @@ -542,7 +542,7 @@ done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do $DIGCMD @10.53.0.4 nomatch.example > dig.out.test$i || ret=1 - $DIFF dig.out.nomatch dig.out.test$i >/dev/null || ret=1 + diff dig.out.nomatch dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` diff --git a/bin/tests/system/rsabigexponent/ns1/sign.sh b/bin/tests/system/rsabigexponent/ns1/sign.sh index c35ec970be..703e4061eb 100755 --- a/bin/tests/system/rsabigexponent/ns1/sign.sh +++ b/bin/tests/system/rsabigexponent/ns1/sign.sh @@ -17,7 +17,7 @@ zone=. infile=root.db.in zonefile=root.db -cp ../ns2/dsset-example.in dsset-example$TP +cp ../ns2/dsset-example.in dsset-example. keyname=`$KEYGEN -q -a RSASHA1 -b 1024 -n zone $zone` diff --git a/bin/tests/system/run.sh.in b/bin/tests/system/run.sh.in index 057cd1f874..51399a79c5 100644 --- a/bin/tests/system/run.sh.in +++ b/bin/tests/system/run.sh.in @@ -74,7 +74,7 @@ if ! $do_run; then if [ "$baseport" -eq 0 ]; then log_flags="$log_flags -p 5300" fi - env - CYGWIN="$CYGWIN" SYSTEMTEST_FORCE_COLOR="$SYSTEMTEST_FORCE_COLOR" SYSTEMTEST_NO_CLEAN="$SYSTEMTEST_NO_CLEAN" SLOT="$SLOT" SOFTHSM2_CONF="$SOFTHSM2_CONF" PATH="$PATH" ${LD_LIBRARY_PATH:+"LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"} TESTS="$*" TEST_SUITE_LOG=run.log LOG_DRIVER_FLAGS="--verbose yes --color-tests yes" LOG_FLAGS="$log_flags" TEST_LARGE_MAP="${TEST_LARGE_MAP}" make -e check + env - SYSTEMTEST_FORCE_COLOR="$SYSTEMTEST_FORCE_COLOR" SYSTEMTEST_NO_CLEAN="$SYSTEMTEST_NO_CLEAN" SLOT="$SLOT" SOFTHSM2_CONF="$SOFTHSM2_CONF" PATH="$PATH" ${LD_LIBRARY_PATH:+"LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"} TESTS="$*" TEST_SUITE_LOG=run.log LOG_DRIVER_FLAGS="--verbose yes --color-tests yes" LOG_FLAGS="$log_flags" TEST_LARGE_MAP="${TEST_LARGE_MAP}" make -e check exit $? fi diff --git a/bin/tests/system/runall.sh b/bin/tests/system/runall.sh index 33c0bd6d81..a3bd54b26c 100755 --- a/bin/tests/system/runall.sh +++ b/bin/tests/system/runall.sh @@ -23,8 +23,6 @@ # # numprocess Number of concurrent processes to use when running the tests. # The default is one, which causes the tests to run sequentially. -# (This is ignored when running on Windows as the tests are always -# run sequentially on that platform.) . ./conf.sh @@ -72,19 +70,9 @@ export SYSTEMTEST_NO_CLEAN status=0 if [ "$NOPARALLEL" = "" ]; then - if [ "$CYGWIN" = "" ]; then - # Running on Unix, use "make" to run tests in parallel. - make -j "$numproc" check - status=$? - else - # Running on Windows: Cygwin "make" is available, but isn't being - # used for the build. So we create a special makefile for the purpose - # of parallel execution of system tests, and use that. - $SHELL parallel.sh > parallel.mk - make -f parallel.mk -j "$numproc" check - $SHELL ./runsequential.sh - $SHELL ./testsummary.sh || status=1 - fi + # use "make" to run tests in parallel. + make -j "$numproc" check + status=$? else # the NOPARALLEL environment variable indicates that tests must be # run sequentially. diff --git a/bin/tests/system/runtime/setup.sh b/bin/tests/system/runtime/setup.sh index 07b0c70f50..2bcfd0348b 100644 --- a/bin/tests/system/runtime/setup.sh +++ b/bin/tests/system/runtime/setup.sh @@ -26,10 +26,4 @@ copy_setports ns2/named-alt6.conf.in ns2/named-alt6.conf copy_setports ns2/named-alt7.conf.in ns2/named-alt7.conf mkdir ns2/nope - -if [ 1 = "${CYGWIN:-0}" ] -then - setfacl -s user::r-x,group::r-x,other::r-x ns2/nope -else - chmod 555 ns2/nope -fi +chmod 555 ns2/nope diff --git a/bin/tests/system/runtime/tests.sh b/bin/tests/system/runtime/tests.sh index 3e49c6d175..ddba6390e9 100644 --- a/bin/tests/system/runtime/tests.sh +++ b/bin/tests/system/runtime/tests.sh @@ -27,10 +27,10 @@ kill_named() { pid=$(cat "${pidfile}" 2>/dev/null) if [ "${pid:+set}" = "set" ]; then - $KILL -15 "${pid}" >/dev/null 2>&1 + kill -15 "${pid}" >/dev/null 2>&1 retries=10 while [ "$retries" -gt 0 ]; do - if ! $KILL -0 "${pid}" >/dev/null 2>&1; then + if ! kill -0 "${pid}" >/dev/null 2>&1; then break fi sleep 1 @@ -63,7 +63,7 @@ run_named() ( ) check_pid() ( - return $(! $KILL -0 "${1}" >/dev/null 2>&1) + return $(! kill -0 "${1}" >/dev/null 2>&1) ) status=0 @@ -85,7 +85,7 @@ testpid=$(run_named ns2 named$n.run -c named-alt2.conf -D runtime-ns2-extra-2 -X test -n "$testpid" || ret=1 retry_quiet 10 check_named_log "another named process" ns2/named$n.run || ret=1 test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1 -test -n "$testpid" && $KILL -15 $testpid > kill$n.out 2>&1 && ret=1 +test -n "$testpid" && kill -15 $testpid > kill$n.out 2>&1 && ret=1 test -n "$testpid" && retry_quiet 10 check_pid $testpid || ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -223,7 +223,7 @@ status=$((status+ret)) n=$((n+1)) echo_i "verifying that named switches UID ($n)" -if [ "$(id -u)" -eq 0 ] && [ -z "$CYGWIN" ]; then +if [ "$(id -u)" -eq 0 ]; then ret=0 TEMP_NAMED_DIR=$(mktemp -d "$(pwd)/ns2/tmp.XXXXXXXX") if [ "$?" -eq 0 ]; then diff --git a/bin/tests/system/sfcache/ns1/sign.sh b/bin/tests/system/sfcache/ns1/sign.sh index 4b8d6d6eec..a94ad582ab 100644 --- a/bin/tests/system/sfcache/ns1/sign.sh +++ b/bin/tests/system/sfcache/ns1/sign.sh @@ -22,7 +22,7 @@ zonefile=root.db (cd ../ns2 && $SHELL sign.sh ) -cp "../ns2/dsset-example$TP" . +cp "../ns2/dsset-example." . keyname=$($KEYGEN -q -a "${DEFAULT_ALGORITHM}" -b "${DEFAULT_BITS}" -n zone $zone) diff --git a/bin/tests/system/sortlist/tests.sh b/bin/tests/system/sortlist/tests.sh index 4d80456a81..4ff9dd3769 100644 --- a/bin/tests/system/sortlist/tests.sh +++ b/bin/tests/system/sortlist/tests.sh @@ -30,7 +30,7 @@ EOF $DIG $DIGOPTS a.example. @10.53.0.1 -b 10.53.0.1 >test1.dig # Note that this can't use digcomp.pl because here, the ordering of the # result RRs is significant. -$DIFF test1.dig test1.good || status=1 +diff test1.dig test1.good || status=1 echo_i "test 1-element sortlist statement and undocumented BIND 8 features" cat <test2.good diff --git a/bin/tests/system/staticstub/ns3/sign.sh b/bin/tests/system/staticstub/ns3/sign.sh index 993a06c965..36c865ea2c 100755 --- a/bin/tests/system/staticstub/ns3/sign.sh +++ b/bin/tests/system/staticstub/ns3/sign.sh @@ -19,7 +19,7 @@ zonefile=example.db (cd ../ns4 && $SHELL -e sign.sh ) -cp ../ns4/dsset-sub.example$TP . +cp ../ns4/dsset-sub.example. . keyname1=`$KEYGEN -q -a RSASHA256 -b 1024 -n zone $zone` keyname2=`$KEYGEN -q -a RSASHA256 -b 2048 -f KSK -n zone $zone` diff --git a/bin/tests/system/statistics/tests.sh b/bin/tests/system/statistics/tests.sh index a111f5432d..4d36120dfd 100644 --- a/bin/tests/system/statistics/tests.sh +++ b/bin/tests/system/statistics/tests.sh @@ -78,10 +78,8 @@ n=`expr $n + 1` ret=0 echo_i "dumping initial stats for ns3 ($n)" rndc_stats ns3 10.53.0.3 || ret=1 -if [ ! "$CYGWIN" ]; then - nsock0nstat=`grep "UDP/IPv4 sockets active" $last_stats | awk '{print $1}'` - [ 0 -ne ${nsock0nstat:-0} ] || ret=1 -fi +nsock0nstat=`grep "UDP/IPv4 sockets active" $last_stats | awk '{print $1}'` +[ 0 -ne ${nsock0nstat:-0} ] || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` @@ -114,15 +112,13 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` -if [ ! "$CYGWIN" ]; then - ret=0 - echo_i "verifying active sockets output in named.stats ($n)" - nsock1nstat=`grep "UDP/IPv4 sockets active" $last_stats | awk '{print $1}'` - [ `expr ${nsock1nstat:-0} - ${nsock0nstat:-0}` -eq 1 ] || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - n=`expr $n + 1` -fi +ret=0 +echo_i "verifying active sockets output in named.stats ($n)" +nsock1nstat=`grep "UDP/IPv4 sockets active" $last_stats | awk '{print $1}'` +[ `expr ${nsock1nstat:-0} - ${nsock0nstat:-0}` -eq 1 ] || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` +n=`expr $n + 1` # there should be 1 UDP and no TCP queries. As the TCP counter is zero # no status line is emitted. @@ -183,7 +179,7 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; th -o curl.out.${n}.xsl http://10.53.0.3:${EXTRAPORT1}/bind9.xsl 2>/dev/null || ret=1 time2=$($PERL -e 'print time(), "\n";') test $((time2 - time1)) -lt 5 || ret=1 - ${DIFF} ${TOP_SRCDIR}/bin/named/bind9.xsl curl.out.${n}.xsl || ret=1 + diff ${TOP_SRCDIR}/bin/named/bind9.xsl curl.out.${n}.xsl || ret=1 ${XSLTPROC} curl.out.${n}.xsl - < curl.out.${n}.xml > xsltproc.out.${n} 2>/dev/null || ret=1 cp curl.out.${n}.xml stats.xml.out || ret=1 diff --git a/bin/tests/system/stop.pl b/bin/tests/system/stop.pl index 57cb752343..bd4423b60b 100644 --- a/bin/tests/system/stop.pl +++ b/bin/tests/system/stop.pl @@ -134,8 +134,6 @@ exit($errors); sub server_lock_file { my ( $server ) = @_; - return if (defined($ENV{'CYGWIN'}) && $ENV{'CYGWIN'}); - return $testdir . "/" . $server . "/named.lock" if ($server =~ /^ns/); return if ($server =~ /^ans/); @@ -253,12 +251,8 @@ sub pid_file_exists { # If we're here, the PID file hasn't been cleaned up yet if (send_signal(0, $pid) == 0) { - # XXX: on windows this is likely to result in a - # false positive, so don't bother reporting the error. - if (!defined($ENV{'CYGWIN'}) || !$ENV{'CYGWIN'}) { - print "I:$test:$server crashed on shutdown\n"; - $errors = 1; - } + print "I:$test:$server crashed on shutdown\n"; + $errors = 1; return; } diff --git a/bin/tests/system/unknown/tests.sh b/bin/tests/system/unknown/tests.sh index 6af380a27b..06b7a83f56 100644 --- a/bin/tests/system/unknown/tests.sh +++ b/bin/tests/system/unknown/tests.sh @@ -24,7 +24,7 @@ for i in 1 2 3 4 5 6 7 8 9 10 11 12 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 a$i.example a in > dig.out.$i.test$n || ret=1 - echo 10.0.0.1 | $DIFF - dig.out.$i.test$n || ret=1 + echo 10.0.0.1 | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -38,7 +38,7 @@ for i in 1 2 3 4 5 6 7 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 txt$i.example txt in > dig.out.$i.test$n || ret=1 - echo '"hello"' | $DIFF - dig.out.$i.test$n || ret=1 + echo '"hello"' | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -52,7 +52,7 @@ for i in 1 2 3 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 unk$i.example type123 in > dig.out.$i.test$n || ret=1 - echo '\# 1 00' | $DIFF - dig.out.$i.test$n || ret=1 + echo '\# 1 00' | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -64,7 +64,7 @@ n=$((n+1)) echo_i "querying for NULL record ($n)" ret=0 $DIG +short $DIGOPTS @10.53.0.1 null.example null in > dig.out.test$n || ret=1 -echo '\# 1 00' | $DIFF - dig.out.test$n || ret=1 +echo '\# 1 00' | diff - dig.out.test$n || ret=1 [ $ret = 0 ] || echo_i "failed" status=`expr $status + $ret` @@ -72,7 +72,7 @@ n=$((n+1)) echo_i "querying for empty NULL record ($n)" ret=0 $DIG +short $DIGOPTS @10.53.0.1 empty.example null in > dig.out.test$n || ret=1 -echo '\# 0' | $DIFF - dig.out.test$n || ret=1 +echo '\# 0' | diff - dig.out.test$n || ret=1 [ $ret = 0 ] || echo_i "failed" status=`expr $status + $ret` @@ -82,7 +82,7 @@ for i in 1 2 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 a$i.example a class10 > dig.out.$i.test$n || ret=1 - echo '\# 4 0A000001' | $DIFF - dig.out.$i.test$n || ret=1 + echo '\# 4 0A000001' | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -96,7 +96,7 @@ for i in 1 2 3 4 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 txt$i.example txt class10 > dig.out.$i.test$n || ret=1 - echo '"hello"' | $DIFF - dig.out.$i.test$n || ret=1 + echo '"hello"' | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -110,7 +110,7 @@ for i in 1 2 do ret=0 $DIG +short $DIGOPTS @10.53.0.1 unk$i.example type123 class10 > dig.out.$i.test$n || ret=1 - echo '\# 1 00' | $DIFF - dig.out.$i.test$n || ret=1 + echo '\# 1 00' | diff - dig.out.$i.test$n || ret=1 if [ $ret != 0 ] then echo_i "#$i failed" @@ -137,7 +137,7 @@ echo_i "checking large unknown record loading on primary ($n)" for try in 0 1 2 3 4 5 6 7 8 9; do ret=0 $DIG $DIGOPTS @10.53.0.1 +tcp +short large.example TYPE45234 > dig.out.$i.test$n || { ret=1 ; echo_i "dig failed" ; } - $DIFF -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "$DIFF failed"; } + diff -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; } [ "$ret" -eq 0 ] && break sleep 1 done @@ -149,7 +149,7 @@ echo_i "checking large unknown record loading on secondary ($n)" for try in 0 1 2 3 4 5 6 7 8 9; do ret=0 $DIG $DIGOPTS @10.53.0.2 +tcp +short large.example TYPE45234 > dig.out.$i.test$n || { ret=1 ; echo_i "dig failed" ; } - $DIFF -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "$DIFF failed"; } + diff -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; } [ "$ret" -eq 0 ] && break sleep 1 done @@ -167,7 +167,7 @@ echo_i "checking large unknown record loading on secondary ($n)" for try in 0 1 2 3 4 5 6 7 8 9; do ret=0 $DIG $DIGOPTS @10.53.0.2 +tcp +short large.example TYPE45234 > dig.out.$i.test$n || { ret=1 ; echo_i "dig failed" ; } - $DIFF -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "$DIFF failed"; } + diff -s large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; } [ "$ret" -eq 0 ] && break sleep 1 done @@ -178,7 +178,7 @@ n=$((n+1)) echo_i "checking large unknown record loading on inline secondary ($n)" ret=0 $DIG $DIGOPTS @10.53.0.3 +tcp +short large.example TYPE45234 > dig.out.test$n || { ret=1 ; echo_i "dig failed" ; } -$DIFF large.out dig.out.test$n > /dev/null || { ret=1 ; echo_i "$DIFF failed"; } +diff large.out dig.out.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; } [ $ret = 0 ] || echo_i "failed" status=`expr $status + $ret` @@ -193,7 +193,7 @@ echo_i "checking large unknown record loading on inline secondary ($n)" for try in 0 1 2 3 4 5 6 7 8 9; do ret=0 $DIG $DIGOPTS @10.53.0.3 +tcp +short large.example TYPE45234 > dig.out.$i.test$n || { ret=1 ; echo_i "dig failed" ; } - $DIFF large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "$DIFF failed"; } + diff large.out dig.out.$i.test$n > /dev/null || { ret=1 ; echo_i "diff failed"; } [ "$ret" -eq 0 ] && break sleep 1 done @@ -204,7 +204,7 @@ n=$((n+1)) echo_i "check that '"'"\\#"'"' is not treated as the unknown escape sequence ($n)" ret=0 $DIG $DIGOPTS @10.53.0.1 +tcp +short txt8.example txt > dig.out.test$n -echo '"#" "2" "0145"' | $DIFF - dig.out.test$n || ret=1 +echo '"#" "2" "0145"' | diff - dig.out.test$n || ret=1 [ $ret = 0 ] || echo_i "failed" status=`expr $status + $ret` @@ -212,7 +212,7 @@ n=$((n+1)) echo_i "check that 'TXT \# text' is not treated as the unknown escape sequence ($n)" ret=0 $DIG $DIGOPTS @10.53.0.1 +tcp +short txt9.example txt > dig.out.test$n -echo '"#" "text"' | $DIFF - dig.out.test$n || ret=1 +echo '"#" "text"' | diff - dig.out.test$n || ret=1 [ $ret = 0 ] || echo_i "failed" status=`expr $status + $ret` diff --git a/bin/tests/system/wildcard/ns1/sign.sh b/bin/tests/system/wildcard/ns1/sign.sh index 749d9c4dd5..5743e4f7ba 100755 --- a/bin/tests/system/wildcard/ns1/sign.sh +++ b/bin/tests/system/wildcard/ns1/sign.sh @@ -25,7 +25,7 @@ zone=nsec infile=nsec.db.in zonefile=nsec.db outfile=nsec.db.signed -dssets="$dssets dsset-${zone}${TP}" +dssets="$dssets dsset-${zone}." keyname1=`$KEYGEN -a RSASHA1 -b 1024 -n zone $zone 2> /dev/null` keyname2=`$KEYGEN -f KSK -a RSASHA1 -b 1024 -n zone $zone 2> /dev/null` @@ -54,7 +54,7 @@ zone=nsec3 infile=nsec3.db.in zonefile=nsec3.db outfile=nsec3.db.signed -dssets="$dssets dsset-${zone}${TP}" +dssets="$dssets dsset-${zone}." keyname1=`$KEYGEN -a NSEC3RSASHA1 -b 1024 -n zone $zone 2> /dev/null` keyname2=`$KEYGEN -f KSK -a NSEC3RSASHA1 -b 1024 -n zone $zone 2> /dev/null` diff --git a/bin/tests/system/xfer/tests.sh b/bin/tests/system/xfer/tests.sh index f06e924bfe..9c6fcba974 100755 --- a/bin/tests/system/xfer/tests.sh +++ b/bin/tests/system/xfer/tests.sh @@ -467,8 +467,6 @@ echo_i "test smaller transfer TCP message size ($n)" $DIG $DIGOPTS example. @10.53.0.8 axfr \ -y key1.:1234abcd8765 > dig.out.msgsize.test$n || status=1 -$DOS2UNIX dig.out.msgsize.test$n >/dev/null 2>&1 - bytes=`wc -c < dig.out.msgsize.test$n` if [ $bytes -ne 459357 ]; then echo_i "failed axfr size check" diff --git a/bin/tests/system/xferquota/tests.sh b/bin/tests/system/xferquota/tests.sh index e9a80c7082..e0869aff90 100755 --- a/bin/tests/system/xferquota/tests.sh +++ b/bin/tests/system/xferquota/tests.sh @@ -26,11 +26,7 @@ while [ $count != 300 ]; do if [ $ticks = 1 ]; then echo_i "Changing test zone..." cp -f ns1/changing2.db ns1/changing.db - if [ ! "$CYGWIN" ]; then - $KILL -HUP `cat ns1/named.pid` - else - rndc_reload ns1 10.53.0.1 - fi + kill -HUP `cat ns1/named.pid` fi sleep 1 ticks=`expr $ticks + 1`