]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[rt46602] Adjust rpzrecurse for dynamic port usage
authorOndřej Surý <ondrej@sury.org>
Wed, 18 Oct 2017 12:56:26 +0000 (14:56 +0200)
committerEvan Hunt <each@isc.org>
Sun, 25 Feb 2018 17:20:58 +0000 (09:20 -0800)
Resolve conflict in run.sh during cherry-pick from an experimental branch.

(cherry picked from commit 2a435708e4a99651a800a01f4f990459d4144414)
(cherry picked from commit c5aa6ed87bb879192f36a1fc2700921d51554ed6)
(cherry picked from commit 9bdb4d67f1fd388729352f39a60e63368440ff94)

bin/tests/system/Makefile.in
bin/tests/system/getopts.sh
bin/tests/system/run.sh

index 1a7aaa50d93009b697c18a98a133b44032a51327..4e95e20e602afe5ce1a8a160a5e0d06395270040 100644 (file)
@@ -52,16 +52,14 @@ feature-test@EXEEXT@: feature-test.@O@
 
 check: test
 
-TESTS = allow_query serve-stale
+TESTS = allow_query serve-stale rpzrecurse
 
 test: subdirs $(TESTS)
        if test -f ./runall.sh; then $(SHELL) ./runall.sh; fi
 
-serve-stale:
-       $(SHELL) ./run.sh -p 5304 -c 9954 $@
-
-allow_query:
-       $(SHELL) ./run.sh -p 5305 -c 9955 $@
+$(TESTS):
+       PORT=$$((32767+$$RANDOM)); \
+       $(SHELL) ./run.sh -p $$(($$PORT)) -c $$(($$PORT+1)) $@
 
 testclean clean distclean::
        if test -f ./cleanall.sh; then sh ./cleanall.sh; fi
index cd8d5b0e14394c6b8d44bcb2061e5a49fe55f29b..af61ae281b6bed2f9d3a1c96e9f90a8e201e1345 100644 (file)
@@ -10,7 +10,7 @@
 port=5300
 controlport=9953
 
-while getopts "p:c:" flag; do
+while getopts ":p:c:" flag; do
     case "$flag" in
        p) port=$OPTARG ;;
        c) controlport=$OPTARG ;;
@@ -19,5 +19,6 @@ while getopts "p:c:" flag; do
     esac
 done
 shift $(($OPTIND - 1))
+OPTIND=1
 
 SEDPORTS="sed -e s/@PORT@/${port}/g -e s/@CONTROLPORT@/${controlport}/g"
index 2306810c35e4c2c2c2d9e49f77e74d4436ced4d2..d3985266952f57cd9f313ec1b0ce09ae1da2ceda 100644 (file)
@@ -47,9 +47,6 @@ if [ "$((${controlport}+0))" -ne "${controlport}" ] || [ "${controlport}" -le 10
     echo "Specified control port '$controlport' must be numeric (1024,65535>" >&2; exit 1;
 fi
 
-echo "PORT: ${port}"
-echo "CONTROLPORT: ${controlport}"
-
 shift $(($OPTIND - 1))
 
 test $# -gt 0 || { echo "usage: $0 [-k|-n|-p <PORT>] test-directory" >&2; exit 1; }
@@ -57,11 +54,13 @@ test $# -gt 0 || { echo "usage: $0 [-k|-n|-p <PORT>] test-directory" >&2; exit 1
 test=$1
 shift
 
-test -d $test || { echo "$0: $test: no such test" >&2; exit 1; }
+test -d $test || { echofail "$0: $test: no such test" >&2; exit 1; }
 
 echoinfo "S:$test:`date $dateargs`" >&2
 echoinfo "T:$test:1:A" >&2
-echoinfo "A:System test $test" >&2
+echoinfo "A:$test:System test $test" >&2
+echoinfo "I:$test:PORT:${port}" >&2
+echoinfo "I:$test:CONTROLPORT:${controlport}" >&2
 
 if [ x${PERL:+set} = x ]
 then
@@ -72,7 +71,7 @@ then
 fi
 
 # Check for test-specific prerequisites.
-test ! -f $test/prereq.sh || ( cd $test && $SHELL prereq.sh -c "$controlport" -p "$port" "$@" )
+test ! -f $test/prereq.sh || ( cd $test && $SHELL prereq.sh -c "$controlport" -p "$port" -- "$@" )
 result=$?
 
 if [ $result -eq 0 ]; then
@@ -107,14 +106,14 @@ fi
 # Set up any dynamically generated test data
 if test -f $test/setup.sh
 then
-   ( cd $test && $SHELL setup.sh -c "$controlport" -p "$port" "$@" )
+   ( cd $test && $SHELL setup.sh -c "$controlport" -p "$port" -- "$@" )
 fi
 
 # Start name servers running
-$PERL start.pl -p $port $test || { echofail "R:$test:$FAIL"; echoinfo "E:$test:`date $dateargs`"; exit 1; }
+$PERL start.pl -p $port $test || { echofail "R:$test:FAIL"; echoinfo "E:$test:`date $dateargs`"; exit 1; }
 
 # Run the tests
-( cd $test ; $SHELL tests.sh -c "$controlport" -p "$port" "$@" )
+( cd $test ; $SHELL tests.sh -c "$controlport" -p "$port" -- "$@" )
 
 status=$?
 
@@ -141,7 +140,7 @@ else
         rm -f $SYSTEMTESTTOP/random.data
         if test -f $test/clean.sh
         then
-                       ( cd $test && $SHELL clean.sh "-p" "$port" "$@" )
+                       ( cd $test && $SHELL clean.sh "-p" "$port" -- "$@" )
         fi
         if test -d ../../../.git
         then