From 4d3e7d0b7d3d552aeae40f3c74e213b5013cff7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 2 Jul 2019 12:23:56 +0200 Subject: [PATCH] Use sudo to setup the interfaces when CI job is not running as root --- .gitlab-ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df85a76b33..2f93f784bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,13 +134,23 @@ autoconf: &autoconf_job untracked: true expire_in: "1 hour" +.setup_interfaces: &setup_interfaces | + if [ "$(id -u)" -eq "0" ]; then + bash -x bin/tests/system/ifconfig.sh up; + else + sudo bash -x bin/tests/system/ifconfig.sh up; + fi + +.setup_softhsm: &setup_softhsm | + bash -x util/prepare-softhsm2.sh + .system_test: &system_test_job <<: *default_triggering_rules stage: test retry: 2 before_script: - - bash -x bin/tests/system/ifconfig.sh up - - bash -x util/prepare-softhsm2.sh + - *setup_interfaces + - *setup_softhsm script: - ( cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 ) - test -s bin/tests/system/systests.output