1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_cli_kill_test.go
Vincent Demeester 2227c8ad5e Move some kill integration cli to api tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 15:26:24 +01:00

25 lines
773 B
Go

package main
import (
"strings"
"time"
"github.com/docker/docker/integration-cli/checker"
"github.com/docker/docker/integration-cli/cli"
"github.com/go-check/check"
)
func (s *DockerSuite) TestKillDifferentUserContainer(c *check.C) {
// TODO Windows: Windows does not yet support -u (Feb 2016).
testRequires(c, DaemonIsLinux)
out := cli.DockerCmd(c, "run", "-u", "daemon", "-d", "busybox", "top").Combined()
cleanedContainerID := strings.TrimSpace(out)
cli.WaitRun(c, cleanedContainerID)
cli.DockerCmd(c, "kill", cleanedContainerID)
cli.WaitExited(c, cleanedContainerID, 10*time.Second)
out = cli.DockerCmd(c, "ps", "-q").Combined()
c.Assert(out, checker.Not(checker.Contains), cleanedContainerID, check.Commentf("killed container is still running"))
}