1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
summary: Ensure remove with unmounted base dir works
details: |
The snap try command can be used to install a snap without creating the
squashfs file, which for large snaps is very costly. The test simulates what
happens when a system with a try-mode snap is rebooted, and the files
originally backing the snap are gone. The test ensures that even in this
state the broken snap can be correctly removed without breaking snapd.
execute: |
cp -ar "$TESTSLIB"/snaps/test-snapd-tools /tmp
snap try /tmp/test-snapd-tools
# simulate what happens if someone "snap try /tmp/something" and then
# reboots: the dir is gone and nothing can be mounted anymore
rm -rf /tmp/test-snapd-tools
SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
umount "$SNAP_MOUNT_DIR/test-snapd-tools/x1"
# ensure removal still works
snap remove --purge test-snapd-tools
|