File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (35 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download | duplicates (4)
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)"