1
summary: Check that snap-discard-ns works
2
# This is blacklisted on debian because debian doesn't use apparmor yet
5
The internal snap-discard-ns program is supposed to simply unmount
6
whatever is mounted at /run/snapd/ns/$SNAP_NAME.mnt
8
mkdir -p /run/snapd/ns/
9
mount --bind /run/snapd/ns /run/snapd/ns
10
mount --make-private /run/snapd/ns
11
touch /run/snapd/ns/foo.mnt
12
unshare --mount=/run/snapd/ns/foo.mnt true
14
/usr/lib/snapd/snap-discard-ns foo
15
! grep foo.mnt /proc/self/mountinfo
17
umount /run/snapd/ns/foo.mnt || :
19
rm /run/snapd/ns/foo.mnt
20
rm /run/snapd/ns/foo.lock
21
# The removal is optional as the directory may contain other files
22
# that we don't want to touch here.
23
rmdir /run/snapd/ns || true