Store system test output in bin/tests/system/

Some clean.sh scripts contain overly broad file deletion wildcards which
cause the test.output file (used by the system test framework for
collecting output) in a given system test's directory to be erroneously
removed immediately after the test is started (due to setup.sh scripts
calling clean.sh at the beginning).  This prevents the test's output
from being placed in bin/tests/system/systests.output at the end of a
test suite run and thus can lead to test failures being ignored.  Fix by
storing each test's output in a test.output.<test-name> file in
bin/tests/system/, which prevents clean.sh scripts from removing it (as
they should only ever affect files contained in a given system test's
directory).
This commit is contained in:
Michał Kępień
2019-12-06 14:11:01 +01:00
parent 34fb70b17c
commit b0916bba41
6 changed files with 20 additions and 20 deletions

View File

@@ -9,7 +9,7 @@
# 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
# 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.
@@ -17,7 +17,7 @@
# Usage:
# testsummary.sh [-n]
#
# -n Do NOT delete the individual test.output files after concatenating
# -n Do NOT delete the individual test.output.* files after concatenating
# them into systests.output.
#
# Status return:
@@ -35,13 +35,13 @@ while getopts "n" flag; do
esac
done
if [ `ls */test.output 2> /dev/null | wc -l` -eq 0 ]; then
echowarn "I:No 'test.output' files were found."
if [ `ls 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
cat test.output.* > systests.output
if [ $keepfile -eq 0 ]; then
rm -f */test.output
rm -f test.output.*
fi
fi