Files
snapd/tests/main/interfaces-cli/task.yaml
Sergio Cazzolato ad6f356d20 Update documentation and checks for interfaces tests
This change adds extra self documentation and improbe organization and
checks for interfaces tests.
2021-03-09 15:49:02 -03:00

27 lines
929 B
YAML

summary: Check the interfaces command
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 .*'