[PATCH 04/18] tests: use snapctl umount rather than umount
authorZygmunt Krynicki <zygmunt.krynicki@canonical.com>
Mon, 27 May 2024 14:27:51 +0000 (16:27 +0200)
committerZygmunt Krynicki <me@zygoon.pl>
Mon, 17 Jun 2024 14:21:30 +0000 (16:21 +0200)
Snapctl creates systemd mount units that may be activated again, so plain
umount is insufficient to correctly undo all the changes.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Gbp-Pq: Name 0006-PATCH-04-18-tests-use-snapctl-umount-rather-than-umo.patch

tests/regression/lp-2065077/task.yaml

index 4f94fe15074a3ec7fc8207af5ecd19af9cbc27c9..bf0c1a420fd20ed1cde986fc5cb10eb02c54ade4 100644 (file)
@@ -16,7 +16,7 @@ prepare: |
     mkdir -p /var/snap/test-snapd-sh/common/base-files
     echo 'snapctl mount -o ro,bind,noatime,noexec /usr/share/base-files /var/snap/test-snapd-sh/common/base-files' | snap run --shell test-snapd-sh.sh
     mountpoint /var/snap/test-snapd-sh/common/base-files
-    tests.cleanup defer umount /var/snap/test-snapd-sh/common/base-files
+    tests.cleanup defer snap run --shell test-snapd-sh.sh -c \'snapctl umount /var/snap/test-snapd-sh/common/base-files\'
 
     tests.session prepare -u test
     tests.cleanup defer tests.session restore -u test