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"
|