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:
Lei Jitang
2015-10-28 21:00:09 -04:00
parent d8b43fba9e
commit 8ca5c39620
5 changed files with 32 additions and 0 deletions

View File

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