Add show error when attach to a paused container
Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: de1d611990a80cf4a38ec501469c08c1aeee2d60 Component: engine
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@ -150,3 +151,12 @@ func (s *DockerSuite) TestAttachDisconnect(c *check.C) {
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(running, check.Equals, "true")
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestAttachPausedContainer(c *check.C) {
|
||||
defer unpauseAllContainers()
|
||||
dockerCmd(c, "run", "-d", "--name=test", "busybox", "top")
|
||||
dockerCmd(c, "pause", "test")
|
||||
out, _, err := dockerCmdWithError("attach", "test")
|
||||
c.Assert(err, checker.NotNil, check.Commentf(out))
|
||||
c.Assert(out, checker.Contains, "You cannot attach to a paused container, unpause it first")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user