From a6866a73f549923ca5ef4cbf772ed6864e339e2c Mon Sep 17 00:00:00 2001 From: Ernest Lotter Date: Tue, 7 Jan 2025 15:49:30 +0200 Subject: [PATCH] tests/main/upgrade-from-release: workaround for older snapd deb version (#14854) --- tests/main/upgrade-from-release/task.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/main/upgrade-from-release/task.yaml b/tests/main/upgrade-from-release/task.yaml index fb96d9e893e..9dae1feae9b 100644 --- a/tests/main/upgrade-from-release/task.yaml +++ b/tests/main/upgrade-from-release/task.yaml @@ -62,7 +62,15 @@ 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 as workaround for this step + if result=$(test-snapd-tools.echo hello 2>&1); then + MATCH hello <<< "$result" + else + SNAPD_DEBUG=1 snap version 2>&1 | 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