return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io> Upstream-commit: 416613f2e54581c62d3efa1c4f0288b6e7d58365 Component: engine
This commit is contained in:
28
components/engine/integration-cli/docker_cli_stack_test.go
Normal file
28
components/engine/integration-cli/docker_cli_stack_test.go
Normal file
@ -0,0 +1,28 @@
|
||||
// +build experimental
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
|
||||
d := s.AddDaemon(c, true, true)
|
||||
|
||||
stackArgs := append([]string{"remove", "UNKNOWN_STACK"})
|
||||
|
||||
out, err := d.Cmd("stack", stackArgs...)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, check.Equals, "Nothing found in stack: UNKNOWN_STACK\n")
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackTasks(c *check.C) {
|
||||
d := s.AddDaemon(c, true, true)
|
||||
|
||||
stackArgs := append([]string{"tasks", "UNKNOWN_STACK"})
|
||||
|
||||
out, err := d.Cmd("stack", stackArgs...)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(out, check.Equals, "Nothing found in stack: UNKNOWN_STACK\n")
|
||||
}
|
||||
Reference in New Issue
Block a user