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 (36 lines) | stat: -rw-r--r-- 1,258 bytes parent folder | download | duplicates (5)
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
36
summary: Ensure that the netlink audit interface works.

details: |
    The netlink-audit interface allows read/write to kernel audit system.
    The test-snapd-netlink-audit snap creates a netlink socket and binds it. 

# Ubuntu 14.04: CAP_AUDIT_READ is not available in its kernel
# arch: CONFIG_AUDIT is not enabled in the default kernel
systems: [-ubuntu-14.04-*, -arch-*]

prepare: |
    # Install a snap declaring a plug on netlink-audit
    "$TESTSTOOLS"/snaps-state install-local test-snapd-netlink-audit

execute: |
    echo "The interface is disconnected by default"
    snap interfaces -i netlink-audit | MATCH -- '- +test-snapd-netlink-audit:netlink-audit'

    echo "When the interface is connected"
    snap connect test-snapd-netlink-audit:netlink-audit

    echo "Then the snap is able to create and bind a netlink socket"
    test-snapd-netlink-audit.bind

    if [ "$(snap debug confinement)" = partial ] ; then
        exit 0
    fi

    echo "When the plug is disconnected"
    snap disconnect test-snapd-netlink-audit:netlink-audit

    echo "Then the snap is not able to bind the netlink socket"
    if test-snapd-netlink-audit.bind; then
        echo "Expected permission error creating/binding a netlink socket"
        exit 1
    fi