1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

return err when stack name does not exist

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-06-29 01:39:49 +08:00
parent bd37b83052
commit 416613f2e5
6 changed files with 44 additions and 3 deletions

View 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")
}