summaryrefslogtreecommitdiff
diff options
-rw-r--r--cmd/snap/cmd_debug_state_test.go36
1 files changed, 16 insertions, 20 deletions
diff --git a/cmd/snap/cmd_debug_state_test.go b/cmd/snap/cmd_debug_state_test.go
index 905441be35..c9a4bb177b 100644
--- a/cmd/snap/cmd_debug_state_test.go
+++ b/cmd/snap/cmd_debug_state_test.go
@@ -454,20 +454,18 @@ func (s *SnapSuite) TestDebugConnectionPlugAndSlot(c *C) {
stateFile := filepath.Join(dir, "test-state.json")
c.Assert(ioutil.WriteFile(stateFile, stateConnsJSON, 0644), IsNil)
- for i, connArg := range []string{"gnome-calculator:network,core:network"} {
- s.ResetStdStreams()
- rest, err := main.Parser(main.Client()).ParseArgs([]string{"debug", "state", fmt.Sprintf("--connection=%s", connArg), stateFile})
- c.Assert(err, IsNil)
- c.Assert(rest, DeepEquals, []string{})
- c.Check(s.Stdout(), Matches,
- "id: gnome-calculator:network core:network\n"+
- "auto: true\n"+
- "by-gadget: false\n"+
- "interface: network\n"+
- "undesired: false\n"+
- "\n", Commentf("#%d: %s", i, connArg))
- c.Check(s.Stderr(), Equals, "")
- }
+ connArg := "gnome-calculator:network,core:network"
+ rest, err := main.Parser(main.Client()).ParseArgs([]string{"debug", "state", fmt.Sprintf("--connection=%s", connArg), stateFile})
+ c.Assert(err, IsNil)
+ c.Assert(rest, DeepEquals, []string{})
+ c.Check(s.Stdout(), Matches,
+ "id: gnome-calculator:network core:network\n"+
+ "auto: true\n"+
+ "by-gadget: false\n"+
+ "interface: network\n"+
+ "undesired: false\n"+
+ "\n", Commentf("#0: %s", connArg))
+ c.Check(s.Stderr(), Equals, "")
}
func (s *SnapSuite) TestDebugConnectionInvalidCombination(c *C) {
@@ -475,12 +473,10 @@ func (s *SnapSuite) TestDebugConnectionInvalidCombination(c *C) {
stateFile := filepath.Join(dir, "test-state.json")
c.Assert(ioutil.WriteFile(stateFile, stateConnsJSON, 0644), IsNil)
- for _, connArg := range []string{"gnome-calculator,core:network"} {
- s.ResetStdStreams()
- _, err := main.Parser(main.Client()).ParseArgs([]string{"debug", "state", fmt.Sprintf("--connection=%s", connArg), stateFile})
- c.Assert(err, ErrorMatches, fmt.Sprintf("invalid command with connection args: %s", connArg))
- c.Check(s.Stdout(), Equals, "")
- }
+ connArg := "gnome-calculator,core:network"
+ _, err := main.Parser(main.Client()).ParseArgs([]string{"debug", "state", fmt.Sprintf("--connection=%s", connArg), stateFile})
+ c.Assert(err, ErrorMatches, fmt.Sprintf("invalid command with connection args: %s", connArg))
+ c.Check(s.Stdout(), Equals, "")
}
func (s *SnapSuite) TestDebugConnectionDetailsMany(c *C) {