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 (34 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download | duplicates (3)
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
summary: Ensure that the basic devpts security rules are in place.

details: |
    Test that a snap which has a plug for the physical-memory-observe interface
    can read /dev/pts, can openpty, and can access the PTY via /dev/ptmx, both
    with and without the physical-memory-observe interface connected.

execute: |
    if [ "$(snap debug confinement)" = none ] ; then
        exit 0
    fi

    echo "Given a basic snap is installed"
    "$TESTSTOOLS"/snaps-state install-local test-snapd-devpts

    echo "When no plugs are not connected"
    if snap interfaces -i physical-memory-observe | MATCH ":physical-memory-observe .*test-snapd-devpts" ; then
        snap disconnect test-snapd-devpts:physical-memory-observe
    fi

    echo "Then can openpty"
    test-snapd-devpts.openpty | MATCH PASS

    echo "Then can access slave PTY"
    test-snapd-devpts.useptmx | MATCH PASS

    echo "When a udev tagging plug is connected"
    snap connect test-snapd-devpts:physical-memory-observe

    echo "Then can openpty"
    test-snapd-devpts.openpty | MATCH PASS

    echo "Then can access slave PTY"
    test-snapd-devpts.useptmx | MATCH PASS