1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Windows: Get Integration CLI running

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard
2015-08-28 10:36:42 -07:00
parent bc915d0856
commit f9a3558a9d
55 changed files with 723 additions and 68 deletions

View File

@ -19,6 +19,7 @@ import (
)
func (s *DockerSuite) TestExec(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
out, _ := dockerCmd(c, "exec", "testing", "cat", "/tmp/file")
@ -30,6 +31,7 @@ func (s *DockerSuite) TestExec(c *check.C) {
}
func (s *DockerSuite) TestExecInteractive(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
execCmd := exec.Command(dockerBinary, "exec", "-i", "testing", "sh")
@ -76,6 +78,7 @@ func (s *DockerSuite) TestExecInteractive(c *check.C) {
}
func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
testRequires(c, DaemonIsLinux)
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
cleanedContainerID := strings.TrimSpace(out)
dockerCmd(c, "restart", cleanedContainerID)
@ -88,6 +91,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
}
func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
testRequires(c, DaemonIsLinux)
testRequires(c, SameHostDaemon)
if err := s.d.StartWithBusybox(); err != nil {
@ -119,6 +123,7 @@ func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
// Regression test for #9155, #9044
func (s *DockerSuite) TestExecEnv(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-e", "LALA=value1", "-e", "LALA=value2",
"-d", "--name", "testing", "busybox", "top")
@ -131,6 +136,7 @@ func (s *DockerSuite) TestExecEnv(c *check.C) {
}
func (s *DockerSuite) TestExecExitStatus(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "top", "busybox", "top")
// Test normal (non-detached) case first
@ -142,6 +148,7 @@ func (s *DockerSuite) TestExecExitStatus(c *check.C) {
}
func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
testRequires(c, DaemonIsLinux)
defer unpauseAllContainers()
out, _ := dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "top")
@ -161,6 +168,7 @@ func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
// regression test for #9476
func (s *DockerSuite) TestExecTtyCloseStdin(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "-it", "--name", "exec_tty_stdin", "busybox")
cmd := exec.Command(dockerBinary, "exec", "-i", "exec_tty_stdin", "cat")
@ -184,6 +192,7 @@ func (s *DockerSuite) TestExecTtyCloseStdin(c *check.C) {
}
func (s *DockerSuite) TestExecTtyWithoutStdin(c *check.C) {
testRequires(c, DaemonIsLinux)
out, _ := dockerCmd(c, "run", "-d", "-ti", "busybox")
id := strings.TrimSpace(out)
c.Assert(waitRun(id), check.IsNil)
@ -217,6 +226,7 @@ func (s *DockerSuite) TestExecTtyWithoutStdin(c *check.C) {
}
func (s *DockerSuite) TestExecParseError(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "top", "busybox", "top")
// Test normal (non-detached) case first
@ -227,6 +237,7 @@ func (s *DockerSuite) TestExecParseError(c *check.C) {
}
func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "top")
if err := exec.Command(dockerBinary, "exec", "testing", "top").Start(); err != nil {
@ -253,6 +264,7 @@ func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
}
func (s *DockerSuite) TestExecCgroup(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "top")
out, _ := dockerCmd(c, "exec", "testing", "cat", "/proc/1/cgroup")
@ -303,6 +315,7 @@ func (s *DockerSuite) TestExecCgroup(c *check.C) {
}
func (s *DockerSuite) TestInspectExecID(c *check.C) {
testRequires(c, DaemonIsLinux)
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
id := strings.TrimSuffix(out, "\n")
@ -388,6 +401,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
}
func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
testRequires(c, DaemonIsLinux)
var out string
out, _ = dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
idA := strings.TrimSpace(out)
@ -517,6 +531,7 @@ func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
}
func (s *DockerSuite) TestExecWithUser(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--name", "parent", "busybox", "top")
out, _ := dockerCmd(c, "exec", "-u", "1", "parent", "id")
@ -531,7 +546,7 @@ func (s *DockerSuite) TestExecWithUser(c *check.C) {
}
func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
testRequires(c, DaemonIsLinux)
// Start main loop which attempts mknod repeatedly
dockerCmd(c, "run", "-d", "--name", "parent", "--cap-drop=ALL", "busybox", "sh", "-c", `while (true); do if [ -e /exec_priv ]; then cat /exec_priv && mknod /tmp/sda b 8 0 && echo "Success"; else echo "Privileged exec has not run yet"; fi; usleep 10000; done`)
@ -569,6 +584,7 @@ func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
}
func (s *DockerSuite) TestExecWithImageUser(c *check.C) {
testRequires(c, DaemonIsLinux)
name := "testbuilduser"
_, err := buildImage(name,
`FROM busybox
@ -588,6 +604,7 @@ func (s *DockerSuite) TestExecWithImageUser(c *check.C) {
}
func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
testRequires(c, DaemonIsLinux)
dockerCmd(c, "run", "-d", "--read-only", "--name", "parent", "busybox", "top")
if _, status := dockerCmd(c, "exec", "parent", "true"); status != 0 {
c.Fatalf("exec into a read-only container failed with exit status %d", status)
@ -596,6 +613,7 @@ func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
// #15750
func (s *DockerSuite) TestExecStartFails(c *check.C) {
testRequires(c, DaemonIsLinux)
name := "exec-15750"
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")