From ed93110e1173f2e3d7708f708e1299ceb0c3f7da Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 22 Jan 2024 01:03:07 +0100 Subject: [PATCH] api: update test to reflect reality on Windows The TestInspectAPIContainerResponse mentioned that Windows does not support API versions before v1.25. While technically, no stable release existed for Windows with API versions before that (see f811d5b1288583b4bb4b978e58ca0466236a9a30), API version v1.24 was enabled in e4af39aeb311a08fd2d15e01eabd6bae9db36382, to have a consistend fallback version for API version negotiation. This patch updates the test to reflect that change. Signed-off-by: Sebastiaan van Stijn --- integration-cli/docker_api_inspect_test.go | 19 ++++--------------- integration/system/info_linux_test.go | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/integration-cli/docker_api_inspect_test.go b/integration-cli/docker_api_inspect_test.go index dde0c244e2..5a3c160f7d 100644 --- a/integration-cli/docker_api_inspect_test.go +++ b/integration-cli/docker_api_inspect_test.go @@ -20,26 +20,15 @@ func (s *DockerAPISuite) TestInspectAPIContainerResponse(c *testing.T) { keysBase := []string{ "Id", "State", "Created", "Path", "Args", "Config", "Image", "NetworkSettings", "ResolvConfPath", "HostnamePath", "HostsPath", "LogPath", "Name", "Driver", "MountLabel", "ProcessLabel", "GraphDriver", + "Mounts", } - type acase struct { + cases := []struct { version string keys []string + }{ + {version: "v1.24", keys: keysBase}, } - - var cases []acase - - if testEnv.DaemonInfo.OSType == "windows" { - // Windows only supports 1.25 or later - cases = []acase{ - {"v1.25", append(keysBase, "Mounts")}, - } - } else { - cases = []acase{ - {"v1.24", append(keysBase, "Mounts")}, - } - } - for _, cs := range cases { body := getInspectBody(c, cs.version, cleanedContainerID) diff --git a/integration/system/info_linux_test.go b/integration/system/info_linux_test.go index 98b3367990..a6d8360914 100644 --- a/integration/system/info_linux_test.go +++ b/integration/system/info_linux_test.go @@ -31,7 +31,6 @@ func TestInfoBinaryCommits(t *testing.T) { func TestInfoAPIVersioned(t *testing.T) { ctx := testutil.StartSpan(baseContext, t) - // Windows only supports 1.25 or later res, body, err := req.Get(ctx, "/v1.24/info") assert.NilError(t, err)