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 (24 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
summary: Check basic apparmor confinement rules.

details: |
    Check that a strictly confined snap can access paths available to it
    but accesses to paths out of its confinement are denied.

prepare: |
    echo "Given a basic snap is installed"
    "$TESTSTOOLS"/snaps-state install-local test-snapd-sh

execute: |
    if [ "$(snap debug confinement)" = partial ] ; then
        exit 0
    fi
    echo "Then an unconfined action should succeed"
    test-snapd-sh.sh -c 'touch /dev/shm/snap.test-snapd-sh.foo'
    test -f /dev/shm/snap.test-snapd-sh.foo

    echo "Then a confined action should fail"
    if test-snapd-sh.sh -c 'touch /dev/shm/snap.not-test-snapd-sh.foo' 2>touch.error; then
        echo "Expected error"
        exit 1
    fi
    MATCH "touch: cannot touch '/dev/shm/snap.not-test-snapd-sh.foo': Permission denied" <touch.error