public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] igt_command_line.sh: Abort if run as root
@ 2019-02-12 13:53 Arkadiusz Hiler via igt-dev
  2019-02-12 14:14 ` Daniel Vetter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arkadiusz Hiler via igt-dev @ 2019-02-12 13:53 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

`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>
---
 tests/igt_command_line.sh | 4 ++++
 1 file changed, 4 insertions(+)

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"
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-12 23:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-12 13:53 [igt-dev] [PATCH i-g-t] igt_command_line.sh: Abort if run as root Arkadiusz Hiler via igt-dev
2019-02-12 14:14 ` Daniel Vetter
2019-02-12 14:37 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-02-12 16:58 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-12 23:58 ` [igt-dev] [PATCH i-g-t] " Andi Shyti via igt-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox