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 (52 lines) | stat: -rw-r--r-- 2,157 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
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
summary: Checks for special cases of snap install from the store

details: |
    Test that installing from different channels, installing non-devmode snaps
    with devmode and vice-versa and installing snaps with bash-completion
    scripts all work as expected.

# run on ubuntu-14,16,18,20+ but not on ubuntu-core, fedora etc
systems: [ubuntu-1*, ubuntu-2*, ubuntu-3*]

environment:
    SNAP_NAME: test-snapd-tools
    DEVMODE_SNAP: test-snapd-devmode
    # Ensure that running purely from the deb (without re-exec) works
    # correctly
    SNAP_REEXEC/reexec0: 0
    SNAP_REEXEC/reexec1: 1

execute: |
    echo "Install from different channels"
    expected="(?s)$SNAP_NAME .* from Test snaps \(test-snaps-canonical\) installed\\n"
    for channel in edge beta candidate stable
    do
        snap install --unicode=never "$SNAP_NAME" --channel=$channel | grep -Pzq "$expected"
        snap remove --purge "$SNAP_NAME"
    done

    echo "Install non-devmode snap with devmode option"
    expected="(?s)$SNAP_NAME .* from Test snaps \(test-snaps-canonical\) installed\\n"
    snap install --unicode=never "$SNAP_NAME" --devmode | grep -Pzq "$expected"

    echo "Install devmode snap without devmode option"
    expected="repeat the command including --devmode"
    #shellcheck disable=SC2015
    ( snap install --channel beta "$DEVMODE_SNAP" 2>&1 && exit 1 || true ) | MATCH -z "${expected// /[[:space:]]+}"

    echo "Install devmode snap from stable"
    expected='error: snap "'"$DEVMODE_SNAP"'" is not available on stable but'
    #shellcheck disable=SC2015
    actual=$(snap install --devmode "$DEVMODE_SNAP" 2>&1 && exit 1 || true)
    echo "$actual" | grep -Pzq "$expected"

    echo "Install devmode snap from beta with devmode option"
    expected="(?s)$DEVMODE_SNAP .*"
    actual=$(snap install --channel beta --devmode "$DEVMODE_SNAP")
    echo "$actual" | grep -Pzq "$expected"

    echo "Install a snap that contains bash-completion scripts"
    snap install --edge test-snapd-complexion

    echo "All snap blobs are 0600"
    test "$( find /var/lib/snapd/{snaps,cache,seed/snaps}/ -type f -printf '%#m\n' | sort -u | xargs )" = "0600"