Merge branch '4250-remove-legacy-runner-support-for-python-tests-9.18' into 'bind-9.18'

[9.18] remove support for running python system tests with legacy test runner

See merge request isc-projects/bind9!8317
This commit is contained in:
Tom Krizek
2023-09-20 13:52:38 +00:00
4 changed files with 594 additions and 608 deletions

View File

@@ -1,3 +1,7 @@
6252. [test] Python system tests have to be executed by invoking
pytest directly. Executing them with the legacy test
runner is no longer supported. [GL #4250]
6250. [bug] The wrong covered value was being set by
dns_ncache_current for RRSIG records in the returned
rdataset structure. This resulted in TYPE0 being

View File

@@ -325,6 +325,8 @@ setup.sh Run after prereq.sh, this sets up the preconditions for the tests.
tests.sh Runs the actual tests. This file is mandatory.
tests_sh_xyz.py A glue file for the pytest runner for executing shell tests.
clean.sh Run at the end to clean up temporary files, but only if the test
was completed successfully and its running was not inhibited by the
"-n" switch being passed to "legacy.run.sh". Otherwise the
@@ -544,6 +546,17 @@ e. Retain a count of test failures and return this as the exit status from
the script.
tests_sh_xyz.py
---------------
This glue file is required by the pytest runner in order to find and execute
the shell tests in tests.sh.
Replace the "xyz" with the system test name and create the file with the
following contents.
def test_xyz(run_tests_sh):
run_tests_sh()
clean.sh
---
The inverse of "setup.sh", this is invoked by the framework to clean up the

File diff suppressed because it is too large Load Diff

View File

@@ -84,7 +84,7 @@ if [ "${srcdir}" != "${builddir}" ]; then
cp -a "${srcdir}/_common" "${builddir}"
fi
# Some tests require additional files to work for out-of-tree test runs.
for file in ckdnsrps.sh conftest.py digcomp.pl ditch.pl fromhex.pl get_core_dumps.sh kasp.sh packet.pl pytest_custom_markers.py start.pl stop.pl testcrypto.sh; do
for file in ckdnsrps.sh conftest.py digcomp.pl ditch.pl fromhex.pl get_core_dumps.sh kasp.sh packet.pl start.pl stop.pl testcrypto.sh; do
if [ ! -r "${file}" ]; then
cp -a "${srcdir}/${file}" "${builddir}"
fi
@@ -193,37 +193,6 @@ if [ -r "$systest/tests.sh" ]; then
fi
fi
if [ $status -eq 0 ]; then
if [ -n "$PYTEST" ]; then
for test in $(cd "${systest}" && find . -name "tests*.py" ! -name "tests_sh_*.py"); do
rm -f "$systest/$test.status"
if start_servers; then
run=$((run+1))
test_status=0
(cd "$systest" && LEGACY_TEST_RUNNER=1 "$PYTEST" -rsxX -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
if [ -f "$systest/$test.status" ]; then
if [ "$(cat "$systest/$test.status")" = "5" ]; then
echowarn "R:$systest:SKIPPED"
else
echo_i "FAILED"
test_status=$(cat "$systest/$test.status")
fi
fi
status=$((status+test_status))
stop_servers || status=1
else
status=1
fi
if [ $status -ne 0 ]; then
break
fi
done
rm -f "$systest/$test.status"
else
echoinfo "I:$systest:pytest not installed, skipping python tests"
fi
fi
if [ "$run" -eq "0" ]; then
echoinfo "I:$systest:No tests were found and run"
status=255