Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
tests, integration-tests: port interfaces cli to spread #1382
Merged
Commits
Jump to file or symbol
Failed to load files and symbols.
| @@ -1,47 +0,0 @@ | ||
| -// -*- Mode: Go; indent-tabs-mode: t -*- | ||
| -// +build !excludeintegration | ||
| - | ||
| -/* | ||
| - * Copyright (C) 2016 Canonical Ltd | ||
| - * | ||
| - * This program is free software: you can redistribute it and/or modify | ||
| - * it under the terms of the GNU General Public License version 3 as | ||
| - * published by the Free Software Foundation. | ||
| - * | ||
| - * This program is distributed in the hope that it will be useful, | ||
| - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| - * GNU General Public License for more details. | ||
| - * | ||
| - * You should have received a copy of the GNU General Public License | ||
| - * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| - * | ||
| - */ | ||
| - | ||
| -package tests | ||
| - | ||
| -import ( | ||
| - "fmt" | ||
| - | ||
| - "gopkg.in/check.v1" | ||
| - | ||
| - "github.com/snapcore/snapd/integration-tests/testutils/cli" | ||
| - "github.com/snapcore/snapd/integration-tests/testutils/common" | ||
| -) | ||
| - | ||
| -var _ = check.Suite(&interfacesCliTest{}) | ||
| - | ||
| -type interfacesCliTest struct { | ||
| - common.SnappySuite | ||
| -} | ||
| - | ||
| -// SNAP_INTERFACES_006: snap interfaces -i=<slot> | ||
| -func (s *interfacesCliTest) TestFilterBySlot(c *check.C) { | ||
| - plug := "network" | ||
| - | ||
| - expected := fmt.Sprintf("Slot +Plug\n:%s +-\n", plug) | ||
| - | ||
| - actual := cli.ExecCommand(c, "snap", "interfaces", "-i", plug) | ||
| - | ||
| - c.Assert(actual, check.Matches, expected) | ||
| -} |
| @@ -0,0 +1,35 @@ | ||
| +summary: Check the interfaces command | ||
| + | ||
| +environment: | ||
| + SNAP_NAME: network-consumer | ||
| + SNAP_FILE: "./$[SNAP_NAME]_1.0_all.snap" | ||
| + PLUG: network | ||
| + | ||
| +prepare: | | ||
| + echo "Given a snap with the $PLUG plug is installed" | ||
| + snapbuild ../lib/snaps/$SNAP_NAME . | ||
fgimenez
Contributor
|
||
| + snap install $SNAP_FILE | ||
| + | ||
| +restore: | | ||
| + sudo snap remove $SNAP_NAME | ||
| + rm -f $SNAP_FILE | ||
| + | ||
| +execute: | | ||
| + expected="(?s)Slot +Plug\n\ | ||
| + :$PLUG +$SNAP_NAME" | ||
| + | ||
| + echo "When the interfaces list is restricted by slot" | ||
| + actual=$(snap interfaces -i $PLUG) | ||
| + | ||
| + echo "Then only the requested slots are shown" | ||
| + echo "$actual" | grep -Pzq "$expected" | ||
| + | ||
| + echo "===============================================" | ||
| + | ||
| + echo "When the interfaces list is restricted by slot and snap" | ||
| + actual=$(snap interfaces -i $PLUG $SNAP_NAME) | ||
| + | ||
| + echo "Then only the requested slots are shown" | ||
| + echo "$actual" | grep -Pzq "$expected" | ||
| + | ||
| + echo "===============================================" | ||
The network-consumer snap isn't in here-- note the test failure.