mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows CI: Deal with failing tests for TP4
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
719526d87c
commit
25c383391a
10 changed files with 34 additions and 8 deletions
|
@ -1311,7 +1311,7 @@ func (s *DockerSuite) TestContainersApiCreateNoHostConfig118(c *check.C) {
|
||||||
func (s *DockerSuite) TestPutContainerArchiveErrSymlinkInVolumeToReadOnlyRootfs(c *check.C) {
|
func (s *DockerSuite) TestPutContainerArchiveErrSymlinkInVolumeToReadOnlyRootfs(c *check.C) {
|
||||||
// Requires local volume mount bind.
|
// Requires local volume mount bind.
|
||||||
// --read-only + userns has remount issues
|
// --read-only + userns has remount issues
|
||||||
testRequires(c, SameHostDaemon, NotUserNamespace)
|
testRequires(c, SameHostDaemon, NotUserNamespace, DaemonIsLinux)
|
||||||
|
|
||||||
testVol := getTestDir(c, "test-put-container-archive-err-symlink-in-volume-to-read-only-rootfs-")
|
testVol := getTestDir(c, "test-put-container-archive-err-symlink-in-volume-to-read-only-rootfs-")
|
||||||
defer os.RemoveAll(testVol)
|
defer os.RemoveAll(testVol)
|
||||||
|
@ -1392,6 +1392,7 @@ func (s *DockerSuite) TestStartWithNilDNS(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestPostContainersCreateShmSizeNegative(c *check.C) {
|
func (s *DockerSuite) TestPostContainersCreateShmSizeNegative(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
"HostConfig": map[string]interface{}{"ShmSize": -1},
|
"HostConfig": map[string]interface{}{"ShmSize": -1},
|
||||||
|
@ -1404,6 +1405,7 @@ func (s *DockerSuite) TestPostContainersCreateShmSizeNegative(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestPostContainersCreateShmSizeHostConfigOmitted(c *check.C) {
|
func (s *DockerSuite) TestPostContainersCreateShmSizeHostConfigOmitted(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
var defaultSHMSize int64 = 67108864
|
var defaultSHMSize int64 = 67108864
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
|
@ -1434,6 +1436,7 @@ func (s *DockerSuite) TestPostContainersCreateShmSizeHostConfigOmitted(c *check.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestPostContainersCreateShmSizeOmitted(c *check.C) {
|
func (s *DockerSuite) TestPostContainersCreateShmSizeOmitted(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
"HostConfig": map[string]interface{}{},
|
"HostConfig": map[string]interface{}{},
|
||||||
|
@ -1464,6 +1467,7 @@ func (s *DockerSuite) TestPostContainersCreateShmSizeOmitted(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestPostContainersCreateWithShmSize(c *check.C) {
|
func (s *DockerSuite) TestPostContainersCreateWithShmSize(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
"Cmd": "mount",
|
"Cmd": "mount",
|
||||||
|
@ -1494,6 +1498,7 @@ func (s *DockerSuite) TestPostContainersCreateWithShmSize(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestPostContainersCreateMemorySwappinessHostConfigOmitted(c *check.C) {
|
func (s *DockerSuite) TestPostContainersCreateMemorySwappinessHostConfigOmitted(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
config := map[string]interface{}{
|
config := map[string]interface{}{
|
||||||
"Image": "busybox",
|
"Image": "busybox",
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@ func (s *DockerSuite) TestExecApiCreateContainerPaused(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestExecAPIStart(c *check.C) {
|
func (s *DockerSuite) TestExecAPIStart(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux) // Uses pause/unpause but bits may be salvagable to Windows to Windows CI
|
||||||
dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
|
dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
|
||||||
|
|
||||||
startExec := func(id string, code int) {
|
startExec := func(id string, code int) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ func (s *DockerSuite) TestInspectApiContainerResponse(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectApiContainerVolumeDriverLegacy(c *check.C) {
|
func (s *DockerSuite) TestInspectApiContainerVolumeDriverLegacy(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
|
out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
|
@ -111,6 +112,7 @@ func (s *DockerSuite) TestInspectApiImageResponse(c *check.C) {
|
||||||
|
|
||||||
// #17131, #17139, #17173
|
// #17131, #17139, #17173
|
||||||
func (s *DockerSuite) TestInspectApiEmptyFieldsInConfigPre121(c *check.C) {
|
func (s *DockerSuite) TestInspectApiEmptyFieldsInConfigPre121(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
|
out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
|
||||||
|
|
||||||
cleanedContainerID := strings.TrimSpace(out)
|
cleanedContainerID := strings.TrimSpace(out)
|
||||||
|
@ -133,6 +135,7 @@ func (s *DockerSuite) TestInspectApiEmptyFieldsInConfigPre121(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectApiBridgeNetworkSettings120(c *check.C) {
|
func (s *DockerSuite) TestInspectApiBridgeNetworkSettings120(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||||
containerID := strings.TrimSpace(out)
|
containerID := strings.TrimSpace(out)
|
||||||
waitRun(containerID)
|
waitRun(containerID)
|
||||||
|
@ -148,6 +151,7 @@ func (s *DockerSuite) TestInspectApiBridgeNetworkSettings120(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectApiBridgeNetworkSettings121(c *check.C) {
|
func (s *DockerSuite) TestInspectApiBridgeNetworkSettings121(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
|
||||||
containerID := strings.TrimSpace(out)
|
containerID := strings.TrimSpace(out)
|
||||||
waitRun(containerID)
|
waitRun(containerID)
|
||||||
|
|
|
@ -153,6 +153,7 @@ func (s *DockerSuite) TestAttachDisconnect(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestAttachPausedContainer(c *check.C) {
|
func (s *DockerSuite) TestAttachPausedContainer(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux) // Containers cannot be paused on Windows
|
||||||
defer unpauseAllContainers()
|
defer unpauseAllContainers()
|
||||||
dockerCmd(c, "run", "-d", "--name=test", "busybox", "top")
|
dockerCmd(c, "run", "-d", "--name=test", "busybox", "top")
|
||||||
dockerCmd(c, "pause", "test")
|
dockerCmd(c, "pause", "test")
|
||||||
|
|
|
@ -561,7 +561,7 @@ func (s *DockerSuite) TestCpToStdout(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
|
func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
|
||||||
testRequires(c, SameHostDaemon)
|
testRequires(c, SameHostDaemon, DaemonIsLinux)
|
||||||
|
|
||||||
out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /te:s:t")
|
out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /te:s:t")
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
||||||
// TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and
|
// TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and
|
||||||
// `--cluster-store` properly show the backend's endpoint in info output.
|
// `--cluster-store` properly show the backend's endpoint in info output.
|
||||||
func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
|
func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
|
||||||
testRequires(c, SameHostDaemon)
|
testRequires(c, SameHostDaemon, DaemonIsLinux)
|
||||||
|
|
||||||
d := NewDaemon(c)
|
d := NewDaemon(c)
|
||||||
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
||||||
|
@ -61,7 +61,7 @@ func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
|
||||||
// TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with
|
// TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with
|
||||||
// an invalid `--cluster-advertise` configuration
|
// an invalid `--cluster-advertise` configuration
|
||||||
func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
|
func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
|
||||||
testRequires(c, SameHostDaemon)
|
testRequires(c, SameHostDaemon, DaemonIsLinux)
|
||||||
|
|
||||||
d := NewDaemon(c)
|
d := NewDaemon(c)
|
||||||
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
||||||
|
@ -78,7 +78,7 @@ func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
|
||||||
// TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise`
|
// TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise`
|
||||||
// configured with interface name properly show the advertise ip-address in info output.
|
// configured with interface name properly show the advertise ip-address in info output.
|
||||||
func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) {
|
func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) {
|
||||||
testRequires(c, SameHostDaemon, Network)
|
testRequires(c, SameHostDaemon, Network, DaemonIsLinux)
|
||||||
|
|
||||||
d := NewDaemon(c)
|
d := NewDaemon(c)
|
||||||
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
discoveryBackend := "consul://consuladdr:consulport/some/path"
|
||||||
|
|
|
@ -380,6 +380,7 @@ func (s *DockerSuite) TestInspectStopWhenNotFound(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectHistory(c *check.C) {
|
func (s *DockerSuite) TestInspectHistory(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
dockerCmd(c, "run", "--name=testcont", "-d", "busybox", "top")
|
dockerCmd(c, "run", "--name=testcont", "-d", "busybox", "top")
|
||||||
dockerCmd(c, "commit", "-m", "test comment", "testcont", "testimg")
|
dockerCmd(c, "commit", "-m", "test comment", "testcont", "testimg")
|
||||||
out, _, err := dockerCmdWithError("inspect", "--format='{{.Comment}}'", "testimg")
|
out, _, err := dockerCmdWithError("inspect", "--format='{{.Comment}}'", "testimg")
|
||||||
|
|
|
@ -58,3 +58,10 @@ func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
||||||
c.Assert(actions[len(actions)-1], checker.Equals, "unpause")
|
c.Assert(actions[len(actions)-1], checker.Equals, "unpause")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *DockerSuite) TestPauseFailsOnWindows(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsWindows)
|
||||||
|
dockerCmd(c, "run", "-d", "--name=test", "busybox", "sleep 3")
|
||||||
|
out, _, _ := dockerCmdWithError("pause", "test")
|
||||||
|
c.Assert(out, checker.Contains, "Windows: Containers cannot be paused")
|
||||||
|
}
|
||||||
|
|
|
@ -3731,14 +3731,20 @@ func (s *DockerSuite) TestRunNonExistingCmd(c *check.C) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestCmdCannotBeInvoked checks that 'docker run busybox /etc' exits with 126.
|
// TestCmdCannotBeInvoked checks that 'docker run busybox /etc' exits with 126, or
|
||||||
|
// 127 on Windows. The difference is that in Windows, the container must be started
|
||||||
|
// as that's when the check is made (and yes, by it's design...)
|
||||||
func (s *DockerSuite) TestCmdCannotBeInvoked(c *check.C) {
|
func (s *DockerSuite) TestCmdCannotBeInvoked(c *check.C) {
|
||||||
|
expected := 126
|
||||||
|
if daemonPlatform == "windows" {
|
||||||
|
expected = 127
|
||||||
|
}
|
||||||
name := "testCmdCannotBeInvoked"
|
name := "testCmdCannotBeInvoked"
|
||||||
runCmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "/etc")
|
runCmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "/etc")
|
||||||
_, exit, _ := runCommandWithOutput(runCmd)
|
_, exit, _ := runCommandWithOutput(runCmd)
|
||||||
stateExitCode := findContainerExitCode(c, name)
|
stateExitCode := findContainerExitCode(c, name)
|
||||||
if !(exit == 126 && strings.Contains(stateExitCode, "126")) {
|
if !(exit == expected && strings.Contains(stateExitCode, strconv.Itoa(expected))) {
|
||||||
c.Fatalf("Run cmd that cannot be invoked should have errored with code 126, but we got exit: %d, State.ExitCode: %s", exit, stateExitCode)
|
c.Fatalf("Run cmd that cannot be invoked should have errored with code %d, but we got exit: %d, State.ExitCode: %s", expected, exit, stateExitCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ func (s *DockerSuite) TestSaveSingleTag(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestSaveCheckTimes(c *check.C) {
|
func (s *DockerSuite) TestSaveCheckTimes(c *check.C) {
|
||||||
|
testRequires(c, DaemonIsLinux)
|
||||||
repoName := "busybox:latest"
|
repoName := "busybox:latest"
|
||||||
out, _ := dockerCmd(c, "inspect", repoName)
|
out, _ := dockerCmd(c, "inspect", repoName)
|
||||||
data := []struct {
|
data := []struct {
|
||||||
|
|
Loading…
Reference in a new issue