From: Ondřej Surý Date: Tue, 2 Jul 2019 10:23:56 +0000 (+0200) Subject: Use sudo to setup the interfaces when CI job is not running as root X-Git-Tag: v9.11.9~6^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab8de89e6dfb12f009ef8854db696f36adc20b46;p=thirdparty%2Fbind9.git Use sudo to setup the interfaces when CI job is not running as root (cherry picked from commit 4d3e7d0b7d3d552aeae40f3c74e213b5013cff7d) --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95a7cf19f53..87cb41335a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -122,13 +122,23 @@ stages: 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