]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
don't use $() in system tests
authorEvan Hunt <each@isc.org>
Tue, 11 Sep 2018 17:59:09 +0000 (10:59 -0700)
committerEvan Hunt <each@isc.org>
Tue, 11 Sep 2018 20:03:34 +0000 (13:03 -0700)
(cherry picked from commit bf9c60078a8c65e5de3dddc39762d30c49f86577)

bin/tests/system/cds/setup.sh
bin/tests/system/rrsetorder/tests.sh
doc/dev/style.md

index 5c26dcac3dc7a9ef698ac0d53803afd59465f173..2134d8b01a4e6b39fdd7e0dc9f02cd553fc0ae46 100644 (file)
@@ -22,13 +22,13 @@ touch empty
 
 Z=cds.test
 
-keyz=$($KEYGEN -q -r $RANDFILE -a RSASHA256 $Z)
-key1=$($KEYGEN -q -r $RANDFILE -a RSASHA256 -f KSK $Z)
-key2=$($KEYGEN -q -r $RANDFILE -a RSASHA256 -f KSK $Z)
+keyz=`$KEYGEN -q -r $RANDFILE -a RSASHA256 $Z`
+key1=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -f KSK $Z`
+key2=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -f KSK $Z`
 
-idz=$(echo $keyz | sed 's/.*+0*//')
-id1=$(echo $key1 | sed 's/.*+0*//')
-id2=$(echo $key2 | sed 's/.*+0*//')
+idz=`echo $keyz | sed 's/.*+0*//'`
+id1=`echo $key1 | sed 's/.*+0*//'`
+id2=`echo $key2 | sed 's/.*+0*//'`
 
 cat <<EOF >vars.sh
 Z=$Z
@@ -122,10 +122,11 @@ $mangle '\s+IN\s+RRSIG\s+CDS .* '$id1' '$Z'\. ' \
 $mangle " IN CDS $id1 8 1 " <db.cds.1 |
 sign cds-mangled
 
-sed 's/IN CDS '$id1' 8 1 /IN CDS '$((id1 ^ 255))' 8 1 /' <db.cds.1 |
+bad=`$PERL -le "print ($id1 ^ 255);"`
+sed 's/IN CDS '$id1' 8 1 /IN CDS '$bad' 8 1 /' <db.cds.1 |
 sign bad-digests
 
-sed '/IN CDS '$id1' 8 /p;s//IN CDS '$((id1 ^ 255))' 13 /' <db.cds.1 |
+sed '/IN CDS '$id1' 8 /p;s//IN CDS '$bad' 13 /' <db.cds.1 |
 sign bad-algos
 
 rm -f dsset-*
index 99d2632031aed156742192337a980a5a4ee0f027..7755a87e5e1674e49953252b6ee153d3288e3977 100644 (file)
@@ -17,7 +17,7 @@ DIGCMD="$DIG $DIGOPTS -p ${PORT}"
 
 status=0
 
-GOOD_RANDOM="$(seq 1 24)"
+GOOD_RANDOM="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"
 GOOD_RANDOM_NO=24
 
 if grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
@@ -139,7 +139,7 @@ do
        eval "match=\`expr \$match + \$match$i\`"
 done
 echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
-if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
+if [ $match -lt `expr ${GOOD_RANDOM_NO} / 3` ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -233,7 +233,7 @@ do
 eval "match=\`expr \$match + \$match$i\`"
 done
 echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
-if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
+if [ $match -lt `expr ${GOOD_RANDOM_NO} / 3` ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -343,7 +343,7 @@ do
 eval "match=\`expr \$match + \$match$i\`"
 done
 echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
-if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
+if [ $match -lt `expr ${GOOD_RANDOM_NO} / 3` ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
@@ -441,7 +441,7 @@ do
 eval "match=\`expr \$match + \$match$i\`"
 done
 echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
-if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
+if [ $match -lt `expr ${GOOD_RANDOM_NO} / 3` ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 
 echo_i "Checking default order (cache)"
@@ -467,7 +467,7 @@ do
 eval "match=\`expr \$match + \$match$i\`"
 done
 echo_i "Default selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
-if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
+if [ $match -lt `expr ${GOOD_RANDOM_NO} / 3` ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 
 echo_i "Checking default order no match in rrset-order (no shuffling)"
index 33b5172f4d06518b4c9bf7277486b24043061fa2..97128fda5e1f8d92dd6f6ec8b43823e6ea1aea59 100644 (file)
@@ -749,7 +749,7 @@ Bash should be avoided.  Some pitfalls to avoid:
   `$(parentheses)`
 * For arithmetical computation, use `` `expr {expression}` ``, not
   `$((expression))`
-* To text string length use `` `expr $string : ".*"` `` rather than ``
+* To test string length use `` `expr $string : ".*"` `` rather than ``
   `expr length $string` ``
 * To test for the presence of a string in a file without printing anything
   to stdout, use `"grep string filename > /dev/null 2>&1"`, rather than