File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (21 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (3)
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