public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler via igt-dev <igt-dev@lists.freedesktop.org>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>, Daniel Vetter <daniel@ffwll.ch>
Subject: [igt-dev] [PATCH i-g-t] gitlab-ci: Run ninja test as non-root
Date: Tue, 12 Feb 2019 18:58:35 +0200	[thread overview]
Message-ID: <20190212165835.20366-1-arkadiusz.hiler@intel.com> (raw)

igt_command_line.sh now fails if it is run as root, which breaks 'ninja
test' in GitLab's CI with our current setup.

There's no convenient means of switching users yet:
 - USER in Dockerfile file won't do it, we would lack permissions for the src
 - each line of script is execute separately, so no `setuid()`
 - no facilities for juggling users in the gitlab-runner itself

So will just `useradd && chmod && su -c "ninja test"` in the testing
steps. At least for now.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 .gitlab-ci.yml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4bd4130f..08e8e6cc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -86,7 +86,10 @@ test:ninja-test:
   dependencies:
     - build:tests-fedora
   stage: test
-  script: ninja -C build test
+  script:
+    - useradd igt
+    - chown -R igt:igt build
+    - su igt -c "ninja -C build test"
 
 test:ninja-test-arm64:
   image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64:latest
@@ -96,7 +99,9 @@ test:ninja-test-arm64:
   script:
     - export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/
     - env > build/envdump.txt
-    - ninja -C build test
+    - useradd igt
+    - chown -R igt:igt build
+    - su igt -c "ninja -C build test"
   artifacts:
     paths:
       - build
-- 
2.20.1

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

             reply	other threads:[~2019-02-12 16:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 16:58 Arkadiusz Hiler via igt-dev [this message]
2019-02-12 17:01 ` [igt-dev] [PATCH i-g-t] gitlab-ci: Run ninja test as non-root arkadiusz.hiler--- 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=20190212165835.20366-1-arkadiusz.hiler@intel.com \
    --to=igt-dev@lists.freedesktop.org \
    --cc=arkadiusz.hiler@intel.com \
    --cc=daniel@ffwll.ch \
    --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