Skip to content
Snippets Groups Projects
Commit eb1578f0 authored by Simon McVittie's avatar Simon McVittie Committed by Sjoerd Simons
Browse files

In tests that use run-aa-test, add a prefix to test names

In many tests, we run a scenario twice, once with a fake "malicious"
LD_PRELOAD and one without. Prefix the tests so we get

normal_test1: pass
normal_test2: pass
normal.expected_underlying_tests: pass
normal.expected: pass
malicious_test1: fail
malicious_test2: pass
malicious.expected_underlying_tests: fail
malicious.expected: pass

instead of having "duplicate" results for the underlying tests:

test1: pass
test2: pass
normal.expected_underlying_tests: pass
normal.expected: pass
test1: fail
test2: pass
malicious.expected_underlying_tests: fail
malicious.expected: pass

Differential Revision: https://phabricator.apertis.org/D282


Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: xclaesse
parent c206fe40
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,8 @@ else
exit 1
fi
export APERTIS_TESTS_NAME_PREFIX="${1}_"
if [[ $1 == "malicious" ]]; then
LD_PRELOAD="/usr/lib/apertis-tests/apparmor/geoclue/libgeoclue-malicious-override.so" \
DEBUG=2 /usr/share/chaiwala-tests/geoclue/automated/run-test.sh
......
......@@ -8,6 +8,8 @@ else
exit 1
fi
export APERTIS_TESTS_NAME_PREFIX="${1}_"
if [[ $1 == "malicious" ]]; then
LD_PRELOAD="/usr/lib/apertis-tests/apparmor/libreoffice/libreoffice-malicious-override.so" \
/usr/share/chaiwala-tests/libreoffice/automated/run-test.sh
......
......@@ -8,6 +8,8 @@ else
exit 1
fi
export APERTIS_TESTS_NAME_PREFIX="${1}_"
if [[ $1 == "malicious" ]]; then
LD_PRELOAD="/usr/lib/apertis-tests/apparmor/tracker/libtracker-malicious-override.so" \
DEBUG=2 /usr/share/chaiwala-tests/tracker/automated/run-test.sh
......
......@@ -8,6 +8,8 @@ else
exit 1
fi
export APERTIS_TESTS_NAME_PREFIX="${1}_"
if [[ $1 == "malicious" ]]; then
LD_PRELOAD="/usr/lib/apertis-tests/apparmor/tumbler/libtumbler-malicious-override.so" \
/usr/share/chaiwala-tests/tumbler/automated/run-test.sh
......
......@@ -284,14 +284,20 @@ _src_test() {
# All these are supposed to pass
local i failed=()
local expect=$1
local prefix=""
shift
if [ -n "${APERTIS_TESTS_NAME_PREFIX}" ]; then
prefix="${APERTIS_TESTS_NAME_PREFIX}"
fi
while read i; do
if [[ $i =~ ^\# ]]; then
echo_red "$i: skip\n"
echo_red "${prefix}$i: skip\n"
continue
# See check_file_exists_tee()
elif [[ $i =~ ^DNE ]]; then
echo_red "$i: fail\n"
echo_red "${prefix}$i: fail\n"
whine "Got an invalid executable name '$i'!"
failed+=("$i")
continue
......@@ -299,9 +305,9 @@ _src_test() {
say "Running test '$i' ..."
if ! "$expect" "$i" "$@"; then
failed+=("$i")
echo_red "$i: fail\n"
echo_red "${prefix}$i: fail\n"
else
echo_green "$i: pass\n"
echo_green "${prefix}$i: pass\n"
fi
done
if [[ "${#failed[@]}" -gt 0 ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment