[rt46602] Changes to get tests running on Windows

1. Track changes to conf.sh.in in conf.sh.win32
2. Modifications to prevent Windows "Configure" script replacing
   the sed "@PORT@" substitution tokens in conf.sh.win32.
3. runall.sh now runs Windows tests sequentially

(cherry picked from commit 7bb9a97904)
This commit is contained in:
Stephen Morris
2018-01-26 19:42:57 +00:00
parent a9e25e9686
commit 1d1b37d838
2 changed files with 117 additions and 58 deletions

View File

@@ -23,42 +23,42 @@ TOP=`cd $TOP && pwd`
# Visual Studio build configurations are Release and Debug
VSCONF=Debug
NAMED=$TOP/Build/$VSCONF/named@EXEEXT@
DIG=$TOP/Build/$VSCONF/dig@EXEEXT@
DELV=$TOP/Build/$VSCONF/delv@EXEEXT@
RNDC=$TOP/Build/$VSCONF/rndc@EXEEXT@
NSUPDATE=$TOP/Build/$VSCONF/nsupdate@EXEEXT@
DDNSCONFGEN=$TOP/Build/$VSCONF/ddns-confgen@EXEEXT@
TSIGKEYGEN=$TOP/Build/$VSCONF/tsig-keygen@EXEEXT@
RNDCCONFGEN=$TOP/Build/$VSCONF/rndc-confgen@EXEEXT@
KEYGEN=$TOP/Build/$VSCONF/dnssec-keygen@EXEEXT@
KEYFRLAB=$TOP/Build/$VSCONF/dnssec-keyfromlabel@EXEEXT@
SIGNER=$TOP/Build/$VSCONF/dnssec-signzone@EXEEXT@
REVOKE=$TOP/Build/$VSCONF/dnssec-revoke@EXEEXT@
SETTIME=$TOP/Build/$VSCONF/dnssec-settime@EXEEXT@
DSFROMKEY=$TOP/Build/$VSCONF/dnssec-dsfromkey@EXEEXT@
IMPORTKEY=$TOP/Build/$VSCONF/dnssec-importkey@EXEEXT@
CHECKDS="$PYTHON `cygpath -w $TOP/bin/python/dnssec-checkds.py`"
COVERAGE="$PYTHON `cygpath -w $TOP/bin/python/dnssec-coverage.py`"
KEYMGR="$PYTHON `cygpath -w $TOP/bin/python/dnssec-keymgr.py`"
CHECKZONE=$TOP/Build/$VSCONF/named-checkzone@EXEEXT@
ARPANAME=$TOP/Build/$VSCONF/arpaname@EXEEXT@
CHECKCONF=$TOP/Build/$VSCONF/named-checkconf@EXEEXT@
CHECKDS="$PYTHON `cygpath -w $TOP/bin/python/dnssec-checkds.py`"
CHECKZONE=$TOP/Build/$VSCONF/named-checkzone@EXEEXT@
COVERAGE="$PYTHON `cygpath -w $TOP/bin/python/dnssec-coverage.py`"
DDNSCONFGEN=$TOP/Build/$VSCONF/ddns-confgen@EXEEXT@
DELV=$TOP/Build/$VSCONF/delv@EXEEXT@
DIG=$TOP/Build/$VSCONF/dig@EXEEXT@
DNSTAPREAD=$TOP/Build/$VSCONF/dnstap-read@EXEEXT@
DSFROMKEY=$TOP/Build/$VSCONF/dnssec-dsfromkey@EXEEXT@
FEATURETEST=$TOP/Build/$VSCONF/feature-test@EXEEXT@
FSTRM_CAPTURE=@FSTRM_CAPTURE@
GENRANDOM=$TOP/Build/$VSCONF/genrandom@EXEEXT@
IMPORTKEY=$TOP/Build/$VSCONF/dnssec-importkey@EXEEXT@
JOURNALPRINT=$TOP/Build/$VSCONF/named-journalprint@EXEEXT@
KEYFRLAB=$TOP/Build/$VSCONF/dnssec-keyfromlabel@EXEEXT@
KEYGEN=$TOP/Build/$VSCONF/dnssec-keygen@EXEEXT@
KEYMGR="$PYTHON `cygpath -w $TOP/bin/python/dnssec-keymgr.py`"
MDIG=$TOP/Build/$VSCONF/mdig@EXEEXT@
NAMED=$TOP/Build/$VSCONF/named@EXEEXT@
NSLOOKUP=$TOP/Build/$VSCONF/nslookup@EXEEXT@
NSUPDATE=$TOP/Build/$VSCONF/nsupdate@EXEEXT@
NZD2NZF=$TOP/Build/$VSCONF/named-nzd2nzf@EXEEXT@
PK11DEL="$TOP/Build/$VSCONF/pkcs11-destroy@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0"
PK11GEN="$TOP/Build/$VSCONF/pkcs11-keygen@EXEEXT@ -q -s ${SLOT:-0} -p ${HSMPIN:-1234}"
PK11LIST="$TOP/Build/$VSCONF/pkcs11-list@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234}"
PK11DEL="$TOP/Build/$VSCONF/pkcs11-destroy@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0"
JOURNALPRINT=$TOP/Build/$VSCONF/named-journalprint@EXEEXT@
VERIFY=$TOP/Build/$VSCONF/dnssec-verify@EXEEXT@
ARPANAME=$TOP/Build/$VSCONF/arpaname@EXEEXT@
RESOLVE=$TOP/lib/samples/resolve
REVOKE=$TOP/Build/$VSCONF/dnssec-revoke@EXEEXT@
RNDC=$TOP/Build/$VSCONF/rndc@EXEEXT@
RNDCCONFGEN=$TOP/Build/$VSCONF/rndc-confgen@EXEEXT@
RRCHECKER=$TOP/Build/$VSCONF/named-rrchecker@EXEEXT@
GENRANDOM=$TOP/Build/$VSCONF/genrandom@EXEEXT@
NSLOOKUP=$TOP/Build/$VSCONF/nslookup@EXEEXT@
DNSTAPREAD=$TOP/Build/$VSCONF/dnstap-read@EXEEXT@
MDIG=$TOP/Build/$VSCONF/mdig@EXEEXT@
NZD2NZF=$TOP/Build/$VSCONF/named-nzd2nzf@EXEEXT@
FSTRM_CAPTURE=@FSTRM_CAPTURE@
FEATURETEST=$TOP/Build/$VSCONF/feature-test@EXEEXT@
SAMPLEUPDATE=$TOP/Build/$VSCONF/update@EXEEXT@
SETTIME=$TOP/Build/$VSCONF/dnssec-settime@EXEEXT@
SIGNER=$TOP/Build/$VSCONF/dnssec-signzone@EXEEXT@
TSIGKEYGEN=$TOP/Build/$VSCONF/tsig-keygen@EXEEXT@
VERIFY=$TOP/Build/$VSCONF/dnssec-verify@EXEEXT@
# to port WIRETEST=$TOP/Build/$VSCONF/wire_test@EXEEXT@
@@ -82,27 +82,27 @@ KRB5_CONFIG=NUL
#
# List of tests that use ports 5300 and 9953. For this reason, these must
# be run sequentially.
SEQUENTIALDIRS="acl additional addzone autosign builtin
cacheclean case catz
checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@
database digdelv dlv dlvauto dlz dlzexternal dname
dns64 dnssec @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa
ednscompliance emptyzones
fetchlimit filter-aaaa formerr forward geoip glue gost inline ixfr
keepalive @KEYMGR@ legacy limits logfileconfig masterfile
masterformat metadata mkeys names notify nslookup nsupdate
nzd2nzf padding pending pipelined @PKCS11_TEST@ reclimit
redirect resolver rndc rpz rrchecker rrl
rrsetorder rsabigexponent runtime sfcache smartsign sortlist
spf staticstub statistics statschannel stub tcp tkey tsig
tsiggss unknown upforwd verify views wildcard xfer xferquota
SEQUENTIALDIRS="acl additional addzone autosign builtin \
cacheclean case \
checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@ \
database digdelv dlv dlvauto dlz dlzexternal dname \
dns64 dnssec @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa \
ednscompliance emptyzones \
fetchlimit filter-aaaa formerr forward geoip glue gost inline ixfr \
keepalive @KEYMGR@ legacy limits logfileconfig masterfile \
masterformat metadata mkeys names notify nslookup nsupdate \
nzd2nzf padding pending pipelined @PKCS11_TEST@ reclimit \
redirect resolver rndc rpz rrchecker rrl \
rrsetorder rsabigexponent runtime sfcache smartsign sortlist \
spf staticstub statistics statschannel stub tcp tkey tsig \
tsiggss unknown upforwd verify views wildcard xfer xferquota \
zero zonechecks"
# List of tests that use unique ports (other than 5300 and 9953). These
# tests can be run in parallel.
#
# This symbol must be kept in step with the PARALLEL macro in Makefile.in
PARALLELDIRS="allow_query rpzrecurse serve-stale"
PARALLELDIRS="allow_query catz rpzrecurse serve-stale"
SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
@@ -163,40 +163,49 @@ NZD=@NZD_TOOLS@
# Set up color-coded test output
#
if test -t 1 && type tput > /dev/null; then
COLOR_END=`tput setaf 4` # blue
COLOR_FAIL=`tput setaf 1` # red
COLOR_WARN=`tput setaf 3` # yellow
COLOR_PASS=`tput setaf 2` # green
COLOR_INFO=`tput bold` # bold
COLOR_NONE=`tput sgr0`
COLOR_PASS=`tput setaf 2` # green
COLOR_START=`tput setaf 4` # blue
COLOR_WARN=`tput setaf 3` # yellow
else
# set to empty strings so printf succeeds
COLOR_END=''
COLOR_FAIL=''
COLOR_WARN=''
COLOR_PASS=''
COLOR_INFO=''
COLOR_NONE=''
COLOR_PASS=''
COLOR_START=''
COLOR_WARN=''
fi
echofail () {
printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*"
}
echowarn () {
printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*"
}
echopass () {
printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*"
}
echoinfo () {
printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*"
}
echostart () {
printf "${COLOR_START}%s${COLOR_NONE}\n" "$*"
}
echoend () {
printf "${COLOR_END}%s${COLOR_NONE}\n" "$*"
}
TESTNAME="`basename $PWD`"
echo_i() {
echoinfo "I:$TESTNAME:$@"
echo "$@" | while read LINE ; do
echoinfo "I:$TESTNAME:$LINE"
done
}
#
@@ -212,6 +221,35 @@ nextpart () {
END { print NR > "/dev/stderr" }' $1 2> $1.prev
}
# copy_setports - Copy Configuration File and Replace Ports
#
# Convenience function to copy a configuration file, replacing the tokens
# QUERYPORT, CONTROLPORT and EXTRAPORT[1-8] with the values of the equivalent
# environment variables. (These values are set by "run.sh", which calls the
# scripts invoking this function.)
#
# Usage:
# copy_setports infile outfile
copy_setports() {
# The indirect method of handling the substitution of the PORT variables
# (defining "atsign" then substituting for it in the "sed" statement) is
# required because to prevent the "Configure" script (in the the
# bin9/win32utils directory) replacing the the <at>PORT<at> substitution
# tokens when it processes this file and produces conf.sh.
atsign="@"
sed -e "s/${atsign}PORT${atsign}/${PORT}/g" \
-e "s/${atsign}EXTRAPORT1${atsign}/${EXTRAPORT1}/g" \
-e "s/${atsign}EXTRAPORT2${atsign}/${EXTRAPORT2}/g" \
-e "s/${atsign}EXTRAPORT3${atsign}/${EXTRAPORT3}/g" \
-e "s/${atsign}EXTRAPORT4${atsign}/${EXTRAPORT4}/g" \
-e "s/${atsign}EXTRAPORT5${atsign}/${EXTRAPORT5}/g" \
-e "s/${atsign}EXTRAPORT6${atsign}/${EXTRAPORT6}/g" \
-e "s/${atsign}EXTRAPORT7${atsign}/${EXTRAPORT7}/g" \
-e "s/${atsign}EXTRAPORT8${atsign}/${EXTRAPORT8}/g" \
-e "s/${atsign}CONTROLPORT${atsign}/${CONTROLPORT}/g" $1 > $2
}
#
# Export command paths
#

View File

@@ -16,21 +16,27 @@
#
# 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.)
SYSTEMTESTTOP=.
. $SYSTEMTESTTOP/conf.sh
usage="Usage: ./runall.sh [-n] [numprocesses]"
NOCLEAN=""
# Handle "-n" switch if present.
NOCLEAN=""
while getopts "n" flag; do
case "$flag" in
n) NOCLEAN="-n" ;;
n) NOCLEAN="-n" ;;
esac
done
export NOCLEAN
shift `expr $OPTIND - 1`
# Obtain number of processes to use.
if [ $# -eq 0 ]; then
numproc=1
elif [ $# -eq 1 ]; then
@@ -46,7 +52,22 @@ else
exit 1
fi
export NOCLEAN
make -j $numproc check
# Run the tests.
exit $?
status=0
if [ "$CYGWIN" = "" ]; then
# Running on Unix, use "make" to run tests in parallel.
make -j $numproc check
status=$?
else
# Running on Windows: no "make" available, so run the tests sequentially.
# (This is simpler than working out where "nmake" is likely to be found.
# Besides, "nmake" does not support parallel execution so if "nmake" is
# used, the tests would be run sequentially anyway.)
{
for testdir in $SUBDIRS; do
$SHELL run.sh $NOCLEAN $testdir || status=1
done
} 2>&1 | tee "systests.output"
fi
exit $status