File: task.yaml

package info (click to toggle)
snapd 2.49-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 36,432 kB
  • sloc: ansic: 12,125; sh: 8,453; python: 2,163; makefile: 1,284; exp: 173; xml: 22
file content (39 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download
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
summary: Check that removal of essential snaps does not work

# UC16 does not seed the snapd snap (yet)
systems: [-ubuntu-core-16-*]

execute: |
    echo "Ensure snapd cannot be removed"
    if snap remove --purge snapd; then
        echo "The snapd snap should not be removable"
        exit 1
    fi

    if os.query is-core18; then
        base=core18
    elif os.query is-core20; then
        base=core20
    fi
    echo "Ensure $base cannot be removed"
    if snap remove --purge "$base"; then
        echo "The $base snap should not removable"
        exit 1
    fi

    echo "Install a snap that requires core as the base"
    snap install test-snapd-sh
    snap list | MATCH '^core '
    if snap remove --purge core; then
        echo "core should not be removable because test-snapd-tools needs it"
        exit 1
    fi

    echo "But core can be removed again once nothing on the system needs it"
    snap remove --purge test-snapd-sh
    snap remove --purge core

    if snap list | MATCH '^core '; then
        echo "core was not removed correctly"
        exit 1
    fi