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 (40 lines) | stat: -rw-r--r-- 1,500 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
summary: Ensure `snap debug bootvars` command works

details: |
    This test checks the command `snap debug bootvars` displays
    correct boot variables information.

debug: |
    cat default.out || true
    cat uc20.out || true
    cat run.out || true
    cat recovery.out || true

execute: |
    # does not outright fail
    snap debug boot-vars  > default.out

    if os.query is-core-ge 20; then
        echo "Check the boot-vars default output looks sane"
        # boot-vars default output is for the run mode bootloader, make sure its
        # output looks sane (though we don't expect any of the variables to be
        # set)
        MATCH 'kernel_status=$' < default.out

        snap debug boot-vars --uc20 > uc20.out
        snap debug boot-vars --root-dir /run/mnt/ubuntu-boot > run.out
        # the no-parameters output and explicit --uc20 should be the same
        diff -up default.out uc20.out
        # default shows a run mode bootloader variables, so the output shall be
        # identical again
        diff -up default.out run.out

        # try the recovery bootloader now
        snap debug boot-vars --root-dir /run/mnt/ubuntu-seed > recovery.out
        MATCH 'snapd_recovery_mode=run' < recovery.out
    else
        MATCH "snap_core=$(snaps.name core)_.*\.snap" < default.out
        MATCH "snap_kernel=$(snaps.name kernel)_.*\.snap" < default.out
        # relevant snaps are not being updated, so snap_mode is unset
        MATCH 'snap_mode=$' < default.out
    fi