mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
2227c8ad5e
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
25 lines
773 B
Go
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"))
|
|
|
|
}
|