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 .*'
|