浏览代码

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 <github@gone.nl>
Sebastiaan van Stijn 1 年之前
父节点
当前提交
ed93110e11
共有 2 个文件被更改,包括 4 次插入16 次删除
  1. 4 15
      integration-cli/docker_api_inspect_test.go
  2. 0 1
      integration/system/info_linux_test.go

+ 4 - 15
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)
 

+ 0 - 1
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)