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
|
summary: Check that device nodes are available in classic
details: |
This tests that a framebuffer device is accessible in classic and makes
sure that other devices are still accessible (ie, the cgroup is not in
effect).
# Disabled on Fedora, Ubuntu Core and Arch because they don't support classic
# confinement.
systems: [-fedora-*, -ubuntu-core-*, -arch-*, -amazon-*, -centos-*]
prepare: |
# Create framebuffer device node and give it some content we can verify
# the test snap can read.
if [ ! -e /dev/fb0 ]; then
mknod /dev/fb0 c 29 0
touch /dev/fb0.spread
fi
echo "Given a snap declaring a plug on framebuffer is installed in classic"
"$TESTSTOOLS"/snaps-state install-local test-classic-cgroup --classic
restore: |
if [ -e /dev/fb0.spread ]; then
rm -f /dev/fb0 /dev/fb0.spread
fi
execute: |
# classic snaps don't use 'plugs', so just test the accesses after install
echo "the classic snap can access the framebuffer"
SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
"$SNAP_MOUNT_DIR"/bin/test-classic-cgroup.read-fb 2>&1 | NOMATCH '(Permission denied|Operation not permitted)'
echo "the classic snap can access other devices"
test "$("$SNAP_MOUNT_DIR"/bin/test-classic-cgroup.read-kmsg)"
|