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
|
summary: trivial snap with classic confinement runs correctly
details: |
This test checks that a very much trivial "hello-world"-like snap using
classic confinement can be executed correctly. There are two variants of
this test (classic and jailmode) and the snap (this particular one) should
function correctly in both cases.
systems: [-ubuntu-core-*]
prepare: |
case "$SPREAD_SYSTEM" in
fedora-*|arch-*|centos-*)
# although classic snaps do not work out of the box on fedora,
# we still want to verify if the basics do work if the user
# symlinks /snap to $SNAP_MOUNT_DIR themselves
SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
ln -sf "$SNAP_MOUNT_DIR" /snap
;;
esac
restore: |
case "$SPREAD_SYSTEM" in
fedora-*|arch-*|centos-*)
rm -f /snap
;;
esac
execute: |
snap install --classic test-snapd-hello-classic
SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
"$SNAP_MOUNT_DIR/bin/test-snapd-hello-classic" | MATCH 'Hello Classic!'
TMPDIR=/tmpdir "$SNAP_MOUNT_DIR/bin/test-snapd-hello-classic" t | MATCH TMPDIR=/tmpdir
if [ "$(snap debug confinement)" = partial ]; then
exit 0
fi
# Instal again and put the snap into jailmode
snap remove --purge test-snapd-hello-classic
snap install --classic --jailmode test-snapd-hello-classic
"$SNAP_MOUNT_DIR/bin/test-snapd-hello-classic" | MATCH 'Hello Classic!'
|