From: Daniel Vetter <daniel@ffwll.ch>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] igt_command_line.sh: Abort if run as root
Date: Tue, 12 Feb 2019 15:14:46 +0100 [thread overview]
Message-ID: <20190212141446.GB23159@phenom.ffwll.local> (raw)
In-Reply-To: <20190212135317.14057-1-arkadiusz.hiler@intel.com>
On Tue, Feb 12, 2019 at 03:53:17PM +0200, Arkadiusz Hiler via igt-dev wrote:
> `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."
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> +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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-02-12 14:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190212141446.GB23159@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=arkadiusz.hiler@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=petri.latvala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox