Windows: Start of enabling tests under integration/
- Add windows CI entrypoint script. Signed-off-by: John Howard <jhoward@microsoft.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm> Signed-off-by: Daniel Nephin <dnephin@docker.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm> (cherry picked from commit d3cc071bb98669545d4e3043c9bd85879292b815) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 59be98043a02f44b63b26f159461fed08292e027 Component: engine
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
97ead3de83
commit
171a95c777
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
dclient "github.com/docker/docker/client"
|
||||
"github.com/docker/docker/internal/test/daemon"
|
||||
"github.com/docker/docker/internal/test/fakecontext"
|
||||
"github.com/docker/docker/internal/test/request"
|
||||
"github.com/moby/buildkit/session"
|
||||
@@ -20,7 +21,11 @@ import (
|
||||
)
|
||||
|
||||
func TestBuildWithSession(t *testing.T) {
|
||||
skip.If(t, !testEnv.DaemonInfo.ExperimentalBuild)
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
d := daemon.New(t, daemon.WithExperimental)
|
||||
d.StartWithBusybox(t)
|
||||
defer d.Stop(t)
|
||||
|
||||
client := testEnv.APIClient()
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/integration/internal/container"
|
||||
"github.com/docker/docker/internal/test/daemon"
|
||||
"github.com/docker/docker/internal/test/fakecontext"
|
||||
"github.com/docker/docker/pkg/stdcopy"
|
||||
"gotest.tools/assert"
|
||||
@@ -18,7 +19,11 @@ import (
|
||||
)
|
||||
|
||||
func TestBuildSquashParent(t *testing.T) {
|
||||
skip.If(t, !testEnv.DaemonInfo.ExperimentalBuild)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
d := daemon.New(t, daemon.WithExperimental)
|
||||
d.StartWithBusybox(t)
|
||||
defer d.Stop(t)
|
||||
|
||||
client := testEnv.APIClient()
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
@@ -22,6 +23,7 @@ import (
|
||||
)
|
||||
|
||||
func TestBuildWithRemoveAndForceRemove(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
t.Parallel()
|
||||
cases := []struct {
|
||||
@@ -137,6 +139,7 @@ func buildContainerIdsFilter(buildOutput io.Reader) (filters.Args, error) {
|
||||
|
||||
func TestBuildMultiStageParentConfig(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
dockerfile := `
|
||||
FROM busybox AS stage0
|
||||
ENV WHO=parent
|
||||
@@ -166,10 +169,20 @@ func TestBuildMultiStageParentConfig(t *testing.T) {
|
||||
resp.Body.Close()
|
||||
assert.NilError(t, err)
|
||||
|
||||
time.Sleep(30 * time.Second)
|
||||
|
||||
imgs, err := apiclient.ImageList(ctx, types.ImageListOptions{})
|
||||
assert.NilError(t, err)
|
||||
t.Log(imgs)
|
||||
|
||||
image, _, err := apiclient.ImageInspectWithRaw(ctx, "build1")
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Check(t, is.Equal("/foo/sub2", image.Config.WorkingDir))
|
||||
expected := "/foo/sub2"
|
||||
if testEnv.DaemonInfo.OSType == "windows" {
|
||||
expected = `C:\foo\sub2`
|
||||
}
|
||||
assert.Check(t, is.Equal(expected, image.Config.WorkingDir))
|
||||
assert.Check(t, is.Contains(image.Config.Env, "WHO=parent"))
|
||||
}
|
||||
|
||||
@@ -282,6 +295,7 @@ func TestBuildWithEmptyLayers(t *testing.T) {
|
||||
// #35652
|
||||
func TestBuildMultiStageOnBuild(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.33"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
// test both metadata and layer based commands as they may be implemented differently
|
||||
dockerfile := `FROM busybox AS stage1
|
||||
@@ -289,7 +303,8 @@ ONBUILD RUN echo 'foo' >somefile
|
||||
ONBUILD ENV bar=baz
|
||||
|
||||
FROM stage1
|
||||
RUN cat somefile # fails if ONBUILD RUN fails
|
||||
# fails if ONBUILD RUN fails
|
||||
RUN cat somefile
|
||||
|
||||
FROM stage1
|
||||
RUN cat somefile`
|
||||
@@ -327,6 +342,8 @@ RUN cat somefile`
|
||||
// #35403 #36122
|
||||
func TestBuildUncleanTarFilenames(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
|
||||
ctx := context.TODO()
|
||||
defer setupTest(t)()
|
||||
|
||||
@@ -385,6 +402,7 @@ COPY bar /`
|
||||
// docker/for-linux#135
|
||||
// #35641
|
||||
func TestBuildMultiStageLayerLeak(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
|
||||
ctx := context.TODO()
|
||||
defer setupTest(t)()
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func TestConfigList(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -102,7 +102,7 @@ func createConfig(ctx context.Context, t *testing.T, client client.APIClient, na
|
||||
}
|
||||
|
||||
func TestConfigsCreateAndDelete(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -130,7 +130,7 @@ func TestConfigsCreateAndDelete(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestConfigsUpdate(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -184,6 +184,7 @@ func TestConfigsUpdate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTemplatedConfig(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
client := d.NewClientT(t)
|
||||
@@ -323,7 +324,7 @@ func waitAndAssert(t *testing.T, timeout time.Duration, f func(*testing.T) bool)
|
||||
}
|
||||
|
||||
func TestConfigInspect(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
func TestCopyFromContainerPathDoesNotExist(t *testing.T) {
|
||||
defer setupTest(t)()
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
|
||||
ctx := context.Background()
|
||||
apiclient := testEnv.APIClient()
|
||||
|
||||
@@ -103,7 +103,7 @@ func TestCreateWithInvalidEnv(t *testing.T) {
|
||||
|
||||
// Test case for #30166 (target was not validated)
|
||||
func TestCreateTmpfsMountsTarget(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -28,6 +28,8 @@ import (
|
||||
// container again.
|
||||
func TestContainerStartOnDaemonRestart(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon(), "cannot start daemon on remote test run")
|
||||
t.Parallel()
|
||||
|
||||
d := daemon.New(t)
|
||||
|
||||
@@ -11,9 +11,11 @@ import (
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"gotest.tools/assert"
|
||||
"gotest.tools/poll"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
func TestDiff(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -86,6 +86,7 @@ func TestExecWithCloseStdin(t *testing.T) {
|
||||
|
||||
func TestExec(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.35"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME. Probably needs to wait for container to be in running state.")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
// export an image and try to import it into a new one
|
||||
func TestExportContainerAndImportImage(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
@@ -58,7 +58,7 @@ func TestExportContainerAndImportImage(t *testing.T) {
|
||||
// can be exported (as reported in #36561). To satisfy this
|
||||
// condition, daemon restart is needed after container creation.
|
||||
func TestExportContainerAfterDaemonRestart(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
|
||||
d := daemon.New(t)
|
||||
|
||||
@@ -11,11 +11,13 @@ import (
|
||||
"github.com/docker/docker/integration/internal/container"
|
||||
"github.com/docker/docker/internal/test/request"
|
||||
"gotest.tools/poll"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
// TestHealthCheckWorkdir verifies that health-checks inherit the containers'
|
||||
// working-dir.
|
||||
func TestHealthCheckWorkdir(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func TestInspectCpusetInConfigPre120(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || !testEnv.DaemonInfo.CPUSet)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || !testEnv.DaemonInfo.CPUSet)
|
||||
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t, client.WithVersion("1.19"))
|
||||
|
||||
@@ -31,6 +31,7 @@ func TestKillContainerInvalidSignal(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestKillContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "TODO Windows: FIXME. No SIGWINCH")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -70,7 +71,7 @@ func TestKillContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestKillWithStopSignalAndRestartPolicies(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType != "linux", "Windows only supports 1.25 or later")
|
||||
skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -110,7 +111,7 @@ func TestKillWithStopSignalAndRestartPolicies(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestKillStoppedContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType != "linux") // Windows only supports 1.25 or later
|
||||
skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
@@ -121,7 +122,7 @@ func TestKillStoppedContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestKillStoppedContainerAPIPre120(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType != "linux") // Windows only supports 1.25 or later
|
||||
skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t, client.WithVersion("1.19"))
|
||||
@@ -132,7 +133,7 @@ func TestKillStoppedContainerAPIPre120(t *testing.T) {
|
||||
|
||||
func TestKillDifferentUserContainer(t *testing.T) {
|
||||
// TODO Windows: Windows does not yet support -u (Feb 2016).
|
||||
skip.If(t, testEnv.OSType != "linux", "User containers (container.Config.User) are not yet supported on %q platform", testEnv.OSType)
|
||||
skip.If(t, testEnv.OSType == "windows", "User containers (container.Config.User) are not yet supported on %q platform", testEnv.OSType)
|
||||
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
@@ -149,7 +150,7 @@ func TestKillDifferentUserContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInspectOomKilledTrue(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || !testEnv.DaemonInfo.MemoryLimit || !testEnv.DaemonInfo.SwapLimit)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || !testEnv.DaemonInfo.MemoryLimit || !testEnv.DaemonInfo.SwapLimit)
|
||||
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
@@ -167,7 +168,7 @@ func TestInspectOomKilledTrue(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInspectOomKilledFalse(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || !testEnv.DaemonInfo.MemoryLimit || !testEnv.DaemonInfo.SwapLimit)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || !testEnv.DaemonInfo.MemoryLimit || !testEnv.DaemonInfo.SwapLimit)
|
||||
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -35,7 +35,7 @@ func TestLinksEtcHostsContentMatch(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLinksContainerNames(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
func TestContainerNetworkMountsNoChown(t *testing.T) {
|
||||
// chown only applies to Linux bind mounted volumes; must be same host to verify
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || testEnv.IsRemoteDaemon())
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
@@ -81,7 +81,7 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMountDaemonRoot(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || testEnv.IsRemoteDaemon())
|
||||
t.Parallel()
|
||||
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -40,6 +40,7 @@ func TestNetworkNat(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNetworkLocalhostTCPNat(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
|
||||
defer setupTest(t)()
|
||||
@@ -106,6 +107,7 @@ func startServerContainer(t *testing.T, msg string, port int) string {
|
||||
}
|
||||
|
||||
func getExternalAddress(t *testing.T) net.IP {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
iface, err := net.InterfaceByName("eth0")
|
||||
skip.If(t, err != nil, "Test not running with `make test-integration`. Interface eth0 not found: %s", err)
|
||||
|
||||
|
||||
@@ -65,9 +65,8 @@ func TestPauseFailsOnWindowsServerContainers(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPauseStopPausedContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.31"), "broken in earlier versions")
|
||||
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
// This checks that "rename" updates source container correctly and doesn't set it to null.
|
||||
func TestRenameLinkedContainer(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.32"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
@@ -123,6 +124,7 @@ func TestRenameInvalidName(t *testing.T) {
|
||||
// This test is to make sure once the container has been renamed,
|
||||
// the service discovery for the (re)named container works.
|
||||
func TestRenameAnonymousContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
@@ -190,6 +192,7 @@ func TestRenameContainerWithSameName(t *testing.T) {
|
||||
// container could still reference to the container that is renamed.
|
||||
func TestRenameContainerWithLinkedContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
)
|
||||
|
||||
func TestResize(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
@@ -35,6 +36,7 @@ func TestResize(t *testing.T) {
|
||||
|
||||
func TestResizeWithInvalidSize(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.32"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
func TestDaemonRestartKillContainers(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
type testCase struct {
|
||||
desc string
|
||||
config *container.Config
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func TestUpdateMemory(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, !testEnv.DaemonInfo.MemoryLimit)
|
||||
skip.If(t, !testEnv.DaemonInfo.SwapLimit)
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
func TestCommitInheritsEnv(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.36"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -11,13 +11,13 @@ import (
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/internal/test/request"
|
||||
"github.com/docker/docker/internal/testutil"
|
||||
"github.com/gotestyourself/gotestyourself/skip"
|
||||
)
|
||||
|
||||
// Ensure we don't regress on CVE-2017-14992.
|
||||
func TestImportExtremelyLargeImageWorks(t *testing.T) {
|
||||
if runtime.GOARCH == "arm64" {
|
||||
t.Skip("effective test will be time out")
|
||||
}
|
||||
skip.If(t, runtime.GOARCH == "arm64", "effective test will be time out")
|
||||
skip.If(t, testEnv.OSType == "windows", "TODO enable on windows")
|
||||
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
|
||||
@@ -9,9 +9,11 @@ import (
|
||||
"github.com/docker/docker/internal/test/request"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
func TestRemoveImageOrphaning(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -51,6 +51,7 @@ func ContainerPoll(config *poll.Settings) {
|
||||
func NewSwarm(t *testing.T, testEnv *environment.Execution, ops ...func(*daemon.Daemon)) *daemon.Daemon {
|
||||
t.Helper()
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
if testEnv.DaemonInfo.ExperimentalBuild {
|
||||
ops = append(ops, daemon.WithExperimental)
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ func TestNetworkCreateDelete(t *testing.T) {
|
||||
// ID is removed, and not the network with the given name.
|
||||
func TestDockerNetworkDeletePreferID(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.34"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.OSType == "windows",
|
||||
"FIXME. Windows doesn't run DinD and uses networks shared between control daemon and daemon under test")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
package network
|
||||
|
||||
import (
|
||||
|
||||
@@ -13,11 +13,13 @@ import (
|
||||
"github.com/docker/docker/integration/internal/swarm"
|
||||
"gotest.tools/assert"
|
||||
"gotest.tools/poll"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
const defaultSwarmPort = 2477
|
||||
|
||||
func TestInspectNetwork(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
package ipvlan
|
||||
|
||||
import (
|
||||
@@ -17,7 +19,7 @@ import (
|
||||
|
||||
func TestDockerNetworkIpvlanPersistance(t *testing.T) {
|
||||
// verify the driver automatically provisions the 802.1q link (di-dummy0.70)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, !ipvlanKernelSupport(), "Kernel doesn't support ipvlan")
|
||||
|
||||
@@ -46,7 +48,7 @@ func TestDockerNetworkIpvlanPersistance(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDockerNetworkIpvlan(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, !ipvlanKernelSupport(), "Kernel doesn't support ipvlan")
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
package macvlan
|
||||
|
||||
import (
|
||||
@@ -17,7 +19,7 @@ import (
|
||||
|
||||
func TestDockerNetworkMacvlanPersistance(t *testing.T) {
|
||||
// verify the driver automatically provisions the 802.1q link (dm-dummy0.60)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, !macvlanKernelSupport(), "Kernel doesn't support macvlan")
|
||||
|
||||
@@ -42,7 +44,7 @@ func TestDockerNetworkMacvlanPersistance(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDockerNetworkMacvlan(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, !macvlanKernelSupport(), "Kernel doesn't support macvlan")
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@ func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceWithPredefinedNetwork(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
@@ -216,6 +217,7 @@ func TestServiceWithPredefinedNetwork(t *testing.T) {
|
||||
const ingressNet = "ingress"
|
||||
|
||||
func TestServiceRemoveKeepsIngressNetwork(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
|
||||
@@ -212,6 +212,7 @@ func TestAuthZPluginDenyResponse(t *testing.T) {
|
||||
// correctly after request pass through by the authorization plugin
|
||||
func TestAuthZPluginAllowEventStream(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTestV1(t)()
|
||||
ctrl.reqRes.Allow = true
|
||||
|
||||
@@ -29,7 +29,7 @@ var (
|
||||
)
|
||||
|
||||
func setupTestV2(t *testing.T) func() {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, !requirement.HasHubConnectivity(t))
|
||||
|
||||
teardown := setupTest(t)
|
||||
|
||||
@@ -48,6 +48,7 @@ func TestMain(m *testing.M) {
|
||||
|
||||
func setupTest(t *testing.T) func() {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
environment.ProtectAll(t, testEnv)
|
||||
|
||||
d = daemon.New(t, daemon.WithExperimental)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package authz // import "github.com/docker/docker/integration/plugin/authz"
|
||||
@@ -1,3 +1,5 @@
|
||||
// +build !windows
|
||||
|
||||
package logging
|
||||
|
||||
import (
|
||||
@@ -15,6 +17,7 @@ import (
|
||||
// does not keep the daemon from starting.
|
||||
func TestDaemonStartWithLogOpt(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
t.Parallel()
|
||||
|
||||
d := daemon.New(t)
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
// (sorted in the daemon). See #36698
|
||||
func TestPluginWithDevMounts(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
t.Parallel()
|
||||
|
||||
d := daemon.New(t)
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSecretInspect(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -42,7 +42,7 @@ func TestSecretInspect(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSecretList(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -128,7 +128,7 @@ func createSecret(ctx context.Context, t *testing.T, client client.APIClient, na
|
||||
}
|
||||
|
||||
func TestSecretsCreateAndDelete(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -175,7 +175,7 @@ func TestSecretsCreateAndDelete(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSecretsUpdate(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
@@ -226,6 +226,7 @@ func TestSecretsUpdate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTemplatedSecret(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
client := d.NewClientT(t)
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
"gotest.tools/poll"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
func TestServiceCreateInit(t *testing.T) {
|
||||
@@ -72,6 +73,7 @@ func inspectServiceContainer(t *testing.T, client client.APIClient, serviceID st
|
||||
}
|
||||
|
||||
func TestCreateServiceMultipleTimes(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
@@ -121,6 +123,7 @@ func TestCreateServiceMultipleTimes(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateWithDuplicateNetworkNames(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
@@ -180,6 +183,7 @@ func TestCreateWithDuplicateNetworkNames(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateServiceSecretFileMode(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
@@ -245,6 +249,7 @@ func TestCreateServiceSecretFileMode(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateServiceConfigFileMode(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
func TestInspect(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
|
||||
@@ -11,9 +11,11 @@ import (
|
||||
"github.com/docker/docker/integration/internal/swarm"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
func TestDockerNetworkConnectAlias(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
defer d.Stop(t)
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
func TestSessionCreate(t *testing.T) {
|
||||
skip.If(t, !testEnv.DaemonInfo.ExperimentalBuild)
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
@@ -28,6 +29,7 @@ func TestSessionCreate(t *testing.T) {
|
||||
|
||||
func TestSessionCreateWithBadUpgrade(t *testing.T) {
|
||||
skip.If(t, !testEnv.DaemonInfo.ExperimentalBuild)
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
|
||||
res, body, err := req.Post("/session")
|
||||
assert.NilError(t, err)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/docker/docker/internal/test/daemon"
|
||||
|
||||
"gotest.tools/assert"
|
||||
"gotest.tools/skip"
|
||||
)
|
||||
|
||||
// hasSystemd checks whether the host was booted with systemd as its init
|
||||
@@ -27,6 +28,7 @@ func hasSystemd() bool {
|
||||
// memory limit can be set when using systemd cgroupdriver.
|
||||
// https://github.com/moby/moby/issues/35123
|
||||
func TestCgroupDriverSystemdMemoryLimit(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
t.Parallel()
|
||||
|
||||
if !hasSystemd() {
|
||||
|
||||
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
func TestEventsExecDie(t *testing.T) {
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.36"), "broken in earlier versions")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME. Suspect may need to wait until container is running before exec")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
@@ -74,6 +75,7 @@ func TestEventsExecDie(t *testing.T) {
|
||||
// backward compatibility so old `JSONMessage` could still be used.
|
||||
// This test verifies that backward compatibility maintains.
|
||||
func TestEventsBackwardsCompatible(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "Windows doesn't support back-compat messages")
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
client := request.NewAPIClient(t)
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
func TestVolumesCreateAndList(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
@@ -49,6 +50,7 @@ func TestVolumesCreateAndList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestVolumesRemove(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
@@ -75,6 +77,7 @@ func TestVolumesRemove(t *testing.T) {
|
||||
|
||||
func TestVolumesInspect(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
defer setupTest(t)()
|
||||
client := request.NewAPIClient(t)
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user