]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Allow system tests to run under root user when inside CI
authorPetr Špaček <pspacek@isc.org>
Fri, 14 Oct 2022 13:01:19 +0000 (15:01 +0200)
committerPetr Špaček <pspacek@isc.org>
Tue, 18 Oct 2022 13:18:13 +0000 (15:18 +0200)
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
says variable CI_SERVER="yes" is available in all versions of Gitlab.

(cherry picked from commit ddf46056ca6afa6352c360be4a0d7e336f2b6fd1)

Adapted to v9_16's version of run.sh.

bin/tests/system/run.sh

index 14a10670fa8e34f98809e148084933da7a0239a0..650ae7f9742982bdf60cc8f9f0bb7b925a7a6b7f 100755 (executable)
@@ -18,7 +18,7 @@
 SYSTEMTESTTOP="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
 . $SYSTEMTESTTOP/conf.sh
 
-if [ "$(id -u)" -eq "0" ] && ! ${NAMED} -V | grep -q -F -- "enable-developer"; then
+if [ "$CI_SERVER" != "yes" ] && [ "$(id -u)" -eq "0" ] && ! ${NAMED} -V | grep -q -F -- "enable-developer"; then
     echofail "Refusing to run test as root. Build with --enable-developer to override." >&2
     exit 1
 fi