From 9a3491b58b234b661f13ac0ae2c2afd9a687a1a0 Mon Sep 17 00:00:00 2001 From: Ernest Lotter Date: Fri, 13 Dec 2024 11:22:19 +0200 Subject: [PATCH] tests/main/upgrade-from-release: workaround for older snapd deb version --- tests/main/upgrade-from-release/task.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/main/upgrade-from-release/task.yaml b/tests/main/upgrade-from-release/task.yaml index fb96d9e893e..6201920bad7 100644 --- a/tests/main/upgrade-from-release/task.yaml +++ b/tests/main/upgrade-from-release/task.yaml @@ -62,7 +62,13 @@ execute: | snap install go-example-webserver tests.systemd wait-for-service -n 30 --state active snap.go-example-webserver.webserver.service snap install test-snapd-tools - test-snapd-tools.echo hello | MATCH hello + # In case of known error on older snapd deb versions e.g. 2.32.5+18.04, + # rerun with SNAP_REEXEC=1 + if result=$(test-snapd-tools hello | MATCH hello); then + SNAPD_DEBUG=1 snap version | MATCH "re-exec disabled by user" + MATCH "cannot perform readlinkat() on the mount namespace file descriptor of the init process" <<< "$result" + SNAP_REEXEC=1 test-snapd-tools.echo hello | MATCH hello + fi echo "upgrade to current snapd" if [ "${VERSION_ID}" = "14.04" ]; then