Skip to content
Snippets Groups Projects
Commit 845c9fb4 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler
Browse files

igt_command_line.sh: Abort if run as root


`ninja test` invokes igt_command_line.sh for each test binary to check
the behavior of some of the switches. One of the verified things is that
the test exists with non-zero status when requesting invalid subtest.

`--run-subtest` results in igt_fixtures being executed - this fiddles
with the device and sysfs knobs.

Let's exit early, if we are root, to save people form unintentional
side-effects and strange failures.

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ed32029e
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,10 @@ check_test ()
./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
}
if [ "$EUID" -eq 0 ]; then
fail "Don't run $0 as root. It executes igt_fixture blocks."
fi
TESTLISTFILE="$tests_dir/test-list.txt"
if [ ! -r "$TESTLISTFILE" ]; then
tests_dir="tests"
......
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