From becd4cd050fa90f72609f0c10f0a8ddda090f8e3 Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 24 Nov 2017 12:50:19 +0000 Subject: [PATCH] [rt46602] More updates to the test running framework Tidy up the stop/start files and make switch usage consistent. Also tidy up the various "clean" targets in the Makefile. (cherry picked from commit b24c2e11d85db48f364f3cca94b3ba8e75eca138) (cherry picked from commit 78494c3a4df383a235bc5d0b73676bc7b905d49a) (cherry picked from commit 28c2b0be93a9b3b11d9822e22788361617e93280) --- bin/tests/system/Makefile.in | 9 ++++- bin/tests/system/run.sh | 2 +- bin/tests/system/start.pl | 67 +++++++++++++++++++++++------------- bin/tests/system/stop.pl | 39 ++++++++++----------- 4 files changed, 71 insertions(+), 46 deletions(-) diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in index cf0c9d2fbab..fea2107b0e8 100644 --- a/bin/tests/system/Makefile.in +++ b/bin/tests/system/Makefile.in @@ -83,13 +83,20 @@ test: parallel.mk check: test -# Other targets. +# Other targets: +# +# testclean - delete files generated by running tests +# clean - As for testclean, but also delete files built for the tests by "make" +# distclean - As for clean, but also delete test-related files generated by +# "configure" testclean clean distclean:: if test -f ./cleanall.sh; then $(SHELL) ./cleanall.sh; fi rm -f systests.output rm -f random.data rm -f parallel.mk + +clean distclean:: rm -f ${TARGETS} rm -f ${OBJS} diff --git a/bin/tests/system/run.sh b/bin/tests/system/run.sh index f3d62b9f424..79a84f1bcec 100644 --- a/bin/tests/system/run.sh +++ b/bin/tests/system/run.sh @@ -102,7 +102,7 @@ then 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 --port $port $test || { echofail "R:$test:FAIL"; echoinfo "E:$test:`date $dateargs`"; exit 1; } # Run the tests ( cd $test ; $SHELL tests.sh -p "$port" -- "$@" ) diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl index c304492dfb0..a6766c23ede 100644 --- a/bin/tests/system/start.pl +++ b/bin/tests/system/start.pl @@ -15,8 +15,6 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id$ - # Framework for starting test servers. # Based on the type of server specified, check for port availability, remove # temporary files, start the server, and verify that the server is running. @@ -27,39 +25,60 @@ use Cwd; use Cwd 'abs_path'; use Getopt::Long; -# Option handling -# --noclean test [server [options]] +# Usage: +# perl start.pl [--noclean] --restart] [--port port] test [server [options]] +# +# --noclean Do not cleanup files in server directory. +# +# --restart Indicate that the server is being restarted, so get the +# server to append output to an existing log file instead of +# starting a new one. +# +# --port port Specify the default port being used by the server to answer +# queries (default 5300). This script will interrogate the +# server on this port to see if it is running. (Note: for +# "named" nameservers, this can be overridden by the presence +# of the file "named.port" in the server directory containing +# the number of the query port.) +# +# test Name of the test directory. +# +# server Name of the server directory. This will be of the form +# "nsN" or "ansN", where "N" is an integer between 1 and 8. +# If not given, the script will start all the servers in the +# test directory. # -# --noclean - Do not cleanup files in server directory -# test - name of the test directory -# server - name of the server directory -# options - alternate options for the server -# NOTE: options must be specified with '-- "