mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
tests: Add an optional final check to checktestfg and checktestbg
Allows for the test script to specify a final check to be performed after checking the output of the test binary. This may be useful, for example, if the test script wants to compare logging output of the test binary to known-good logging output. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -129,7 +129,7 @@ checktestbg()
|
||||
then
|
||||
echo "SIGNAL$(($rc - 128))" > $outfile
|
||||
fi
|
||||
checktestfg
|
||||
checktestfg "$@"
|
||||
}
|
||||
|
||||
runtestfg()
|
||||
@@ -207,6 +207,15 @@ checktestfg()
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
$1
|
||||
if [ "$teststatus" != "pass" ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$VERBOSE" ]; then
|
||||
echo "ok: ${_testdesc}"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user