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
|
summary: Checks for parallel installation of snaps from the store
details: |
Snapd allows installation of the same snap more than once by combining the
same snap name with different values of an instance key.
The test checks that snapd can successfully install snaps, as parallel
instances, from the snap store, to ensure that the store is not confused by
the presence of the instance key.
restore: |
snap set system experimental.parallel-instances=
execute: |
not snap install test-snapd-tools_foo 2> run.err
MATCH 'experimental feature disabled' < run.err
snap set system experimental.parallel-instances=true
snap install test-snapd-tools_foo | MATCH '^test-snapd-tools_foo .* installed'
echo "The snap is listed"
snap list | MATCH '^test-snapd-tools_foo '
echo "The snap application can be run"
#shellcheck disable=SC2016
test-snapd-tools_foo.cmd sh -c 'echo hello data from $SNAP_INSTANCE_NAME > $SNAP_DATA/data'
MATCH 'hello data from test-snapd-tools_foo' < /var/snap/test-snapd-tools_foo/current/data
su -l -c "test-snapd-tools_foo.cmd sh -c 'echo hello user data from \$SNAP_INSTANCE_NAME > \$SNAP_USER_DATA/data'" test
MATCH 'hello user data from test-snapd-tools_foo' < /home/test/snap/test-snapd-tools_foo/current/data
echo "Installing another instance, without instance key, succeeds"
snap install test-snapd-tools
echo "And so does another one, but with different instance key"
snap install test-snapd-tools_bar
echo "Installing more than one instance at a time works too"
snap install test-snapd-tools_baz test-snapd-tools_zed
|