github.com/kubiko/snapd@v0.0.0-20201013125620-d4f3094d9ddf/cmd/snap-confine/spread-tests/main/hostfs-created-on-demand/task.yaml (about) 1 summary: Check that /var/lib/snapd/hostfs is created on demand 2 # This is blacklisted on debian because debian doesn't use apparmor yet 3 systems: [-debian-8] 4 details: | 5 The /var/lib/snapd/hostfs directory is created by snap-confine 6 if the host packaging of snapd doesn't already provide it. 7 prepare: | 8 echo "Having installed the snapd-hacker-toolbelt snap" 9 snap install snapd-hacker-toolbelt 10 echo "We can move the packaged hostfs directory aside" 11 if [ -d /var/lib/snapd/hostfs ]; then 12 mv /var/lib/snapd/hostfs /var/lib/snapd/hostfs.orig 13 fi 14 execute: | 15 cd / 16 echo "We can now run a busybox true just to ensure it started correctly" 17 /snap/bin/snapd-hacker-toolbelt.busybox true 18 echo "We can now check that the directory was created on the system" 19 test -d /var/lib/snapd/hostfs 20 restore: | 21 snap remove --purge snapd-hacker-toolbelt 22 if [ -d /var/lib/snapd/hostfs.orig ]; then 23 mv /var/lib/snapd/hostfs.orig /var/lib/snapd/hostfs 24 fi