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 (44 lines) | stat: -rw-r--r-- 1,552 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
summary: Check that the core snap can be refreshed

details: |
    This test checks that the core snap can be refreshed from an installed
    revision to a new one. It expects to find a new snap revision in the
    channel pointed by the NEW_CORE_CHANNEL env var.

manual: true

execute: |
    if [ "$SPREAD_REBOOT" = 0 ]; then
        echo "Save current core revision"
        snap list | awk "/^core / {print(\$3)}" > prevBoot

        echo "Refresh core to ${NEW_CORE_CHANNEL} channel" 
        snap refresh core "--${NEW_CORE_CHANNEL}"

        echo "Check boot env vars"
        snap list | awk "/^core / {print(\$3)}" > nextBoot

        if os.query is-core; then
            test "$("$TESTSTOOLS"/boot-state bootenv show snap_core)" = "core_$(cat prevBoot).snap"
            test "$("$TESTSTOOLS"/boot-state bootenv show snap_try_core)" = "core_$(cat nextBoot).snap"
        fi

        echo "Check there are no errors in the changes list"
        snap changes | NOMATCH '^[0-9]+ +Error'

        REBOOT
    fi

    echo "After upgrade, check the boot env vars are correctly set"
    echo "Waiting for snapd to clean snap_mode"
    while [ "$("$TESTSTOOLS"/boot-state bootenv show snap_mode)" != "" ]; do
        sleep 1
    done

    if os.query is-core; then
        test "$("$TESTSTOOLS"/boot-state bootenv show snap_core)" = "core_$(cat nextBoot).snap"
        test "$("$TESTSTOOLS"/boot-state bootenv show snap_try_core)" = ""
    fi

    echo "And check there are no errors in the changes list"
    snap changes | NOMATCH '^[0-9]+ +Error'