diff --git a/ci/lint.sh b/ci/lint.sh index 47ca089949..a18987a405 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -3,8 +3,15 @@ # SPDX-FileCopyrightText: Red Hat, Inc. # SPDX-License-Identifier: GPL-2.0-or-later -# Activate the tests venv (for containers only) -[ -d /venv ] && source /venv/bin/activate +# Only when running in a container +[ -d /venv ] && { + # Workaround to avoid this warning: + # fatal: detected dubious ownership in repository at '/dir' + git config --global --add safe.directory "$(pwd)" + + # Activate the tests venv (for containers only) + source /venv/bin/activate +} ./autogen.sh --system make diff --git a/ci/tests-storage.sh b/ci/tests-storage.sh index 694bc0ab83..c1e5e9195b 100755 --- a/ci/tests-storage.sh +++ b/ci/tests-storage.sh @@ -56,8 +56,15 @@ if [ -z "$user" ]; then exit 1 fi -# Activate the tests venv (for containers only) -[ -d /venv ] && source /venv/bin/activate +# Only when running in a container +[ -d /venv ] && { + # Workaround to avoid this warning: + # fatal: detected dubious ownership in repository at '/dir' + git config --global --add safe.directory "$(pwd)" + + # Activate the tests venv (for containers only) + source /venv/bin/activate +} echo "Running tests as user $user" diff --git a/ci/tests.sh b/ci/tests.sh index fcaccce837..ed449dc743 100755 --- a/ci/tests.sh +++ b/ci/tests.sh @@ -9,8 +9,15 @@ echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6 SUFFIX=$RANDOM ip link add mod_bond$SUFFIX type bond && ip link del mod_bond$SUFFIX -# Activate the tests venv (for containers only) -[ -d /venv ] && source /venv/bin/activate +# Only when running in a container +[ -d /venv ] && { + # Workaround to avoid this warning: + # fatal: detected dubious ownership in repository at '/dir' + git config --global --add safe.directory "$(pwd)" + + # Activate the tests venv (for containers only) + source /venv/bin/activate +} ./autogen.sh --system make