From f8a0f9678cf6eb8531270c41c297849dc693bf58 Mon Sep 17 00:00:00 2001 From: Zygmunt Krynicki Date: Wed, 24 Jul 2019 12:01:35 +0200 Subject: [PATCH] tests: remove locally installed core in more tests Two more tests were installing a local revision of core. Signed-off-by: Zygmunt Krynicki --- tests/main/snapd-reexec/task.yaml | 6 ++++++ tests/main/stale-base-snap/task.yaml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/tests/main/snapd-reexec/task.yaml b/tests/main/snapd-reexec/task.yaml index a7c5ce491f1..4b1cb826965 100644 --- a/tests/main/snapd-reexec/task.yaml +++ b/tests/main/snapd-reexec/task.yaml @@ -6,6 +6,12 @@ systems: [-ubuntu-core-*, -fedora-*, -opensuse-*, -arch-*, -amazon-*, -centos-*] restore: | #shellcheck source=tests/lib/dirs.sh . "$TESTSLIB"/dirs.sh + + # Remove the locale revision of core, if we installed one. + if [ "$(readlink "$SNAP_MOUNT_DIR/core/current")" = x1 ]; then + snap revert core + snap remove --revision=x1 core + fi # extra cleanup in case something in this test went wrong rm -f /etc/systemd/system/snapd.service.d/no-reexec.conf systemctl stop snapd.service snapd.socket diff --git a/tests/main/stale-base-snap/task.yaml b/tests/main/stale-base-snap/task.yaml index 4dd46548335..fdc3cc84b62 100644 --- a/tests/main/stale-base-snap/task.yaml +++ b/tests/main/stale-base-snap/task.yaml @@ -37,6 +37,13 @@ prepare: | restore: | rm -rf squashfs-root rm -f core-customized.snap + #shellcheck source=tests/lib/dirs.sh + . "$TESTSLIB"/dirs.sh + # Remove the locale revision of core, if we installed one. + if [ "$(readlink "$SNAP_MOUNT_DIR/core/current")" = x1 ]; then + snap revert core + snap remove --revision=x1 core + fi execute: | # Start a "sleep" process in the background