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 (49 lines) | stat: -rw-r--r-- 1,613 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
summary: Ensure the snapd works without core on classic systems

details: |
    Check that snapd can be installed without the core snap on classic
    systems and that commands can re-exec into snapd.

# Run only on ubuntu classic because this re-execs. We have a
# separate test for UC18 already and on UC16 we always have a core
# snap so we don't need to test there.
systems: [ubuntu-1*-64, ubuntu-2*-64]

environment:
    # uploading large snap triggers OOM
    SNAPD_NO_MEMORY_LIMIT: 1

restore: |
    rm -f /tmp/snapd_*.snap

execute: |
    if [ "${SNAP_REEXEC:-}" = "0" ]; then
        echo "skipping test when SNAP_REEXEC is disabled"
        exit 0
    fi

    echo "Create modified snapd snap"
    #shellcheck source=tests/lib/prepare.sh
    . "$TESTSLIB"/prepare.sh
    build_snapd_snap /tmp

    echo "Ensure core is gone so that we can have snapd"
    #shellcheck source=tests/lib/pkgdb.sh
    . "$TESTSLIB"/pkgdb.sh
    distro_purge_package snapd
    distro_install_build_snapd
    snap list | not grep ^"core "

    echo "Install the snapd snap"
    snap install --dangerous /tmp/snapd_*.snap
    echo "Ensure we restarted into the snapd snap"
    "$TESTSTOOLS"/journal-state match-log  'restarting into "/snap/snapd/'

    echo "Now install a core18 based snap and ensure it works"
    snap install test-snapd-sh-core18
    test-snapd-sh-core18.sh -c 'echo hello' | MATCH hello
    echo "No core was installed"
    snap list | not grep ^"core "

    echo "Ensure we re-exec to the snapd snap"
    SNAPD_DEBUG=1 test-snapd-sh-core18.sh -c 'true' 2>&1 | MATCH 'restarting into "/snap/snapd/current'