Skip to contentSkip to conversation

igt_command_line.sh: Abort if run as root

PATCH In review Arkadiusz Hiler via igt-dev 3 participants 5 messages Feb 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Andi Shyti <[email protected]>
---
 tests/igt_command_line.sh | 4 ++++
 1 file changed, 4 insertions(+)
tests/igt_command_line.sh +4 -0
index e05ec34c..408d965f 100755
@@ -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"
Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Arkadiusz Hiler via igt-dev

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 <[email protected]>
Cc Andi Shyti <[email protected]>
---
 tests/igt_command_line.sh | 4 ++++
 1 file changed, 4 insertions(+)
tests/igt_command_line.sh +0 -0
index e05ec34c..408d965f 100755

tests/igt_command_line.sh check_test () · line 104

Quoted 5 lines
tests/igt_command_line.sh +2 -0
@@ -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."
Quoted 12 lines
tests/igt_command_line.sh +2 -0
+fi
+
 TESTLISTFILE="$tests_dir/test-list.txt"
 if [ ! -r "$TESTLISTFILE" ]; then
 	tests_dir="tests"
Signature · 6 lines
2.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for igt_command_line.sh: Abort if run as root

In reply to Arkadiusz Hiler via igt-dev
== Series Details ==

== Series Details ==

Series: igt_command_line.sh: Abort if run as root
URL : https://patchwork.freedesktop.org/series/56539/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5592 -> IGTPW_2381
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/56539/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_2381 that come from known issues:

### IGT changes ###

#### Possible fixes ####

* igt@kms_busy@basic-flip-a:
- fi-gdg-551: FAIL [fdo#103182] -> PASS

* igt@kms_pipe_crc_basic@read-crc-pipe-b:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109226]: https://bugs.freedesktop.org/show_bug.cgi?id=109226
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278

Participating hosts (46 -> 37)
------------------------------

Additional (1): fi-pnv-d510
Missing (10): fi-kbl-soraka fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-apl-guc fi-ctg-p8600 fi-glk-j4005 fi-bdw-samus

Build changes
-------------

* IGT: IGT_4818 -> IGTPW_2381

CI_DRM_5592: 21b5bf210fc5659e3d5eda86727e689ebda26e29 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2381: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2381/
IGT_4818: ed32029e6a630d9322bd544b626eea38b4785e68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2381/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for igt_command_line.sh: Abort if run as root

In reply to Arkadiusz Hiler via igt-dev
== Series Details ==

== Series Details ==

Series: igt_command_line.sh: Abort if run as root
URL : https://patchwork.freedesktop.org/series/56539/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5592_full -> IGTPW_2381_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/56539/revisions/1/mbox/

Known issues
------------

Here are the changes found in IGTPW_2381_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-kbl: NOTRUN -> DMESG-WARN [fdo#107956]

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-snb: NOTRUN -> DMESG-WARN [fdo#107956] +1

* igt@kms_content_protection@legacy:
- shard-kbl: NOTRUN -> FAIL [fdo#108597]

* igt@kms_cursor_crc@cursor-128x42-random:
- shard-apl: PASS -> FAIL [fdo#103232] +4

* igt@kms_cursor_crc@cursor-256x256-onscreen:
- shard-kbl: PASS -> FAIL [fdo#103232] +1

* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#102887] / [fdo#105363]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-apl: PASS -> FAIL [fdo#103167] +1

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-kbl: PASS -> FAIL [fdo#103167]

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
- shard-glk: PASS -> FAIL [fdo#103167] +5

* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-apl: NOTRUN -> FAIL [fdo#108145]
- shard-kbl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
- shard-kbl: NOTRUN -> FAIL [fdo#108145] / [fdo#108590]

* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-apl: PASS -> FAIL [fdo#103166] +1
- shard-kbl: PASS -> FAIL [fdo#103166]

* igt@kms_plane_multiple@atomic-pipe-c-tiling-none:
- shard-glk: PASS -> FAIL [fdo#103166] +3

#### Possible fixes ####

* igt@gem_eio@in-flight-suspend:
- shard-snb: FAIL [fdo#103375] -> PASS

* igt@gem_mmap_gtt@hang:
- shard-snb: INCOMPLETE [fdo#105411] / [fdo#109605 ] -> PASS
- shard-apl: INCOMPLETE [fdo#103927] / [fdo#109605 ] -> PASS

* igt@gem_workarounds@suspend-resume-context:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS

* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: FAIL [fdo#103232] -> PASS +4

* igt@kms_cursor_crc@cursor-64x64-onscreen:
- shard-kbl: FAIL [fdo#103232] -> PASS +2

* igt@kms_cursor_crc@cursor-alpha-opaque:

    - shard-kbl:          FAIL [fdo#109350] -> PASS
    - shard-apl:          FAIL [fdo#109350] -> PASS
    - shard-glk:          FAIL [fdo#109350] -> PASS

* igt@kms_flip@dpms-vs-vblank-race:
- shard-apl: FAIL [fdo#103060] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
- shard-apl: FAIL [fdo#103167] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
- shard-kbl: FAIL [fdo#103167] -> PASS

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: FAIL [fdo#103167] -> PASS +4

* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: FAIL [fdo#103166] -> PASS +2

* igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
- shard-glk: FAIL [fdo#103166] -> PASS +2
- shard-kbl: FAIL [fdo#103166] -> PASS +1

* igt@kms_setmode@basic:
- shard-apl: FAIL [fdo#99912] -> PASS

#### Warnings ####

* igt@kms_chamelium@dp-hpd-storm-disable:
- shard-apl: {SKIP} [fdo#109271] -> INCOMPLETE [fdo#103927]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108590]: https://bugs.freedesktop.org/show_bug.cgi?id=108590
[fdo#108597]: https://bugs.freedesktop.org/show_bug.cgi?id=108597
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
[fdo#109605 ]: https://bugs.freedesktop.org/show_bug.cgi?id=109605
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (7 -> 5)
------------------------------

Missing (2): shard-skl shard-iclb

Build changes
-------------

* IGT: IGT_4818 -> IGTPW_2381
* Piglit: piglit_4509 -> None

CI_DRM_5592: 21b5bf210fc5659e3d5eda86727e689ebda26e29 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2381: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2381/
IGT_4818: ed32029e6a630d9322bd544b626eea38b4785e68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2381/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

author Reviewed-by Andi Shyti on v1 1/1
#4 lore raw
In reply to Arkadiusz Hiler via igt-dev

Hi Arek,

Quoted 7 lines · Arkadiusz Hiler

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.

Quoted 6 lines

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

Cc Petri Latvala <[email protected]>
Cc Andi Shyti <[email protected]>

Thanks,
Andi
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev