File: task.yaml

package info (click to toggle)
snapd 2.71-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 79,536 kB
  • sloc: ansic: 16,114; sh: 16,105; python: 9,941; makefile: 1,890; exp: 190; awk: 40; xml: 22
file content (31 lines) | stat: -rw-r--r-- 1,146 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
25
26
27
28
29
30
31
summary: Check the interfaces command

details: |
    The "snap interfaces" command allows looking at plugs and slots in all the
    snaps on the system. The command provides different behavior when invoked
    with a snap name or with an interface name.

environment:
    SNAP_NAME: network-consumer
    PLUG: network

prepare: |
    echo "Given a snap with the $PLUG plug is installed"
    "$TESTSTOOLS"/snaps-state install-local "$SNAP_NAME"

execute: |
    expected="(?s)Slot +Plug\\n\
    :$PLUG .*$SNAP_NAME"

    echo "When the interfaces list is restricted by slot"
    echo "Then only the requested slots are shown"
    snap interfaces -i "$PLUG" | grep -Pzq "$expected"

    echo "When the interfaces list is restricted by slot and snap"
    echo "Then only the requested slots are shown"
    snap interfaces -i "$PLUG" "$SNAP_NAME" | grep -Pzq "$expected"

    echo "Implicit slots are exposed by a snap holding the nickname 'system'"
    echo "but for compatibility they can also be listed when asking for 'core'"
    snap interfaces -i network system | MATCH '^:network .*'
    snap interfaces -i network core | MATCH '^:network .*'