summaryrefslogtreecommitdiffhomepage
path: root/test/scripts/ssh-setup.sh
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-08-29 15:32:09 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-09-02 09:43:43 +0200
commit4544ef439898ca108366a20ef2b9faa2fba39fad (patch)
tree17c3d1fbd079686e79b2100cd2f41dfa5bfa5269 /test/scripts/ssh-setup.sh
parent74301731378389fdb682b88c6343ed1fbda885ac (diff)
downloadmullvadvpn-4544ef439898ca108366a20ef2b9faa2fba39fad.tar.xz
mullvadvpn-4544ef439898ca108366a20ef2b9faa2fba39fad.zip
Fix `test-runner` bootstrap failing if `apt` lock is already held
Diffstat (limited to 'test/scripts/ssh-setup.sh')
-rw-r--r--test/scripts/ssh-setup.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/scripts/ssh-setup.sh b/test/scripts/ssh-setup.sh
index 0bbea4f0b9..dd72bca4f8 100644
--- a/test/scripts/ssh-setup.sh
+++ b/test/scripts/ssh-setup.sh
@@ -124,12 +124,20 @@ fi
setup_systemd
+# Run apt with some arguments
+robust_apt () {
+ # We don't want to fail due to the global apt lock being
+ # held, which happens sporadically. It is fine to wait for
+ # some time if it means that the test run can continue.
+ apt -o DPkg::Lock::Timeout=60 "$@"
+}
+
function install_packages_apt {
echo "Installing required apt packages"
- apt update
- apt install -yf xvfb wireguard-tools curl
+ robust_apt update
+ robust_apt install -yf xvfb wireguard-tools curl
if ! which ping &>/dev/null; then
- apt install -yf iputils-ping
+ robust_apt install -yf iputils-ping
fi
curl -fsSL https://get.docker.com | sh
}