From fad413366ae29271bc65cd7cc985bf1b852cefcc Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 15 Dec 2017 15:56:33 +0000 Subject: [PATCH] [rt46602] Ensure test output in systests.output is not mixed up When running all the system tests, output from a test is sent to a test.output file in the test directory. These are combined in to systests.output when the run finishes. (cherry picked from commit 055e5be9fd7555e24449157bc78b8c0852f9b7d1) (cherry picked from commit 50769a4a9e699b74b2a6fa2d5dc91ca54c99d9f3) (cherry picked from commit 818ac05cfcd5a22c9f945ca63ee1ace13f6d8a72) --- bin/tests/system/.gitignore | 1 + bin/tests/system/Makefile.in | 6 +- bin/tests/system/README | 119 ++++++++++++++++++-------- bin/tests/system/allow_query/clean.sh | 1 - bin/tests/system/clean.sh | 20 ++++- bin/tests/system/cleanall.sh | 1 + bin/tests/system/run.sh | 40 ++++----- bin/tests/system/runall.sh | 19 ++-- bin/tests/system/runsequential.sh | 8 +- bin/tests/system/testsummary.sh | 31 ++++++- 10 files changed, 171 insertions(+), 75 deletions(-) diff --git a/bin/tests/system/.gitignore b/bin/tests/system/.gitignore index 83336dffe4..5e086e79c9 100644 --- a/bin/tests/system/.gitignore +++ b/bin/tests/system/.gitignore @@ -10,5 +10,6 @@ named.pid named.run named.port /feature-test +**/test.output /systests.output /random.data diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in index 992d0ebe1a..5a05b2d865 100644 --- a/bin/tests/system/Makefile.in +++ b/bin/tests/system/Makefile.in @@ -68,15 +68,15 @@ parallel.mk: for directory in $(PARALLEL) ; do \ echo "" >> $@ ; \ echo "$$directory:" >> $@ ; \ - echo " @$(SHELL) ./run.sh -p $$port $$directory" >> $@ ; \ + echo " @$(SHELL) ./run.sh -r -p $$port $$directory | tee $$directory/test.output" >> $@ ; \ port=`expr $$port + 100` ; \ done # Targets to run the tests. test: parallel.mk - @$(MAKE) -f parallel.mk check 2>&1 | tee systests.output - @$(SHELL) ./runsequential.sh 2>&1 | tee -a systests.output + @$(MAKE) -f parallel.mk check + @$(SHELL) ./runsequential.sh -r @$(SHELL) ./testsummary.sh check: test diff --git a/bin/tests/system/README b/bin/tests/system/README index cdc41fcf40..2f9c638147 100644 --- a/bin/tests/system/README +++ b/bin/tests/system/README @@ -105,6 +105,9 @@ Optional flags are: the date looking like "2017-11-23:16:06:32" instead of the default "Thu, 23 Nov 2017 16:06:32 +0000". + -r The "runall" flag. This is related to cleaning up after + all the tests. (See "Mainenance Notes" below.) + Arguments are: test-name Mandatory. The name of the test, which is the name of the @@ -134,9 +137,9 @@ It is also possible to run the test suites from two installations of BIND on the same machine at the same time. To do this: 1. Each installation must have its own directory tree. The system tests create -temporary configuration files in the test directories, so separate directory -trees are required to avoid interference between the same test running in the -different installations. +files in the test directories, so separate directory trees are required to +avoid interference between the same test running in the different +installations. 2. For one of the test suites, the starting port number must be specified by setting the environment variable STARTPORT before starting the test suite. @@ -156,12 +159,12 @@ abouts). The use of "STARTPORT=20000" to prefix the run of the test suite for installation-2 will mean the test suite uses ports 20,000 through 30,000 or so. Parallel running will reduce the total time taken to run the BIND system tests, -but will mean that the output from all the tests will be mixed up with one -another in the systests.output file. However, if you need to investigate the -output from a test, there is a simple way of extracting the information. -Before discussing this though, the format of the test messages needs to be -understood. +but will mean that the output from all the tests pointed to the screen will be +mixed up with one another. However, the systests.output file produced at the +end of the run will contain the output from each test, one after the other. +Format of Test Output +--- All output from the system tests is in the form of lines with the following structure: @@ -217,18 +220,6 @@ the form: e.g. nsupdate.out.test28, dig.out.q3. This aids diagnosis of problems by allowing the output that caused the problem to be identified. -Returning to the problem of extracting information about a single test from -systests.output, the solution is fairly easy: run the command: - - grep '::' systests.output - -e.g. - - grep ':catz:' systests.output - -(note the colons before and after the test name). This will list all the -messages produced by the test in the order they were output. - Re-running the Tests === @@ -255,6 +246,7 @@ Developer Notes === This section is intended for developers writing new tests. + Overview --- As noted above, each test suite is in a separate directory. To interact with @@ -326,11 +318,30 @@ General --- 1. Each of the four scripts will be invoked with the command - sh