diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-02-12 15:41:00 +0200 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-02-12 16:42:43 +0200 |
commit | 845c9fb45b734aef95e2fb2317d0c02567e06a68 (patch) | |
tree | 5401fb9e711227ee0ba4b9a996ba1b50455e2323 /tests/igt_command_line.sh | |
parent | ed32029e6a630d9322bd544b626eea38b4785e68 (diff) |
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: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/igt_command_line.sh')
-rwxr-xr-x | tests/igt_command_line.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh index e05ec34c..408d965f 100755 --- a/tests/igt_command_line.sh +++ b/tests/igt_command_line.sh @@ -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" |