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 (69 lines) | stat: -rw-r--r-- 2,435 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
summary: Checks for parallel installation interfering with non-parallel snaps

details: |
  Make sure parallel instances do not interfere with other snaps. In particular,
  parallel instances create a recursive bind mount of $SNAP_MOUNT_DIR. This
  should not prevent snaps from being unmounted when removed.

prepare: |
    case "$SPREAD_SYSTEM" in
        fedora-*|arch-*|centos-*)
            # although classic snaps do not work out of the box on fedora,
            # we still want to verify if the basics do work if the user
            # symlinks /snap to $SNAP_MOUNT_DIR themselves
            SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
            ln -sf "$SNAP_MOUNT_DIR" /snap
            ;;
    esac

restore: |
    snap unset system experimental.parallel-instances

    case "$SPREAD_SYSTEM" in
        fedora-*|arch-*|centos-*)
            rm -f /snap
            ;;
    esac

execute: |
    # install confined and classic snaps
    "$TESTSTOOLS"/snaps-state install-local test-snapd-sh
    if os.query is-classic ; then
        "$TESTSTOOLS"/snaps-state install-local test-snapd-classic-confinement --classic
    fi

    snap set system experimental.parallel-instances=true

    # regular instances work
    # shellcheck disable=SC2016
    test-snapd-sh.sh -c 'echo confined $SNAP_INSTANCE_NAME works'
    if os.query is-classic ; then
        # shellcheck disable=SC2016
        test-snapd-classic-confinement.sh -c 'echo classic $SNAP_INSTANCE_NAME works'
    fi

    # new instances of same snaps
    "$TESTSTOOLS"/snaps-state install-local-as test-snapd-sh test-snapd-sh_foo
    if os.query is-classic ; then
        "$TESTSTOOLS"/snaps-state install-local-as test-snapd-classic-confinement test-snapd-classic-confinement_foo --classic
    fi

    # parallel instances works
    # shellcheck disable=SC2016
    test-snapd-sh_foo.sh -c 'echo confined $SNAP_INSTANCE_NAME works'
    if os.query is-classic ; then
        # shellcheck disable=SC2016
        test-snapd-classic-confinement_foo.sh -c 'echo classic $SNAP_INSTANCE_NAME works'
    fi

    # removal of snaps should not fail
    snap remove --purge test-snapd-sh
    if os.query is-classic ; then
        snap remove --purge test-snapd-classic-confinement
    fi

    # neither should the removal of instances
    snap remove --purge test-snapd-sh_foo
    if os.query is-classic ; then
        snap remove --purge test-snapd-classic-confinement_foo
    fi