Merge branch 'mnowak/drop-some-system-test-scrips' into 'main'

Drop some system test scripts

See merge request isc-projects/bind9!5745
This commit is contained in:
Michal Nowak 2022-01-27 14:45:42 +00:00
commit 3b53680458
8 changed files with 7 additions and 193 deletions

View file

@ -8,11 +8,8 @@ named.lock
named.pid
named.run
/feature-test
/test.output.*
/makejournal
/systests.output
/random.data
parallel.mk
/*.log
/*.trs
/resolve

View file

@ -126,9 +126,7 @@ new tests being started as tests finish. Each test will get a unique set of
ports, so there is no danger of tests interfering with one another. Parallel
running will reduce the total time taken to run the BIND system tests, but will
mean that the output from all the tests sent to the screen will be mixed up
with one another. However, the systests.output file produced at the end of the
run (in the bin/tests/system directory) will contain the output from each test
in sequential order.
with one another.
In this case, retention of the output files after a test completes successfully
is specified by setting the environment variable SYSTEMTEST_NO_CLEAN to 1 prior
@ -598,13 +596,10 @@ Adding a Test to the System Test Suite
---
Once a test has been created, the following files should be edited:
* conf.sh.in The name of the test should be added to the PARALLELDIRS or
SEQUENTIALDIRS variables as appropriate. The former is used for tests that
can run in parallel with other tests, the latter for tests that are unable to
do so.
* conf.sh.common The name of the test should be added to the PARALLEL_COMMON
variable.
* Makefile.in The name of the test should be added to one of the the PARALLEL
or SEQUENTIAL variables.
* Makefile.am The name of the test should be added to the TESTS variable.
(It is likely that a future iteration of the system test suite will remove the
need to edit multiple files to add a test.)
@ -632,15 +627,8 @@ test, the running of all tests in the test suite is controlled by the Makefile.
All system tests are capable of being run in parallel. For this to work, each
test needs to use a unique set of ports. To avoid the need to define which
tests use which ports (and so risk port clashes as further tests are added),
the ports are assigned when the tests are run. This is achieved by having the
"test" target in the Makefile depend on "parallel.mk". That file is created
when "make check" is run, and contains a target for each test of the form:
<test-name>:
@$(SHELL) run.sh -p <baseport> <test-name>
The <baseport> is unique and the values of <baseport> for each test are
separated by at least 100 ports.
the ports are determined by "get_ports.sh", a port broker script which keeps
track of ports given to each individual system test.
Cleaning Up From Tests
@ -653,10 +641,6 @@ stored in the test directory.
2. Files produced by named which may not be cleaned up if named exits
abnormally, e.g. core files, PID files etc., are stored in the test directory.
3. A file "test.output.<test-name>" containing the text written to stdout by the
test is written to bin/tests/system/. This file is only produced when the test
is run as part of the entire test suite (e.g. via make).
If the test fails, all these files are retained. But if the test succeeds,
they are cleaned up at different times:
@ -665,7 +649,3 @@ they are cleaned up at different times:
2. Files that may not be cleaned up if named exits abnormally can be removed
using the "cleanall.sh" script.
3. "test.output.*" files are deleted when the test suite ends. At this point,
the file "testsummary.sh" is called which concatenates all the "test.output.*"
files into a single "systests.output" file before deleting them.

View file

@ -31,6 +31,5 @@ rm -f ../random.data
for d in $SUBDIRS
do
test ! -f $d/clean.sh || ( cd $d && $SHELL clean.sh )
rm -f test.output.$d
test -d $d && find $d -type d -exec rmdir '{}' \; 2> /dev/null
done

View file

@ -31,13 +31,6 @@ export LANG=C
# The "dialup", "delzone", and "dupsigs" tests are also not run by
# default because they take a very long time to complete.
#
# The following tests are hard-coded to use ports 5300 and 9953. For
# this reason, these must be run sequentially.
#
# Sequential tests that only run on unix/linux should be added to
# SEQUENTIAL_UNIX in conf.sh.in
#
SEQUENTIAL_COMMON=""
#
# These tests can use ports assigned by the caller (other than 5300

View file

@ -73,8 +73,6 @@ KRB5_KTNAME=dns.keytab
#
# Construct the lists of tests to run
#
SEQUENTIAL_UNIX=""
SEQUENTIALDIRS="$SEQUENTIAL_COMMON $SEQUENTIAL_UNIX"
PARALLEL_UNIX="chain
checkds
@ -93,9 +91,7 @@ pipelined
qmin
shutdown
tcp"
PARALLELDIRS="$PARALLEL_COMMON $PARALLEL_UNIX"
SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
SUBDIRS="$PARALLEL_COMMON $PARALLEL_UNIX"
# Use the CONFIG_SHELL detected by configure for tests
SHELL=@SHELL@

View file

@ -1,34 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ./conf.sh
PARALLELS=$(echo "$PARALLELDIRS" | sed "s|\([^ ][^ ]*\)|test-\1|g;" | tr _ - | tr "\n" " ")
echo ".PHONY: $PARALLELS"
echo
echo "check_interfaces:"
echo " @${PERL} testsock.pl > /dev/null 2>&1 || { \\"
echo " echo \"I:NOTE: System tests were skipped because they require the\"; \\"
echo " echo \"I: test IP addresses 10.53.0.* to be configured as alias\"; \\"
echo " echo \"I: addresses on the loopback interface. Please run\"; \\"
echo " echo \"I: \"bin/tests/system/ifconfig.sh up\" as root to configure them.\"; \\"
echo " exit 1; \\"
echo " }"
echo
echo "test check: $PARALLELS"
for directory in $PARALLELDIRS ; do
echo
echo "test-$(echo "$directory" | tr _ -): check_interfaces"
echo " @${SHELL} ./run.sh -r $directory 2>&1 | tee test.output.$directory"
done

View file

@ -1,26 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Run system tests that must be run sequentially
#
# Note: Use "make check" to run all the system tests. This script will just
# run those tests that require that each of their nameservers is the only one
# running on an IP address.
#
. ./conf.sh
for d in $SEQUENTIALDIRS
do
$SHELL run.sh "${@}" "$d" 2>&1 | tee "test.output.$d"
done

View file

@ -1,91 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Creates the system tests output file from the various test.output.* files. It
# then searches that file and prints the number of tests passed, failed, not
# run. It also checks whether the IP addresses 10.53.0.[1-8] were set up and,
# if not, prints a warning.
#
# Usage:
# testsummary.sh [-n]
#
# -n Do NOT delete the individual test.output.* files after concatenating
# them into systests.output.
#
# Status return:
# 0 - no tests failed
# 1 - one or more tests failed
. ./conf.sh
keepfile=0
while getopts "n" flag; do
case $flag in
n) keepfile=1 ;;
*) exit 1 ;;
esac
done
if [ "$(find . -name 'test.output.*' 2>/dev/null | wc -l)" -eq 0 ]; then
echowarn "I:No 'test.output.*' files were found."
echowarn "I:Printing summary from pre-existing 'systests.output'."
else
cat test.output.* > systests.output
if [ $keepfile -eq 0 ]; then
rm -f test.output.*
fi
fi
if [ ! -f systests.output ]; then
echowarn "I:No 'systests.output' file found."
exit 1
fi
status=0
echoinfo "I:System test result summary:"
echoinfo "$(grep 'R:[a-z0-9_-][a-z0-9_-]*:[A-Z][A-Z]*' systests.output | cut -d':' -f3 | sort | uniq -c | sed -e 's/^/I:/')"
FAILED_TESTS=$(grep 'R:[a-z0-9_-][a-z0-9_-]*:FAIL' systests.output | cut -d':' -f2 | sort | sed -e 's/^/I: /')
if [ -n "${FAILED_TESTS}" ]; then
echoinfo "I:The following system tests failed:"
echoinfo "${FAILED_TESTS}"
status=1
fi
CRASHED_TESTS=$(find . \( -name 'core' -or -name 'core.*' -or -name '*.core' \) ! -name '*.txt' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /')
if [ -n "${CRASHED_TESTS}" ]; then
echoinfo "I:Core dumps were found for the following system tests:"
echoinfo "${CRASHED_TESTS}"
fi
ASSERTION_FAILED_TESTS=$(find . -name named.run -print0 | xargs -0 grep "assertion failure" | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /')
if [ -n "${ASSERTION_FAILED_TESTS}" ]; then
echoinfo "I:Assertion failures were detected for the following system tests:"
echoinfo "${ASSERTION_FAILED_TESTS}"
fi
TSAN_REPORT_TESTS=$(find . -name 'tsan.*' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /')
if [ -n "${TSAN_REPORT_TESTS}" ]; then
echoinfo "I:ThreadSanitizer reported issues for the following system tests:"
echoinfo "${TSAN_REPORT_TESTS}"
fi
RESULTS_FOUND=$(grep -c 'R:[a-z0-9_-][a-z0-9_-]*:[A-Z][A-Z]*' systests.output)
TESTS_RUN=$(echo "${SUBDIRS}" | wc -w)
if [ "${RESULTS_FOUND}" -ne "${TESTS_RUN}" ]; then
echofail "I:Found ${RESULTS_FOUND} test results, but ${TESTS_RUN} tests were run"
status=1
fi
exit $status