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 (43 lines) | stat: -rw-r--r-- 2,052 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
summary: Check that default tracks work

details: |
    A snap publisher can set a default track for their snap that is different from latest.
    This default track can change over time. With this a snap publisher can have versioned
    tracks, with default pointing to whatever is the most recent stable (meaning somebody
    doing snap install will always get that most recent stable version).

    This test verifies by checking in the state.json file that when we install a snap with
    a default track called 'default' it is properly installed from that track . It is also
    checked the default track is used when parallel installs are performed.

environment:
    A_SNAP: test-snapd-default-track
    A_TRACK: default

execute: |
    # first, precondition check that the snap has a default track
    "$TESTSTOOLS/simpleget" -H "Snap-Device-Series: 16" "https://api.snapcraft.io/v2/snaps/info/$A_SNAP" -o info
    test "$( gojq -r '."default-track"' < info )" == "$A_TRACK"

    # TODO: check the output of 'snap info' for the default-track-having snap
    # once that works as expected (order of tracks is wrong right now)

    # TODO: check error output when trying to install from [default]/stable

    # now install a snap that has a default track
    # (and you got candidate from the default track)
    snap install --candidate "$A_SNAP" | MATCH "$A_TRACK/candidate"
    "$TESTSTOOLS"/snapd-state check-state ".data.snaps.\"$A_SNAP\".channel" = "$A_TRACK/candidate"

    snap remove --purge "$A_SNAP"

    # now try a multi-install
    snap install "$A_SNAP" "test-snapd-tools"
    # you get stable from the default track
    "$TESTSTOOLS"/snapd-state check-state ".data.snaps.\"$A_SNAP\".channel" = "$A_TRACK/stable"

    # now another
    snap set core experimental.parallel-instances=true
    snap install "${A_SNAP}_a" "${A_SNAP}_b"
    "$TESTSTOOLS"/snapd-state check-state ".data.snaps.\"${A_SNAP}_a\".channel" = "$A_TRACK/stable"
    "$TESTSTOOLS"/snapd-state check-state ".data.snaps.\"${A_SNAP}_b\".channel" = "$A_TRACK/stable"