Browse code

testutil/environment: remove Execution.OSType field

This field was added in f0e5b3d7d89c0c87d001faa18bc60fd1b4531901 to
account for older versions of the engine (Docker EE LTS versions), which
did not yet provide the OSType field in Docker info, and had to be manually
set using the TEST_OSTYPE env-var.

This patch removes the field in favor of the equivalent in DaemonInfo. It's
more verbose, but also less ambiguous what information we're using (i.e.,
the platform the daemon is running on, not the local platform).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2023/06/14 18:46:00
Showing 53 changed files
... ...
@@ -107,7 +107,7 @@ func Docker(cmd icmd.Cmd, cmdOperators ...CmdOperator) *icmd.Result {
107 107
 // validateArgs is a checker to ensure tests are not running commands which are
108 108
 // not supported on platforms. Specifically on Windows this is 'busybox top'.
109 109
 func validateArgs(args ...string) error {
110
-	if testEnv.OSType != "windows" {
110
+	if testEnv.DaemonInfo.OSType != "windows" {
111 111
 		return nil
112 112
 	}
113 113
 	foundBusybox := -1
... ...
@@ -987,7 +987,7 @@ func (s *DockerAPISuite) TestContainerAPIWait(c *testing.T) {
987 987
 	name := "test-api-wait"
988 988
 
989 989
 	sleepCmd := "/bin/sleep"
990
-	if testEnv.OSType == "windows" {
990
+	if testEnv.DaemonInfo.OSType == "windows" {
991 991
 		sleepCmd = "sleep"
992 992
 	}
993 993
 	dockerCmd(c, "run", "--name", name, "busybox", sleepCmd, "2")
... ...
@@ -1194,7 +1194,7 @@ func (s *DockerAPISuite) TestContainerAPIDeleteRemoveVolume(c *testing.T) {
1194 1194
 	testRequires(c, testEnv.IsLocalDaemon)
1195 1195
 
1196 1196
 	vol := "/testvolume"
1197
-	if testEnv.OSType == "windows" {
1197
+	if testEnv.DaemonInfo.OSType == "windows" {
1198 1198
 		vol = `c:\testvolume`
1199 1199
 	}
1200 1200
 
... ...
@@ -1972,7 +1972,7 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsCreate(c *testing.T) {
1972 1972
 	var (
1973 1973
 		testImg string
1974 1974
 	)
1975
-	if testEnv.OSType != "windows" {
1975
+	if testEnv.DaemonInfo.OSType != "windows" {
1976 1976
 		testImg = "test-mount-config"
1977 1977
 		buildImageSuccessfully(c, testImg, build.WithDockerfile(`
1978 1978
 	FROM busybox
... ...
@@ -2073,7 +2073,7 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsCreate(c *testing.T) {
2073 2073
 		}
2074 2074
 	}
2075 2075
 
2076
-	if testEnv.OSType != "windows" { // Windows does not support volume populate
2076
+	if testEnv.DaemonInfo.OSType != "windows" { // Windows does not support volume populate
2077 2077
 		cases = append(cases, []testCase{
2078 2078
 			{
2079 2079
 				spec:     mount.Mount{Type: "volume", Target: destPath, VolumeOptions: &mount.VolumeOptions{NoCopy: true}},
... ...
@@ -78,7 +78,7 @@ func (s *DockerAPISuite) TestAPIImagesDelete(c *testing.T) {
78 78
 	assert.NilError(c, err)
79 79
 	defer apiClient.Close()
80 80
 
81
-	if testEnv.OSType != "windows" {
81
+	if testEnv.DaemonInfo.OSType != "windows" {
82 82
 		testRequires(c, Network)
83 83
 	}
84 84
 	name := "test-api-images-delete"
... ...
@@ -102,7 +102,7 @@ func (s *DockerAPISuite) TestAPIImagesHistory(c *testing.T) {
102 102
 	assert.NilError(c, err)
103 103
 	defer apiClient.Close()
104 104
 
105
-	if testEnv.OSType != "windows" {
105
+	if testEnv.DaemonInfo.OSType != "windows" {
106 106
 		testRequires(c, Network)
107 107
 	}
108 108
 	name := "test-api-images-history"
... ...
@@ -27,7 +27,7 @@ func (s *DockerAPISuite) TestInspectAPIContainerResponse(c *testing.T) {
27 27
 
28 28
 	var cases []acase
29 29
 
30
-	if testEnv.OSType == "windows" {
30
+	if testEnv.DaemonInfo.OSType == "windows" {
31 31
 		cases = []acase{
32 32
 			{"v1.25", append(keysBase, "Mounts")},
33 33
 		}
... ...
@@ -42,7 +42,7 @@ func (s *DockerAPISuite) TestAPIStatsNoStreamGetCpu(c *testing.T) {
42 42
 
43 43
 	var cpuPercent = 0.0
44 44
 
45
-	if testEnv.OSType != "windows" {
45
+	if testEnv.DaemonInfo.OSType != "windows" {
46 46
 		cpuDelta := float64(v.CPUStats.CPUUsage.TotalUsage - v.PreCPUStats.CPUUsage.TotalUsage)
47 47
 		systemDelta := float64(v.CPUStats.SystemUsage - v.PreCPUStats.SystemUsage)
48 48
 		cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0
... ...
@@ -109,7 +109,7 @@ func (s *DockerAPISuite) TestAPIStatsNetworkStats(c *testing.T) {
109 109
 
110 110
 	// Retrieve the container address
111 111
 	net := "bridge"
112
-	if testEnv.OSType == "windows" {
112
+	if testEnv.DaemonInfo.OSType == "windows" {
113 113
 		net = "nat"
114 114
 	}
115 115
 	contIP := findContainerIP(c, id, net)
... ...
@@ -157,7 +157,7 @@ func (s *DockerAPISuite) TestAPIStatsNetworkStats(c *testing.T) {
157 157
 	// On Linux, account for ARP.
158 158
 	expRxPkts := preRxPackets + uint64(numPings)
159 159
 	expTxPkts := preTxPackets + uint64(numPings)
160
-	if testEnv.OSType != "windows" {
160
+	if testEnv.DaemonInfo.OSType != "windows" {
161 161
 		expRxPkts++
162 162
 		expTxPkts++
163 163
 	}
... ...
@@ -40,13 +40,13 @@ func (s *DockerAPISuite) TestAPIGetEnabledCORS(c *testing.T) {
40 40
 	body.Close()
41 41
 	// TODO: @runcom incomplete tests, why old integration tests had this headers
42 42
 	// and here none of the headers below are in the response?
43
-	//c.Log(res.Header)
44
-	//assert.Equal(c, res.Header.Get("Access-Control-Allow-Origin"), "*")
45
-	//assert.Equal(c, res.Header.Get("Access-Control-Allow-Headers"), "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
43
+	// c.Log(res.Header)
44
+	// assert.Equal(c, res.Header.Get("Access-Control-Allow-Origin"), "*")
45
+	// assert.Equal(c, res.Header.Get("Access-Control-Allow-Headers"), "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
46 46
 }
47 47
 
48 48
 func (s *DockerAPISuite) TestAPIClientVersionOldNotSupported(c *testing.T) {
49
-	if testEnv.OSType != runtime.GOOS {
49
+	if testEnv.DaemonInfo.OSType != runtime.GOOS {
50 50
 		c.Skip("Daemon platform doesn't match test platform")
51 51
 	}
52 52
 	if api.MinVersion == api.DefaultVersion {
... ...
@@ -52,7 +52,7 @@ func (s *DockerCLIBuildSuite) TestBuildJSONEmptyRun(c *testing.T) {
52 52
 func (s *DockerCLIBuildSuite) TestBuildShCmdJSONEntrypoint(c *testing.T) {
53 53
 	name := "testbuildshcmdjsonentrypoint"
54 54
 	expected := "/bin/sh -c echo test"
55
-	if testEnv.OSType == "windows" {
55
+	if testEnv.DaemonInfo.OSType == "windows" {
56 56
 		expected = "cmd /S /C echo test"
57 57
 	}
58 58
 
... ...
@@ -90,7 +90,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementVolume(c *testing.T
90 90
 
91 91
 	var volumePath string
92 92
 
93
-	if testEnv.OSType == "windows" {
93
+	if testEnv.DaemonInfo.OSType == "windows" {
94 94
 		volumePath = "c:/quux"
95 95
 	} else {
96 96
 		volumePath = "/quux"
... ...
@@ -145,7 +145,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementWorkdir(c *testing.
145 145
 	res := inspectFieldJSON(c, name, "Config.WorkingDir")
146 146
 
147 147
 	expected := `"/work"`
148
-	if testEnv.OSType == "windows" {
148
+	if testEnv.DaemonInfo.OSType == "windows" {
149 149
 		expected = `"C:\\work"`
150 150
 	}
151 151
 	if res != expected {
... ...
@@ -1298,7 +1298,7 @@ func (s *DockerCLIBuildSuite) TestBuildRelativeWorkdir(c *testing.T) {
1298 1298
 		expectedFinal string
1299 1299
 	)
1300 1300
 
1301
-	if testEnv.OSType == "windows" {
1301
+	if testEnv.DaemonInfo.OSType == "windows" {
1302 1302
 		expected1 = `C:/`
1303 1303
 		expected2 = `C:/test1`
1304 1304
 		expected3 = `C:/test2`
... ...
@@ -1377,7 +1377,7 @@ func (s *DockerCLIBuildSuite) TestBuildWorkdirWithEnvVariables(c *testing.T) {
1377 1377
 	name := "testbuildworkdirwithenvvariables"
1378 1378
 
1379 1379
 	var expected string
1380
-	if testEnv.OSType == "windows" {
1380
+	if testEnv.DaemonInfo.OSType == "windows" {
1381 1381
 		expected = `C:\test1\test2`
1382 1382
 	} else {
1383 1383
 		expected = `/test1/test2`
... ...
@@ -1399,7 +1399,7 @@ func (s *DockerCLIBuildSuite) TestBuildRelativeCopy(c *testing.T) {
1399 1399
 	testRequires(c, NotUserNamespace)
1400 1400
 
1401 1401
 	var expected string
1402
-	if testEnv.OSType == "windows" {
1402
+	if testEnv.DaemonInfo.OSType == "windows" {
1403 1403
 		expected = `C:/test1/test2`
1404 1404
 	} else {
1405 1405
 		expected = `/test1/test2`
... ...
@@ -2230,7 +2230,7 @@ func (s *DockerCLIBuildSuite) TestBuildOnBuild(c *testing.T) {
2230 2230
 // gh #2446
2231 2231
 func (s *DockerCLIBuildSuite) TestBuildAddToSymlinkDest(c *testing.T) {
2232 2232
 	makeLink := `ln -s /foo /bar`
2233
-	if testEnv.OSType == "windows" {
2233
+	if testEnv.DaemonInfo.OSType == "windows" {
2234 2234
 		makeLink = `mklink /D C:\bar C:\foo`
2235 2235
 	}
2236 2236
 	name := "testbuildaddtosymlinkdest"
... ...
@@ -3186,7 +3186,7 @@ func (s *DockerCLIBuildSuite) TestBuildCmdShDashC(c *testing.T) {
3186 3186
 
3187 3187
 	res := inspectFieldJSON(c, name, "Config.Cmd")
3188 3188
 	expected := `["/bin/sh","-c","echo cmd"]`
3189
-	if testEnv.OSType == "windows" {
3189
+	if testEnv.DaemonInfo.OSType == "windows" {
3190 3190
 		expected = `["cmd /S /C echo cmd"]`
3191 3191
 	}
3192 3192
 	if res != expected {
... ...
@@ -3258,7 +3258,7 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypointCanBeOverriddenByChildInspect(c
3258 3258
 		expected = `["/bin/sh","-c","echo quux"]`
3259 3259
 	)
3260 3260
 
3261
-	if testEnv.OSType == "windows" {
3261
+	if testEnv.DaemonInfo.OSType == "windows" {
3262 3262
 		expected = `["cmd /S /C echo quux"]`
3263 3263
 	}
3264 3264
 
... ...
@@ -3328,7 +3328,7 @@ func (s *DockerCLIBuildSuite) TestBuildVerboseOut(c *testing.T) {
3328 3328
 	name := "testbuildverboseout"
3329 3329
 	expected := "\n123\n"
3330 3330
 
3331
-	if testEnv.OSType == "windows" {
3331
+	if testEnv.DaemonInfo.OSType == "windows" {
3332 3332
 		expected = "\n123\r\n"
3333 3333
 	}
3334 3334
 
... ...
@@ -3344,7 +3344,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithTabs(c *testing.T) {
3344 3344
 	res := inspectFieldJSON(c, name, "ContainerConfig.Cmd")
3345 3345
 	expected1 := `["/bin/sh","-c","echo\tone\t\ttwo"]`
3346 3346
 	expected2 := `["/bin/sh","-c","echo\u0009one\u0009\u0009two"]` // syntactically equivalent, and what Go 1.3 generates
3347
-	if testEnv.OSType == "windows" {
3347
+	if testEnv.DaemonInfo.OSType == "windows" {
3348 3348
 		expected1 = `["cmd /S /C echo\tone\t\ttwo"]`
3349 3349
 		expected2 = `["cmd /S /C echo\u0009one\u0009\u0009two"]` // syntactically equivalent, and what Go 1.3 generates
3350 3350
 	}
... ...
@@ -3542,7 +3542,7 @@ func (s *DockerCLIBuildSuite) TestBuildStderr(c *testing.T) {
3542 3542
 	result.Assert(c, icmd.Success)
3543 3543
 
3544 3544
 	// Windows to non-Windows should have a security warning
3545
-	if runtime.GOOS == "windows" && testEnv.OSType != "windows" && !strings.Contains(result.Stdout(), "SECURITY WARNING:") {
3545
+	if runtime.GOOS == "windows" && testEnv.DaemonInfo.OSType != "windows" && !strings.Contains(result.Stdout(), "SECURITY WARNING:") {
3546 3546
 		c.Fatalf("Stdout contains unexpected output: %q", result.Stdout())
3547 3547
 	}
3548 3548
 
... ...
@@ -3659,7 +3659,7 @@ func (s *DockerCLIBuildSuite) TestBuildVolumesRetainContents(c *testing.T) {
3659 3659
 		volName  = "/foo"
3660 3660
 	)
3661 3661
 
3662
-	if testEnv.OSType == "windows" {
3662
+	if testEnv.DaemonInfo.OSType == "windows" {
3663 3663
 		volName = "C:/foo"
3664 3664
 	}
3665 3665
 
... ...
@@ -3842,7 +3842,7 @@ RUN echo "  \
3842 3842
 
3843 3843
 	expected := "\n    foo  \n"
3844 3844
 	// Windows uses the builtin echo, which preserves quotes
3845
-	if testEnv.OSType == "windows" {
3845
+	if testEnv.DaemonInfo.OSType == "windows" {
3846 3846
 		expected = "\"    foo  \""
3847 3847
 	}
3848 3848
 
... ...
@@ -3876,7 +3876,7 @@ func (s *DockerCLIBuildSuite) TestBuildMissingArgs(c *testing.T) {
3876 3876
 		"INSERT":     {},
3877 3877
 	}
3878 3878
 
3879
-	if testEnv.OSType == "windows" {
3879
+	if testEnv.DaemonInfo.OSType == "windows" {
3880 3880
 		skipCmds = map[string]struct{}{
3881 3881
 			"CMD":        {},
3882 3882
 			"RUN":        {},
... ...
@@ -4008,7 +4008,7 @@ func (s *DockerCLIBuildSuite) TestBuildRUNErrMsg(c *testing.T) {
4008 4008
 	name := "testbuildbadrunerrmsg"
4009 4009
 	shell := "/bin/sh -c"
4010 4010
 	exitCode := 127
4011
-	if testEnv.OSType == "windows" {
4011
+	if testEnv.DaemonInfo.OSType == "windows" {
4012 4012
 		shell = "cmd /S /C"
4013 4013
 		// architectural - Windows has to start the container to determine the exe is bad, Linux does not
4014 4014
 		exitCode = 1
... ...
@@ -4027,7 +4027,7 @@ func (s *DockerCLIBuildSuite) TestBuildRUNErrMsg(c *testing.T) {
4027 4027
 func (s *DockerCLIBuildSuite) TestBuildNullStringInAddCopyVolume(c *testing.T) {
4028 4028
 	name := "testbuildnullstringinaddcopyvolume"
4029 4029
 	volName := "nullvolume"
4030
-	if testEnv.OSType == "windows" {
4030
+	if testEnv.DaemonInfo.OSType == "windows" {
4031 4031
 		volName = `C:\\nullvolume`
4032 4032
 	}
4033 4033
 
... ...
@@ -4067,7 +4067,7 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArg(c *testing.T) {
4067 4067
 	envKey := "foo"
4068 4068
 	envVal := "bar"
4069 4069
 	var dockerfile string
4070
-	if testEnv.OSType == "windows" {
4070
+	if testEnv.DaemonInfo.OSType == "windows" {
4071 4071
 		// Bugs in Windows busybox port - use the default base image and native cmd stuff
4072 4072
 		dockerfile = fmt.Sprintf(`FROM `+minimalBaseImage()+`
4073 4073
 			ARG %s
... ...
@@ -4678,7 +4678,7 @@ func (s *DockerCLIBuildSuite) TestBuildMultiStageUnusedArg(c *testing.T) {
4678 4678
 func (s *DockerCLIBuildSuite) TestBuildNoNamedVolume(c *testing.T) {
4679 4679
 	volName := "testname:/foo"
4680 4680
 
4681
-	if testEnv.OSType == "windows" {
4681
+	if testEnv.DaemonInfo.OSType == "windows" {
4682 4682
 		volName = "testname:C:\\foo"
4683 4683
 	}
4684 4684
 	dockerCmd(c, "run", "-v", volName, "busybox", "sh", "-c", "touch /foo/oops")
... ...
@@ -6105,7 +6105,7 @@ CMD echo foo
6105 6105
 
6106 6106
 	out, _ := dockerCmd(c, "inspect", "--format", "{{ json .Config.Cmd }}", "build2")
6107 6107
 	expected := `["/bin/sh","-c","echo foo"]`
6108
-	if testEnv.OSType == "windows" {
6108
+	if testEnv.DaemonInfo.OSType == "windows" {
6109 6109
 		expected = `["/bin/sh -c echo foo"]`
6110 6110
 	}
6111 6111
 	assert.Equal(c, strings.TrimSpace(out), expected)
... ...
@@ -137,7 +137,7 @@ func (s *DockerCLICommitSuite) TestCommitChange(c *testing.T) {
137 137
 	expectedEnv := "[DEBUG=true test=1 PATH=/foo]"
138 138
 	// bug fixed in 1.36, add min APi >= 1.36 requirement
139 139
 	// PR record https://github.com/moby/moby/pull/35582
140
-	if versions.GreaterThan(testEnv.DaemonAPIVersion(), "1.35") && testEnv.OSType != "windows" {
140
+	if versions.GreaterThan(testEnv.DaemonAPIVersion(), "1.35") && testEnv.DaemonInfo.OSType != "windows" {
141 141
 		// The ordering here is due to `PATH` being overridden from the container's
142 142
 		// ENV.  On windows, the container doesn't have a `PATH` ENV variable so
143 143
 		// the ordering is the same as the cli.
... ...
@@ -201,7 +201,7 @@ func (s *DockerCLICreateSuite) TestCreateLabelFromImage(c *testing.T) {
201 201
 func (s *DockerCLICreateSuite) TestCreateHostnameWithNumber(c *testing.T) {
202 202
 	image := "busybox"
203 203
 	// Busybox on Windows does not implement hostname command
204
-	if testEnv.OSType == "windows" {
204
+	if testEnv.DaemonInfo.OSType == "windows" {
205 205
 		image = testEnv.PlatformDefaults.BaseImage
206 206
 	}
207 207
 	out, _ := dockerCmd(c, "run", "-h", "web.0", image, "hostname")
... ...
@@ -284,7 +284,7 @@ func (s *DockerCLICreateSuite) TestCreateWithWorkdir(c *testing.T) {
284 284
 
285 285
 	dockerCmd(c, "create", "--name", name, "-w", dir, "busybox")
286 286
 	// Windows does not create the workdir until the container is started
287
-	if testEnv.OSType == "windows" {
287
+	if testEnv.DaemonInfo.OSType == "windows" {
288 288
 		dockerCmd(c, "start", name)
289 289
 		if testEnv.DaemonInfo.Isolation.IsHyperV() {
290 290
 			// Hyper-V isolated containers do not allow file-operations on a
... ...
@@ -657,7 +657,7 @@ func (s *DockerCLIEventSuite) TestEventsContainerRestart(c *testing.T) {
657 657
 
658 658
 	// wait until test2 is auto removed.
659 659
 	waitTime := 10 * time.Second
660
-	if testEnv.OSType == "windows" {
660
+	if testEnv.DaemonInfo.OSType == "windows" {
661 661
 		// Windows takes longer...
662 662
 		waitTime = 90 * time.Second
663 663
 	}
... ...
@@ -46,7 +46,7 @@ func (s *DockerCLIInfoSuite) TestInfoEnsureSucceeds(c *testing.T) {
46 46
 		"Live Restore Enabled:",
47 47
 	}
48 48
 
49
-	if testEnv.OSType == "linux" {
49
+	if testEnv.DaemonInfo.OSType == "linux" {
50 50
 		stringsToCheck = append(stringsToCheck, "Init Binary:", "Security Options:", "containerd version:", "runc version:", "init version:")
51 51
 	}
52 52
 
... ...
@@ -72,7 +72,7 @@ func (s *DockerCLIInspectSuite) TestInspectStatus(c *testing.T) {
72 72
 
73 73
 	// Windows does not support pause/unpause on Windows Server Containers.
74 74
 	// (RS1 does for Hyper-V Containers, but production CI is not setup for that)
75
-	if testEnv.OSType != "windows" {
75
+	if testEnv.DaemonInfo.OSType != "windows" {
76 76
 		dockerCmd(c, "pause", out)
77 77
 		inspectOut = inspectField(c, out, "State.Status")
78 78
 		assert.Equal(c, inspectOut, "paused")
... ...
@@ -174,7 +174,7 @@ func (s *DockerCLIInspectSuite) TestInspectContainerFilterInt(c *testing.T) {
174 174
 func (s *DockerCLIInspectSuite) TestInspectBindMountPoint(c *testing.T) {
175 175
 	modifier := ",z"
176 176
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
177
-	if testEnv.OSType == "windows" {
177
+	if testEnv.DaemonInfo.OSType == "windows" {
178 178
 		modifier = ""
179 179
 		// Linux creates the host directory if it doesn't exist. Windows does not.
180 180
 		os.Mkdir(`c:\data`, os.ModeDir)
... ...
@@ -197,7 +197,7 @@ func (s *DockerCLIInspectSuite) TestInspectBindMountPoint(c *testing.T) {
197 197
 	assert.Equal(c, m.Driver, "")
198 198
 	assert.Equal(c, m.Source, prefix+slash+"data")
199 199
 	assert.Equal(c, m.Destination, prefix+slash+"data")
200
-	if testEnv.OSType != "windows" { // Windows does not set mode
200
+	if testEnv.DaemonInfo.OSType != "windows" { // Windows does not set mode
201 201
 		assert.Equal(c, m.Mode, "ro"+modifier)
202 202
 	}
203 203
 	assert.Equal(c, m.RW, false)
... ...
@@ -223,7 +223,7 @@ func (s *DockerCLIPsSuite) TestPsListContainersFilterStatus(c *testing.T) {
223 223
 		Err:      err,
224 224
 	})
225 225
 	// Windows doesn't support pausing of containers
226
-	if testEnv.OSType != "windows" {
226
+	if testEnv.DaemonInfo.OSType != "windows" {
227 227
 		// pause running container
228 228
 		out = cli.DockerCmd(c, "run", "-itd", "busybox").Combined()
229 229
 		pausedID := strings.TrimSpace(out)
... ...
@@ -299,7 +299,7 @@ func (s *DockerCLIRestartSuite) TestRestartContainerwithRestartPolicy(c *testing
299 299
 	id1 := strings.TrimSpace(out1)
300 300
 	id2 := strings.TrimSpace(out2)
301 301
 	waitTimeout := 15 * time.Second
302
-	if testEnv.OSType == "windows" {
302
+	if testEnv.DaemonInfo.OSType == "windows" {
303 303
 		waitTimeout = 150 * time.Second
304 304
 	}
305 305
 	err := waitInspect(id1, "{{ .State.Restarting }} {{ .State.Running }}", "false false", waitTimeout)
... ...
@@ -77,7 +77,7 @@ func (s *DockerCLIRmiSuite) TestRmiImgIDMultipleTag(c *testing.T) {
77 77
 
78 78
 	// Wait for it to exit as cannot commit a running container on Windows, and
79 79
 	// it will take a few seconds to exit
80
-	if testEnv.OSType == "windows" {
80
+	if testEnv.DaemonInfo.OSType == "windows" {
81 81
 		cli.WaitExited(c, containerID, 60*time.Second)
82 82
 	}
83 83
 
... ...
@@ -118,7 +118,7 @@ func (s *DockerCLIRmiSuite) TestRmiImgIDForce(c *testing.T) {
118 118
 
119 119
 	// Wait for it to exit as cannot commit a running container on Windows, and
120 120
 	// it will take a few seconds to exit
121
-	if testEnv.OSType == "windows" {
121
+	if testEnv.DaemonInfo.OSType == "windows" {
122 122
 		cli.WaitExited(c, containerID, 60*time.Second)
123 123
 	}
124 124
 
... ...
@@ -82,7 +82,7 @@ func (s *DockerCLIRunSuite) TestRunLeakyFileDescriptors(c *testing.T) {
82 82
 // this will fail when Internet access is unavailable
83 83
 func (s *DockerCLIRunSuite) TestRunLookupGoogleDNS(c *testing.T) {
84 84
 	testRequires(c, Network, NotArm)
85
-	if testEnv.OSType == "windows" {
85
+	if testEnv.DaemonInfo.OSType == "windows" {
86 86
 		// nslookup isn't present in Windows busybox. Is built-in. Further,
87 87
 		// nslookup isn't present in nanoserver. Hence just use PowerShell...
88 88
 		dockerCmd(c, "run", testEnv.PlatformDefaults.BaseImage, "powershell", "Resolve-DNSName", "google.com")
... ...
@@ -146,7 +146,7 @@ func (s *DockerCLIRunSuite) TestRunDetachedContainerIDPrinting(c *testing.T) {
146 146
 func (s *DockerCLIRunSuite) TestRunWorkingDirectory(c *testing.T) {
147 147
 	dir := "/root"
148 148
 	image := "busybox"
149
-	if testEnv.OSType == "windows" {
149
+	if testEnv.DaemonInfo.OSType == "windows" {
150 150
 		dir = `C:/Windows`
151 151
 	}
152 152
 
... ...
@@ -169,7 +169,7 @@ func (s *DockerCLIRunSuite) TestRunWorkingDirectory(c *testing.T) {
169 169
 func (s *DockerCLIRunSuite) TestRunWithoutNetworking(c *testing.T) {
170 170
 	count := "-c"
171 171
 	image := "busybox"
172
-	if testEnv.OSType == "windows" {
172
+	if testEnv.DaemonInfo.OSType == "windows" {
173 173
 		count = "-n"
174 174
 		image = testEnv.PlatformDefaults.BaseImage
175 175
 	}
... ...
@@ -360,7 +360,7 @@ func (s *DockerCLIRunSuite) TestRunWithVolumesFromExited(c *testing.T) {
360 360
 	)
361 361
 
362 362
 	// Create a file in a volume
363
-	if testEnv.OSType == "windows" {
363
+	if testEnv.DaemonInfo.OSType == "windows" {
364 364
 		out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", `c:\some\dir`, testEnv.PlatformDefaults.BaseImage, "cmd", "/c", `echo hello > c:\some\dir\file`)
365 365
 	} else {
366 366
 		out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", "/some/dir", "busybox", "touch", "/some/dir/file")
... ...
@@ -370,7 +370,7 @@ func (s *DockerCLIRunSuite) TestRunWithVolumesFromExited(c *testing.T) {
370 370
 	}
371 371
 
372 372
 	// Read the file from another container using --volumes-from to access the volume in the second container
373
-	if testEnv.OSType == "windows" {
373
+	if testEnv.DaemonInfo.OSType == "windows" {
374 374
 		out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", testEnv.PlatformDefaults.BaseImage, "cmd", "/c", `type c:\some\dir\file`)
375 375
 	} else {
376 376
 		out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", "busybox", "cat", "/some/dir/file")
... ...
@@ -402,7 +402,7 @@ func (s *DockerCLIRunSuite) TestRunCreateVolumesInSymlinkDir(c *testing.T) {
402 402
 	// In the case of Windows to Windows CI, if the machine is setup so that
403 403
 	// the temp directory is not the C: drive, this test is invalid and will
404 404
 	// not work.
405
-	if testEnv.OSType == "windows" && strings.ToLower(dir[:1]) != "c" {
405
+	if testEnv.DaemonInfo.OSType == "windows" && strings.ToLower(dir[:1]) != "c" {
406 406
 		c.Skip("Requires TEMP to point to C: drive")
407 407
 	}
408 408
 
... ...
@@ -412,7 +412,7 @@ func (s *DockerCLIRunSuite) TestRunCreateVolumesInSymlinkDir(c *testing.T) {
412 412
 	}
413 413
 	f.Close()
414 414
 
415
-	if testEnv.OSType == "windows" {
415
+	if testEnv.DaemonInfo.OSType == "windows" {
416 416
 		dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir %s\nRUN mklink /D c:\\test %s", testEnv.PlatformDefaults.BaseImage, dir, dir)
417 417
 		containerPath = `c:\test\test`
418 418
 		cmd = "tasklist"
... ...
@@ -437,7 +437,7 @@ func (s *DockerCLIRunSuite) TestRunCreateVolumesInSymlinkDir2(c *testing.T) {
437 437
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
438 438
 	name := "test-volume-symlink2"
439 439
 
440
-	if testEnv.OSType == "windows" {
440
+	if testEnv.DaemonInfo.OSType == "windows" {
441 441
 		dockerFile = fmt.Sprintf("FROM %s\nRUN mkdir c:\\%s\nRUN mklink /D c:\\test c:\\%s", testEnv.PlatformDefaults.BaseImage, name, name)
442 442
 		containerPath = `c:\test\test`
443 443
 		cmd = "tasklist"
... ...
@@ -461,7 +461,7 @@ func (s *DockerCLIRunSuite) TestRunVolumesFromInReadonlyModeFails(c *testing.T)
461 461
 		volumeDir string
462 462
 		fileInVol string
463 463
 	)
464
-	if testEnv.OSType == "windows" {
464
+	if testEnv.DaemonInfo.OSType == "windows" {
465 465
 		volumeDir = `c:/test` // Forward-slash as using busybox
466 466
 		fileInVol = `c:/test/file`
467 467
 	} else {
... ...
@@ -482,7 +482,7 @@ func (s *DockerCLIRunSuite) TestRunVolumesFromInReadWriteMode(c *testing.T) {
482 482
 		volumeDir string
483 483
 		fileInVol string
484 484
 	)
485
-	if testEnv.OSType == "windows" {
485
+	if testEnv.DaemonInfo.OSType == "windows" {
486 486
 		volumeDir = `c:/test` // Forward-slash as using busybox
487 487
 		fileInVol = `c:/test/file`
488 488
 	} else {
... ...
@@ -503,7 +503,7 @@ func (s *DockerCLIRunSuite) TestRunVolumesFromInReadWriteMode(c *testing.T) {
503 503
 func (s *DockerCLIRunSuite) TestVolumesFromGetsProperMode(c *testing.T) {
504 504
 	testRequires(c, testEnv.IsLocalDaemon)
505 505
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
506
-	hostpath := RandomTmpDirPath("test", testEnv.OSType)
506
+	hostpath := RandomTmpDirPath("test", testEnv.DaemonInfo.OSType)
507 507
 	if err := os.MkdirAll(hostpath, 0755); err != nil {
508 508
 		c.Fatalf("Failed to create %s: %q", hostpath, err)
509 509
 	}
... ...
@@ -526,11 +526,11 @@ func (s *DockerCLIRunSuite) TestVolumesFromGetsProperMode(c *testing.T) {
526 526
 
527 527
 // Test for GH#10618
528 528
 func (s *DockerCLIRunSuite) TestRunNoDupVolumes(c *testing.T) {
529
-	path1 := RandomTmpDirPath("test1", testEnv.OSType)
530
-	path2 := RandomTmpDirPath("test2", testEnv.OSType)
529
+	path1 := RandomTmpDirPath("test1", testEnv.DaemonInfo.OSType)
530
+	path2 := RandomTmpDirPath("test2", testEnv.DaemonInfo.OSType)
531 531
 
532 532
 	someplace := ":/someplace"
533
-	if testEnv.OSType == "windows" {
533
+	if testEnv.DaemonInfo.OSType == "windows" {
534 534
 		// Windows requires that the source directory exists before calling HCS
535 535
 		testRequires(c, testEnv.IsLocalDaemon)
536 536
 		someplace = `:c:\someplace`
... ...
@@ -579,7 +579,7 @@ func (s *DockerCLIRunSuite) TestRunNoDupVolumes(c *testing.T) {
579 579
 // Test for #1351
580 580
 func (s *DockerCLIRunSuite) TestRunApplyVolumesFromBeforeVolumes(c *testing.T) {
581 581
 	prefix := ""
582
-	if testEnv.OSType == "windows" {
582
+	if testEnv.DaemonInfo.OSType == "windows" {
583 583
 		prefix = `c:`
584 584
 	}
585 585
 	dockerCmd(c, "run", "--name", "parent", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
... ...
@@ -588,7 +588,7 @@ func (s *DockerCLIRunSuite) TestRunApplyVolumesFromBeforeVolumes(c *testing.T) {
588 588
 
589 589
 func (s *DockerCLIRunSuite) TestRunMultipleVolumesFrom(c *testing.T) {
590 590
 	prefix := ""
591
-	if testEnv.OSType == "windows" {
591
+	if testEnv.DaemonInfo.OSType == "windows" {
592 592
 		prefix = `c:`
593 593
 	}
594 594
 	dockerCmd(c, "run", "--name", "parent1", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
... ...
@@ -618,7 +618,7 @@ func (s *DockerCLIRunSuite) TestRunVerifyContainerID(c *testing.T) {
618 618
 // Test that creating a container with a volume doesn't crash. Regression test for #995.
619 619
 func (s *DockerCLIRunSuite) TestRunCreateVolume(c *testing.T) {
620 620
 	prefix := ""
621
-	if testEnv.OSType == "windows" {
621
+	if testEnv.DaemonInfo.OSType == "windows" {
622 622
 		prefix = `c:`
623 623
 	}
624 624
 	dockerCmd(c, "run", "-v", prefix+"/var/lib/data", "busybox", "true")
... ...
@@ -675,7 +675,7 @@ func (s *DockerCLIRunSuite) TestRunVolumesFromSymlinkPath(c *testing.T) {
675 675
 		RUN ln -s home /foo
676 676
 		VOLUME ["/foo/bar"]`
677 677
 
678
-	if testEnv.OSType == "windows" {
678
+	if testEnv.DaemonInfo.OSType == "windows" {
679 679
 		prefix = `c:`
680 680
 		dfContents = `FROM ` + testEnv.PlatformDefaults.BaseImage + `
681 681
 	    RUN mkdir c:\home
... ...
@@ -721,7 +721,7 @@ func (s *DockerCLIRunSuite) TestRunExitCode(c *testing.T) {
721 721
 
722 722
 func (s *DockerCLIRunSuite) TestRunUserDefaults(c *testing.T) {
723 723
 	expected := "uid=0(root) gid=0(root)"
724
-	if testEnv.OSType == "windows" {
724
+	if testEnv.DaemonInfo.OSType == "windows" {
725 725
 		expected = "uid=0(root) gid=0(root) groups=0(root)"
726 726
 	}
727 727
 	out, _ := dockerCmd(c, "run", "busybox", "id")
... ...
@@ -927,7 +927,7 @@ func (s *DockerCLIRunSuite) TestRunEnvironmentOverride(c *testing.T) {
927 927
 }
928 928
 
929 929
 func (s *DockerCLIRunSuite) TestRunContainerNetwork(c *testing.T) {
930
-	if testEnv.OSType == "windows" {
930
+	if testEnv.DaemonInfo.OSType == "windows" {
931 931
 		// Windows busybox does not have ping. Use built in ping instead.
932 932
 		dockerCmd(c, "run", testEnv.PlatformDefaults.BaseImage, "ping", "-n", "1", "127.0.0.1")
933 933
 	} else {
... ...
@@ -1227,7 +1227,7 @@ func (s *DockerCLIRunSuite) TestRunModeHostname(c *testing.T) {
1227 1227
 func (s *DockerCLIRunSuite) TestRunRootWorkdir(c *testing.T) {
1228 1228
 	out, _ := dockerCmd(c, "run", "--workdir", "/", "busybox", "pwd")
1229 1229
 	expected := "/\n"
1230
-	if testEnv.OSType == "windows" {
1230
+	if testEnv.DaemonInfo.OSType == "windows" {
1231 1231
 		expected = "C:" + expected
1232 1232
 	}
1233 1233
 	if out != expected {
... ...
@@ -1236,7 +1236,7 @@ func (s *DockerCLIRunSuite) TestRunRootWorkdir(c *testing.T) {
1236 1236
 }
1237 1237
 
1238 1238
 func (s *DockerCLIRunSuite) TestRunAllowBindMountingRoot(c *testing.T) {
1239
-	if testEnv.OSType == "windows" {
1239
+	if testEnv.DaemonInfo.OSType == "windows" {
1240 1240
 		// Windows busybox will fail with Permission Denied on items such as pagefile.sys
1241 1241
 		dockerCmd(c, "run", "-v", `c:\:c:\host`, testEnv.PlatformDefaults.BaseImage, "cmd", "-c", "dir", `c:\host`)
1242 1242
 	} else {
... ...
@@ -1247,7 +1247,7 @@ func (s *DockerCLIRunSuite) TestRunAllowBindMountingRoot(c *testing.T) {
1247 1247
 func (s *DockerCLIRunSuite) TestRunDisallowBindMountingRootToRoot(c *testing.T) {
1248 1248
 	mount := "/:/"
1249 1249
 	targetDir := "/host"
1250
-	if testEnv.OSType == "windows" {
1250
+	if testEnv.DaemonInfo.OSType == "windows" {
1251 1251
 		mount = `c:\:c\`
1252 1252
 		targetDir = "c:/host" // Forward slash as using busybox
1253 1253
 	}
... ...
@@ -1708,7 +1708,7 @@ func (s *DockerCLIRunSuite) TestRunCleanupCmdOnEntrypoint(c *testing.T) {
1708 1708
 	}
1709 1709
 	out = strings.TrimSpace(out)
1710 1710
 	expected := "root"
1711
-	if testEnv.OSType == "windows" {
1711
+	if testEnv.DaemonInfo.OSType == "windows" {
1712 1712
 		if strings.Contains(testEnv.PlatformDefaults.BaseImage, "servercore") {
1713 1713
 			expected = `user manager\containeradministrator`
1714 1714
 		} else {
... ...
@@ -1724,7 +1724,7 @@ func (s *DockerCLIRunSuite) TestRunCleanupCmdOnEntrypoint(c *testing.T) {
1724 1724
 func (s *DockerCLIRunSuite) TestRunWorkdirExistsAndIsFile(c *testing.T) {
1725 1725
 	existingFile := "/bin/cat"
1726 1726
 	expected := "not a directory"
1727
-	if testEnv.OSType == "windows" {
1727
+	if testEnv.DaemonInfo.OSType == "windows" {
1728 1728
 		existingFile = `\windows\system32\ntdll.dll`
1729 1729
 		expected = `The directory name is invalid.`
1730 1730
 	}
... ...
@@ -1740,7 +1740,7 @@ func (s *DockerCLIRunSuite) TestRunExitOnStdinClose(c *testing.T) {
1740 1740
 
1741 1741
 	meow := "/bin/cat"
1742 1742
 	delay := 60
1743
-	if testEnv.OSType == "windows" {
1743
+	if testEnv.DaemonInfo.OSType == "windows" {
1744 1744
 		meow = "cat"
1745 1745
 	}
1746 1746
 	runCmd := exec.Command(dockerBinary, "run", "--name", name, "-i", "busybox", meow)
... ...
@@ -1883,7 +1883,7 @@ func (s *DockerCLIRunSuite) TestRunEntrypoint(c *testing.T) {
1883 1883
 
1884 1884
 func (s *DockerCLIRunSuite) TestRunBindMounts(c *testing.T) {
1885 1885
 	testRequires(c, testEnv.IsLocalDaemon)
1886
-	if testEnv.OSType == "linux" {
1886
+	if testEnv.DaemonInfo.OSType == "linux" {
1887 1887
 		testRequires(c, DaemonIsLinux, NotUserNamespace)
1888 1888
 	}
1889 1889
 
... ...
@@ -1904,7 +1904,7 @@ func (s *DockerCLIRunSuite) TestRunBindMounts(c *testing.T) {
1904 1904
 	}
1905 1905
 
1906 1906
 	// test writing to bind mount
1907
-	if testEnv.OSType == "windows" {
1907
+	if testEnv.DaemonInfo.OSType == "windows" {
1908 1908
 		dockerCmd(c, "run", "-v", fmt.Sprintf(`%s:c:\tmp:rw`, tmpDir), "busybox", "touch", "c:/tmp/holla")
1909 1909
 	} else {
1910 1910
 		dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:rw", tmpDir), "busybox", "touch", "/tmp/holla")
... ...
@@ -1919,7 +1919,7 @@ func (s *DockerCLIRunSuite) TestRunBindMounts(c *testing.T) {
1919 1919
 	}
1920 1920
 
1921 1921
 	// Windows does not (and likely never will) support mounting a single file
1922
-	if testEnv.OSType != "windows" {
1922
+	if testEnv.DaemonInfo.OSType != "windows" {
1923 1923
 		// test mount a file
1924 1924
 		dockerCmd(c, "run", "-v", fmt.Sprintf("%s/holla:/tmp/holla:rw", tmpDir), "busybox", "sh", "-c", "echo -n 'yotta' > /tmp/holla")
1925 1925
 		content := readFile(path.Join(tmpDir, "holla"), c) // Will fail if the file doesn't exist
... ...
@@ -1988,7 +1988,7 @@ func (s *DockerCLIRunSuite) TestRunSetMacAddress(c *testing.T) {
1988 1988
 	skip.If(c, RuntimeIsWindowsContainerd(), "FIXME: Broken on Windows + containerd combination")
1989 1989
 	mac := "12:34:56:78:9a:bc"
1990 1990
 	var out string
1991
-	if testEnv.OSType == "windows" {
1991
+	if testEnv.DaemonInfo.OSType == "windows" {
1992 1992
 		out, _ = dockerCmd(c, "run", "-i", "--rm", fmt.Sprintf("--mac-address=%s", mac), "busybox", "sh", "-c", "ipconfig /all | grep 'Physical Address' | awk '{print $12}'")
1993 1993
 		mac = strings.ReplaceAll(strings.ToUpper(mac), ":", "-") // To Windows-style MACs
1994 1994
 	} else {
... ...
@@ -2184,7 +2184,7 @@ func (s *DockerCLIRunSuite) TestVolumesNoCopyData(c *testing.T) {
2184 2184
 		c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out)
2185 2185
 	}
2186 2186
 
2187
-	tmpDir := RandomTmpDirPath("docker_test_bind_mount_copy_data", testEnv.OSType)
2187
+	tmpDir := RandomTmpDirPath("docker_test_bind_mount_copy_data", testEnv.DaemonInfo.OSType)
2188 2188
 	if out, _, err := dockerCmdWithError("run", "-v", tmpDir+":/foo", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") {
2189 2189
 		c.Fatalf("Data was copied on bind mount but shouldn't be:\n%q", out)
2190 2190
 	}
... ...
@@ -2536,7 +2536,7 @@ func (s *DockerCLIRunSuite) TestRunNonLocalMacAddress(c *testing.T) {
2536 2536
 	args := []string{"run", "--mac-address", addr}
2537 2537
 	expected := addr
2538 2538
 
2539
-	if testEnv.OSType != "windows" {
2539
+	if testEnv.DaemonInfo.OSType != "windows" {
2540 2540
 		args = append(args, "busybox", "ifconfig")
2541 2541
 	} else {
2542 2542
 		args = append(args, testEnv.PlatformDefaults.BaseImage, "ipconfig", "/all")
... ...
@@ -2632,7 +2632,7 @@ func (s *DockerCLIRunSuite) TestRunSetDefaultRestartPolicy(c *testing.T) {
2632 2632
 func (s *DockerCLIRunSuite) TestRunRestartMaxRetries(c *testing.T) {
2633 2633
 	out, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "false")
2634 2634
 	timeout := 10 * time.Second
2635
-	if testEnv.OSType == "windows" {
2635
+	if testEnv.DaemonInfo.OSType == "windows" {
2636 2636
 		timeout = 120 * time.Second
2637 2637
 	}
2638 2638
 
... ...
@@ -3003,7 +3003,7 @@ func (s *DockerCLIRunSuite) TestVolumeFromMixedRWOptions(c *testing.T) {
3003 3003
 	dockerCmd(c, "run", "--volumes-from", "parent:ro", "--name", "test-volumes-1", "busybox", "true")
3004 3004
 	dockerCmd(c, "run", "--volumes-from", "parent:rw", "--name", "test-volumes-2", "busybox", "true")
3005 3005
 
3006
-	if testEnv.OSType != "windows" {
3006
+	if testEnv.DaemonInfo.OSType != "windows" {
3007 3007
 		mRO, err := inspectMountPoint("test-volumes-1", prefix+slash+"test")
3008 3008
 		assert.NilError(c, err, "failed to inspect mount point")
3009 3009
 		if mRO.RW {
... ...
@@ -3394,7 +3394,7 @@ func (s *DockerCLIRunSuite) TestRunLoopbackOnlyExistsWhenNetworkingDisabled(c *t
3394 3394
 
3395 3395
 // Issue #4681
3396 3396
 func (s *DockerCLIRunSuite) TestRunLoopbackWhenNetworkDisabled(c *testing.T) {
3397
-	if testEnv.OSType == "windows" {
3397
+	if testEnv.DaemonInfo.OSType == "windows" {
3398 3398
 		dockerCmd(c, "run", "--net=none", testEnv.PlatformDefaults.BaseImage, "ping", "-n", "1", "127.0.0.1")
3399 3399
 	} else {
3400 3400
 		dockerCmd(c, "run", "--net=none", "busybox", "ping", "-c", "1", "127.0.0.1")
... ...
@@ -3660,7 +3660,7 @@ func (s *DockerCLIRunSuite) TestRunNonExistingCmd(c *testing.T) {
3660 3660
 // as that's when the check is made (and yes, by its design...)
3661 3661
 func (s *DockerCLIRunSuite) TestCmdCannotBeInvoked(c *testing.T) {
3662 3662
 	expected := 126
3663
-	if testEnv.OSType == "windows" {
3663
+	if testEnv.DaemonInfo.OSType == "windows" {
3664 3664
 		expected = 127
3665 3665
 	}
3666 3666
 	name := "testCmdCannotBeInvoked"
... ...
@@ -25,7 +25,7 @@ func (s *DockerCLITopSuite) TestTopMultipleArgs(c *testing.T) {
25 25
 	cleanedContainerID := strings.TrimSpace(out)
26 26
 
27 27
 	var expected icmd.Expected
28
-	switch testEnv.OSType {
28
+	switch testEnv.DaemonInfo.OSType {
29 29
 	case "windows":
30 30
 		expected = icmd.Expected{ExitCode: 1, Err: "Windows does not support arguments to top"}
31 31
 	default:
... ...
@@ -46,7 +46,7 @@ func (s *DockerCLITopSuite) TestTopNonPrivileged(c *testing.T) {
46 46
 	// Windows will list the name of the launched executable which in this case is busybox.exe, without the parameters.
47 47
 	// Linux will display the command executed in the container
48 48
 	var lookingFor string
49
-	if testEnv.OSType == "windows" {
49
+	if testEnv.DaemonInfo.OSType == "windows" {
50 50
 		lookingFor = "busybox.exe"
51 51
 	} else {
52 52
 		lookingFor = "top"
... ...
@@ -41,7 +41,7 @@ func (s *DockerAPISuite) TestDeprecatedContainerAPIStartVolumeBinds(c *testing.T
41 41
 	// TODO Windows CI: Investigate further why this fails on Windows to Windows CI.
42 42
 	testRequires(c, DaemonIsLinux)
43 43
 	path := "/foo"
44
-	if testEnv.OSType == "windows" {
44
+	if testEnv.DaemonInfo.OSType == "windows" {
45 45
 		path = `c:\foo`
46 46
 	}
47 47
 	name := "testing"
... ...
@@ -54,7 +54,7 @@ func (s *DockerAPISuite) TestDeprecatedContainerAPIStartVolumeBinds(c *testing.T
54 54
 	assert.NilError(c, err)
55 55
 	assert.Equal(c, res.StatusCode, http.StatusCreated)
56 56
 
57
-	bindPath := RandomTmpDirPath("test", testEnv.OSType)
57
+	bindPath := RandomTmpDirPath("test", testEnv.DaemonInfo.OSType)
58 58
 	config = map[string]interface{}{
59 59
 		"Binds": []string{bindPath + ":" + path},
60 60
 	}
... ...
@@ -81,8 +81,8 @@ func (s *DockerAPISuite) TestDeprecatedContainerAPIStartDupVolumeBinds(c *testin
81 81
 	assert.NilError(c, err)
82 82
 	assert.Equal(c, res.StatusCode, http.StatusCreated)
83 83
 
84
-	bindPath1 := RandomTmpDirPath("test1", testEnv.OSType)
85
-	bindPath2 := RandomTmpDirPath("test2", testEnv.OSType)
84
+	bindPath1 := RandomTmpDirPath("test1", testEnv.DaemonInfo.OSType)
85
+	bindPath2 := RandomTmpDirPath("test2", testEnv.DaemonInfo.OSType)
86 86
 
87 87
 	config = map[string]interface{}{
88 88
 		"Binds": []string{bindPath1 + ":/tmp", bindPath2 + ":/tmp"},
... ...
@@ -23,7 +23,7 @@ func ensureSyscallTest(c *testing.T) {
23 23
 
24 24
 	// if no match, must build in docker, which is significantly slower
25 25
 	// (slower mostly because of the vfs graphdriver)
26
-	if testEnv.OSType != runtime.GOOS {
26
+	if testEnv.DaemonInfo.OSType != runtime.GOOS {
27 27
 		ensureSyscallTestBuild(c)
28 28
 		return
29 29
 	}
... ...
@@ -86,7 +86,7 @@ func ensureNNPTest(c *testing.T) {
86 86
 
87 87
 	// if no match, must build in docker, which is significantly slower
88 88
 	// (slower mostly because of the vfs graphdriver)
89
-	if testEnv.OSType != runtime.GOOS {
89
+	if testEnv.DaemonInfo.OSType != runtime.GOOS {
90 90
 		ensureNNPTestBuild(c)
91 91
 		return
92 92
 	}
... ...
@@ -24,11 +24,11 @@ func ArchitectureIsNot(arch string) bool {
24 24
 }
25 25
 
26 26
 func DaemonIsWindows() bool {
27
-	return testEnv.OSType == "windows"
27
+	return testEnv.DaemonInfo.OSType == "windows"
28 28
 }
29 29
 
30 30
 func DaemonIsLinux() bool {
31
-	return testEnv.OSType == "linux"
31
+	return testEnv.DaemonInfo.OSType == "linux"
32 32
 }
33 33
 
34 34
 func MinimumAPIVersion(version string) func() bool {
... ...
@@ -153,7 +153,7 @@ func UserNamespaceInKernel() bool {
153 153
 }
154 154
 
155 155
 func IsPausable() bool {
156
-	if testEnv.OSType == "windows" {
156
+	if testEnv.DaemonInfo.OSType == "windows" {
157 157
 		return testEnv.DaemonInfo.Isolation.IsHyperV()
158 158
 	}
159 159
 	return true
... ...
@@ -4,7 +4,7 @@ package main
4 4
 // the command is for a sleeping container based on the daemon platform.
5 5
 // The Windows busybox image does not have a `top` command.
6 6
 func sleepCommandForDaemonPlatform() []string {
7
-	if testEnv.OSType == "windows" {
7
+	if testEnv.DaemonInfo.OSType == "windows" {
8 8
 		return []string{"sleep", "240"}
9 9
 	}
10 10
 	return []string{"top"}
... ...
@@ -14,7 +14,7 @@ import (
14 14
 )
15 15
 
16 16
 func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) {
17
-	if testEnv.OSType == "windows" {
17
+	if testEnv.DaemonInfo.OSType == "windows" {
18 18
 		return "c:", `\`
19 19
 	}
20 20
 	return "", "/"
... ...
@@ -20,7 +20,7 @@ import (
20 20
 )
21 21
 
22 22
 func TestCreateWithCDIDevices(t *testing.T) {
23
-	skip.If(t, testEnv.OSType != "linux", "CDI devices are only supported on Linux")
23
+	skip.If(t, testEnv.DaemonInfo.OSType != "linux", "CDI devices are only supported on Linux")
24 24
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run cdi tests with a remote daemon")
25 25
 
26 26
 	cwd, err := os.Getwd()
... ...
@@ -42,7 +42,7 @@ func TestCopyFromContainerPathIsNotDir(t *testing.T) {
42 42
 
43 43
 	path := "/etc/passwd/"
44 44
 	expected := "not a directory"
45
-	if testEnv.OSType == "windows" {
45
+	if testEnv.DaemonInfo.OSType == "windows" {
46 46
 		path = "c:/windows/system32/drivers/etc/hosts/"
47 47
 		expected = "The filename, directory name, or volume label syntax is incorrect."
48 48
 	}
... ...
@@ -127,7 +127,7 @@ func TestCopyToContainerPathIsNotDir(t *testing.T) {
127 127
 	cid := container.Create(ctx, t, apiclient)
128 128
 
129 129
 	path := "/etc/passwd/"
130
-	if testEnv.OSType == "windows" {
130
+	if testEnv.DaemonInfo.OSType == "windows" {
131 131
 		path = "c:/windows/system32/drivers/etc/hosts/"
132 132
 	}
133 133
 	err := apiclient.CopyToContainer(ctx, cid, path, nil, types.CopyToContainerOptions{})
... ...
@@ -514,7 +514,7 @@ func TestCreatePlatformSpecificImageNoPlatform(t *testing.T) {
514 514
 	defer setupTest(t)()
515 515
 
516 516
 	skip.If(t, testEnv.DaemonInfo.Architecture == "arm", "test only makes sense to run on non-arm systems")
517
-	skip.If(t, testEnv.OSType != "linux", "test image is only available on linux")
517
+	skip.If(t, testEnv.DaemonInfo.OSType != "linux", "test image is only available on linux")
518 518
 	cli := testEnv.APIClient()
519 519
 
520 520
 	_, err := cli.ContainerCreate(
... ...
@@ -13,7 +13,7 @@ import (
13 13
 )
14 14
 
15 15
 func TestDiff(t *testing.T) {
16
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
16
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
17 17
 	defer setupTest(t)()
18 18
 	client := testEnv.APIClient()
19 19
 	ctx := context.Background()
... ...
@@ -28,7 +28,7 @@ func TestDiff(t *testing.T) {
28 28
 		{Kind: containertypes.ChangeAdd, Path: "/foo"},
29 29
 		{Kind: containertypes.ChangeAdd, Path: "/foo/bar"},
30 30
 	}
31
-	if testEnv.OSType == "windows" {
31
+	if testEnv.DaemonInfo.OSType == "windows" {
32 32
 		poll.WaitOn(t, container.IsInState(ctx, client, cID, "exited"), poll.WithDelay(100*time.Millisecond), poll.WithTimeout(60*time.Second))
33 33
 		expected = []containertypes.FilesystemChange{
34 34
 			{Kind: containertypes.ChangeModify, Path: "Files/foo"},
... ...
@@ -119,7 +119,7 @@ func TestExec(t *testing.T) {
119 119
 	out := string(r)
120 120
 	assert.NilError(t, err)
121 121
 	expected := "PWD=/tmp"
122
-	if testEnv.OSType == "windows" {
122
+	if testEnv.DaemonInfo.OSType == "windows" {
123 123
 		expected = "PWD=C:/tmp"
124 124
 	}
125 125
 	assert.Assert(t, is.Contains(out, expected), "exec command not running in expected /tmp working directory")
... ...
@@ -128,7 +128,7 @@ func TestExec(t *testing.T) {
128 128
 
129 129
 func TestExecUser(t *testing.T) {
130 130
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "broken in earlier versions")
131
-	skip.If(t, testEnv.OSType == "windows", "FIXME. Probably needs to wait for container to be in running state.")
131
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME. Probably needs to wait for container to be in running state.")
132 132
 	defer setupTest(t)()
133 133
 	ctx := context.Background()
134 134
 	client := testEnv.APIClient()
... ...
@@ -18,7 +18,7 @@ import (
18 18
 // TestHealthCheckWorkdir verifies that health-checks inherit the containers'
19 19
 // working-dir.
20 20
 func TestHealthCheckWorkdir(t *testing.T) {
21
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
21
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
22 22
 	defer setupTest(t)()
23 23
 	ctx := context.Background()
24 24
 	client := testEnv.APIClient()
... ...
@@ -37,7 +37,7 @@ func TestHealthCheckWorkdir(t *testing.T) {
37 37
 // GitHub #37263
38 38
 // Do not stop healthchecks just because we sent a signal to the container
39 39
 func TestHealthKillContainer(t *testing.T) {
40
-	skip.If(t, testEnv.OSType == "windows", "Windows only supports SIGKILL and SIGTERM? See https://github.com/moby/moby/issues/39574")
40
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Windows only supports SIGKILL and SIGTERM? See https://github.com/moby/moby/issues/39574")
41 41
 	defer setupTest(t)()
42 42
 
43 43
 	ctx := context.Background()
... ...
@@ -70,7 +70,7 @@ func TestKillContainer(t *testing.T) {
70 70
 	for _, tc := range testCases {
71 71
 		tc := tc
72 72
 		t.Run(tc.doc, func(t *testing.T) {
73
-			skip.If(t, testEnv.OSType == tc.skipOs, "Windows does not support SIGWINCH")
73
+			skip.If(t, testEnv.DaemonInfo.OSType == tc.skipOs, "Windows does not support SIGWINCH")
74 74
 			ctx := context.Background()
75 75
 			id := container.Run(ctx, t, client)
76 76
 			err := client.ContainerKill(ctx, id, tc.signal)
... ...
@@ -82,7 +82,7 @@ func TestKillContainer(t *testing.T) {
82 82
 }
83 83
 
84 84
 func TestKillWithStopSignalAndRestartPolicies(t *testing.T) {
85
-	skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
85
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Windows only supports 1.25 or later")
86 86
 	defer setupTest(t)()
87 87
 	client := testEnv.APIClient()
88 88
 
... ...
@@ -121,7 +121,7 @@ func TestKillWithStopSignalAndRestartPolicies(t *testing.T) {
121 121
 }
122 122
 
123 123
 func TestKillStoppedContainer(t *testing.T) {
124
-	skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
124
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Windows only supports 1.25 or later")
125 125
 	defer setupTest(t)()
126 126
 	ctx := context.Background()
127 127
 	client := testEnv.APIClient()
... ...
@@ -132,7 +132,7 @@ func TestKillStoppedContainer(t *testing.T) {
132 132
 }
133 133
 
134 134
 func TestKillStoppedContainerAPIPre120(t *testing.T) {
135
-	skip.If(t, testEnv.OSType == "windows", "Windows only supports 1.25 or later")
135
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Windows only supports 1.25 or later")
136 136
 	defer setupTest(t)()
137 137
 	ctx := context.Background()
138 138
 	client := request.NewAPIClient(t, client.WithVersion("1.19"))
... ...
@@ -143,7 +143,7 @@ func TestKillStoppedContainerAPIPre120(t *testing.T) {
143 143
 
144 144
 func TestKillDifferentUserContainer(t *testing.T) {
145 145
 	// TODO Windows: Windows does not yet support -u (Feb 2016).
146
-	skip.If(t, testEnv.OSType == "windows", "User containers (container.Config.User) are not yet supported on %q platform", testEnv.OSType)
146
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "User containers (container.Config.User) are not yet supported on %q platform", testEnv.DaemonInfo.OSType)
147 147
 
148 148
 	defer setupTest(t)()
149 149
 	ctx := context.Background()
... ...
@@ -125,7 +125,7 @@ func testLogs(t *testing.T, logDriver string) {
125 125
 	}
126 126
 
127 127
 	pollTimeout := time.Second * 10
128
-	if testEnv.OSType == "windows" {
128
+	if testEnv.DaemonInfo.OSType == "windows" {
129 129
 		pollTimeout = StopContainerWindowsPollTimeout
130 130
 	}
131 131
 
... ...
@@ -160,7 +160,7 @@ func testLogs(t *testing.T, logDriver string) {
160 160
 
161 161
 			stdoutStr := stdout.String()
162 162
 
163
-			if tty && testEnv.OSType == "windows" {
163
+			if tty && testEnv.DaemonInfo.OSType == "windows" {
164 164
 				stdoutStr = stripEscapeCodes(t, stdoutStr)
165 165
 
166 166
 				// Special case for Windows Server 2019
... ...
@@ -20,7 +20,7 @@ import (
20 20
 )
21 21
 
22 22
 func TestNetworkNat(t *testing.T) {
23
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
23
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
24 24
 	skip.If(t, testEnv.IsRemoteDaemon)
25 25
 
26 26
 	defer setupTest(t)()
... ...
@@ -57,7 +57,7 @@ func TestNetworkLocalhostTCPNat(t *testing.T) {
57 57
 
58 58
 func TestNetworkLoopbackNat(t *testing.T) {
59 59
 	skip.If(t, testEnv.GitHubActions, "FIXME: https://github.com/moby/moby/issues/41561")
60
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
60
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
61 61
 	skip.If(t, testEnv.IsRemoteDaemon)
62 62
 
63 63
 	defer setupTest(t)()
... ...
@@ -18,7 +18,7 @@ import (
18 18
 )
19 19
 
20 20
 func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) {
21
-	if testEnv.OSType == "windows" {
21
+	if testEnv.DaemonInfo.OSType == "windows" {
22 22
 		return "c:", `\`
23 23
 	}
24 24
 	return "", "/"
... ...
@@ -23,7 +23,7 @@ import (
23 23
 // This checks that "rename" updates source container correctly and doesn't set it to null.
24 24
 func TestRenameLinkedContainer(t *testing.T) {
25 25
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.32"), "broken in earlier versions")
26
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
26
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
27 27
 	defer setupTest(t)()
28 28
 	ctx := context.Background()
29 29
 	client := testEnv.APIClient()
... ...
@@ -151,7 +151,7 @@ func TestRenameAnonymousContainer(t *testing.T) {
151 151
 	poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.WithDelay(100*time.Millisecond))
152 152
 
153 153
 	count := "-c"
154
-	if testEnv.OSType == "windows" {
154
+	if testEnv.DaemonInfo.OSType == "windows" {
155 155
 		count = "-n"
156 156
 	}
157 157
 	cID = container.Run(ctx, t, client, func(c *container.TestContainerConfig) {
... ...
@@ -190,7 +190,7 @@ func TestRenameContainerWithSameName(t *testing.T) {
190 190
 // container could still reference to the container that is renamed.
191 191
 func TestRenameContainerWithLinkedContainer(t *testing.T) {
192 192
 	skip.If(t, testEnv.IsRemoteDaemon)
193
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
193
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
194 194
 
195 195
 	defer setupTest(t)()
196 196
 	ctx := context.Background()
... ...
@@ -17,7 +17,7 @@ import (
17 17
 // a timeout works as documented, i.e. in case of negative timeout
18 18
 // waiting is not limited (issue #35311).
19 19
 func TestStopContainerWithTimeout(t *testing.T) {
20
-	skip.If(t, testEnv.OSType == "windows")
20
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
21 21
 	defer setupTest(t)()
22 22
 	client := testEnv.APIClient()
23 23
 	ctx := context.Background()
... ...
@@ -33,7 +33,7 @@ func TestUpdateRestartPolicy(t *testing.T) {
33 33
 	assert.NilError(t, err)
34 34
 
35 35
 	timeout := 60 * time.Second
36
-	if testEnv.OSType == "windows" {
36
+	if testEnv.DaemonInfo.OSType == "windows" {
37 37
 		timeout = 180 * time.Second
38 38
 	}
39 39
 
... ...
@@ -22,7 +22,7 @@ import (
22 22
 func TestImportExtremelyLargeImageWorks(t *testing.T) {
23 23
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
24 24
 	skip.If(t, runtime.GOARCH == "arm64", "effective test will be time out")
25
-	skip.If(t, testEnv.OSType == "windows", "TODO enable on windows")
25
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "TODO enable on windows")
26 26
 	t.Parallel()
27 27
 
28 28
 	// Spin up a new daemon, so that we can run this test in parallel (it's a slow test)
... ...
@@ -51,7 +51,7 @@ func TestImportExtremelyLargeImageWorks(t *testing.T) {
51 51
 }
52 52
 
53 53
 func TestImportWithCustomPlatform(t *testing.T) {
54
-	skip.If(t, testEnv.OSType == "windows", "TODO enable on windows")
54
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "TODO enable on windows")
55 55
 
56 56
 	defer setupTest(t)()
57 57
 	client := testEnv.APIClient()
... ...
@@ -13,7 +13,7 @@ import (
13 13
 
14 14
 // Regression test for: https://github.com/moby/moby/issues/45556
15 15
 func TestImageInspectEmptyTagsAndDigests(t *testing.T) {
16
-	skip.If(t, testEnv.OSType == "windows", "build-empty-images is not called on Windows")
16
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "build-empty-images is not called on Windows")
17 17
 	defer setupTest(t)()
18 18
 
19 19
 	client := testEnv.APIClient()
... ...
@@ -115,7 +115,7 @@ func createTestImage(ctx context.Context, t testing.TB, store content.Store) oci
115 115
 // verifies with the remote that the digest exists in that repo.
116 116
 func TestImagePullStoredfDigestForOtherRepo(t *testing.T) {
117 117
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
118
-	skip.If(t, testEnv.OSType == "windows", "We don't run a test registry on Windows")
118
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "We don't run a test registry on Windows")
119 119
 	skip.If(t, testEnv.IsRootless, "Rootless has a different view of localhost (needed for test registry access)")
120 120
 	defer setupTest(t)()
121 121
 
... ...
@@ -161,7 +161,7 @@ func TestSaveRepoWithMultipleImages(t *testing.T) {
161 161
 }
162 162
 
163 163
 func TestSaveDirectoryPermissions(t *testing.T) {
164
-	skip.If(t, testEnv.OSType == "windows", "Test is looking at linux specific details")
164
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Test is looking at linux specific details")
165 165
 
166 166
 	defer setupTest(t)()
167 167
 
... ...
@@ -65,7 +65,7 @@ func TestNetworkCreateDelete(t *testing.T) {
65 65
 // ID is removed, and not the network with the given name.
66 66
 func TestDockerNetworkDeletePreferID(t *testing.T) {
67 67
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.34"), "broken in earlier versions")
68
-	skip.If(t, testEnv.OSType == "windows",
68
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows",
69 69
 		"FIXME. Windows doesn't run DinD and uses networks shared between control daemon and daemon under test")
70 70
 	defer setupTest(t)()
71 71
 	client := testEnv.APIClient()
... ...
@@ -13,7 +13,7 @@ import (
13 13
 )
14 14
 
15 15
 func TestInspectNetwork(t *testing.T) {
16
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
16
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
17 17
 	skip.If(t, testEnv.IsRootless, "rootless mode doesn't support Swarm-mode")
18 18
 	defer setupTest(t)()
19 19
 	d := swarm.NewSwarm(t, testEnv)
... ...
@@ -153,7 +153,7 @@ func TestNetworkList(t *testing.T) {
153 153
 }
154 154
 
155 155
 func TestHostIPv4BridgeLabel(t *testing.T) {
156
-	skip.If(t, testEnv.OSType == "windows")
156
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
157 157
 	skip.If(t, testEnv.IsRemoteDaemon)
158 158
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
159 159
 	d := daemon.New(t)
... ...
@@ -179,7 +179,7 @@ func TestHostIPv4BridgeLabel(t *testing.T) {
179 179
 }
180 180
 
181 181
 func TestDefaultNetworkOpts(t *testing.T) {
182
-	skip.If(t, testEnv.OSType == "windows")
182
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
183 183
 	skip.If(t, testEnv.IsRemoteDaemon)
184 184
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
185 185
 
... ...
@@ -27,7 +27,7 @@ func delInterface(t *testing.T, ifName string) {
27 27
 }
28 28
 
29 29
 func TestDaemonRestartWithLiveRestore(t *testing.T) {
30
-	skip.If(t, testEnv.OSType == "windows")
30
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
31 31
 	skip.If(t, testEnv.IsRemoteDaemon)
32 32
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
33 33
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
... ...
@@ -56,7 +56,7 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) {
56 56
 }
57 57
 
58 58
 func TestDaemonDefaultNetworkPools(t *testing.T) {
59
-	skip.If(t, testEnv.OSType == "windows")
59
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
60 60
 	// Remove docker0 bridge and the start daemon defining the predefined address pools
61 61
 	skip.If(t, testEnv.IsRemoteDaemon)
62 62
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
... ...
@@ -99,7 +99,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
99 99
 }
100 100
 
101 101
 func TestDaemonRestartWithExistingNetwork(t *testing.T) {
102
-	skip.If(t, testEnv.OSType == "windows")
102
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
103 103
 	skip.If(t, testEnv.IsRemoteDaemon)
104 104
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
105 105
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
... ...
@@ -133,7 +133,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) {
133 133
 }
134 134
 
135 135
 func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
136
-	skip.If(t, testEnv.OSType == "windows")
136
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
137 137
 	skip.If(t, testEnv.IsRemoteDaemon)
138 138
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
139 139
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
... ...
@@ -184,7 +184,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
184 184
 }
185 185
 
186 186
 func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) {
187
-	skip.If(t, testEnv.OSType == "windows")
187
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
188 188
 	skip.If(t, testEnv.IsRemoteDaemon)
189 189
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
190 190
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
... ...
@@ -209,7 +209,7 @@ func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) {
209 209
 }
210 210
 
211 211
 func TestServiceWithPredefinedNetwork(t *testing.T) {
212
-	skip.If(t, testEnv.OSType == "windows")
212
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
213 213
 	skip.If(t, testEnv.IsRootless, "rootless mode doesn't support Swarm-mode")
214 214
 	defer setupTest(t)()
215 215
 	d := swarm.NewSwarm(t, testEnv)
... ...
@@ -242,7 +242,7 @@ func TestServiceRemoveKeepsIngressNetwork(t *testing.T) {
242 242
 	t.Skip("FLAKY_TEST")
243 243
 	skip.If(t, testEnv.IsRootless, "rootless mode doesn't support Swarm-mode")
244 244
 
245
-	skip.If(t, testEnv.OSType == "windows")
245
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
246 246
 	defer setupTest(t)()
247 247
 	d := swarm.NewSwarm(t, testEnv)
248 248
 	defer d.Stop(t)
... ...
@@ -330,7 +330,7 @@ func noServices(ctx context.Context, client client.ServiceAPIClient) func(log po
330 330
 }
331 331
 
332 332
 func TestServiceWithDataPathPortInit(t *testing.T) {
333
-	skip.If(t, testEnv.OSType == "windows")
333
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
334 334
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "DataPathPort was added in API v1.40")
335 335
 	skip.If(t, testEnv.IsRootless, "rootless mode doesn't support Swarm-mode")
336 336
 	defer setupTest(t)()
... ...
@@ -398,7 +398,7 @@ func TestServiceWithDataPathPortInit(t *testing.T) {
398 398
 }
399 399
 
400 400
 func TestServiceWithDefaultAddressPoolInit(t *testing.T) {
401
-	skip.If(t, testEnv.OSType == "windows")
401
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
402 402
 	skip.If(t, testEnv.IsRootless, "rootless mode doesn't support Swarm-mode")
403 403
 	defer setupTest(t)()
404 404
 	d := swarm.NewSwarm(t, testEnv,
... ...
@@ -90,7 +90,7 @@ func TestPluginInvalidJSON(t *testing.T) {
90 90
 
91 91
 func TestPluginInstall(t *testing.T) {
92 92
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
93
-	skip.If(t, testEnv.OSType == "windows")
93
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
94 94
 	skip.If(t, testEnv.IsRootless, "rootless mode has different view of localhost")
95 95
 
96 96
 	ctx := context.Background()
... ...
@@ -199,7 +199,7 @@ func TestPluginInstall(t *testing.T) {
199 199
 func TestPluginsWithRuntimes(t *testing.T) {
200 200
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
201 201
 	skip.If(t, testEnv.IsRootless, "Test not supported on rootless due to buggy daemon setup in rootless mode due to daemon restart")
202
-	skip.If(t, testEnv.OSType == "windows")
202
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
203 203
 
204 204
 	dir, err := os.MkdirTemp("", t.Name())
205 205
 	assert.NilError(t, err)
... ...
@@ -261,7 +261,7 @@ func TestPluginsWithRuntimes(t *testing.T) {
261 261
 
262 262
 func TestPluginBackCompatMediaTypes(t *testing.T) {
263 263
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
264
-	skip.If(t, testEnv.OSType == "windows")
264
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows")
265 265
 	skip.If(t, testEnv.IsRootless, "Rootless has a different view of localhost (needed for test registry access)")
266 266
 
267 267
 	defer setupTest(t)()
... ...
@@ -12,7 +12,7 @@ import (
12 12
 )
13 13
 
14 14
 func TestSessionCreate(t *testing.T) {
15
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
15
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
16 16
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
17 17
 
18 18
 	defer setupTest(t)()
... ...
@@ -33,7 +33,7 @@ func TestSessionCreate(t *testing.T) {
33 33
 }
34 34
 
35 35
 func TestSessionCreateWithBadUpgrade(t *testing.T) {
36
-	skip.If(t, testEnv.OSType == "windows", "FIXME")
36
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
37 37
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
38 38
 
39 39
 	defer setupTest(t)()
... ...
@@ -13,7 +13,7 @@ import (
13 13
 )
14 14
 
15 15
 func TestDiskUsage(t *testing.T) {
16
-	skip.If(t, testEnv.OSType == "windows") // d.Start fails on Windows with `protocol not available`
16
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows") // d.Start fails on Windows with `protocol not available`
17 17
 
18 18
 	t.Parallel()
19 19
 
... ...
@@ -29,7 +29,7 @@ import (
29 29
 
30 30
 func TestEventsExecDie(t *testing.T) {
31 31
 	skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.36"), "broken in earlier versions")
32
-	skip.If(t, testEnv.OSType == "windows", "FIXME. Suspect may need to wait until container is running before exec")
32
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME. Suspect may need to wait until container is running before exec")
33 33
 	defer setupTest(t)()
34 34
 	ctx := context.Background()
35 35
 	client := testEnv.APIClient()
... ...
@@ -77,7 +77,7 @@ func TestEventsExecDie(t *testing.T) {
77 77
 // backward compatibility so old `JSONMessage` could still be used.
78 78
 // This test verifies that backward compatibility maintains.
79 79
 func TestEventsBackwardsCompatible(t *testing.T) {
80
-	skip.If(t, testEnv.OSType == "windows", "Windows doesn't support back-compat messages")
80
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "Windows doesn't support back-compat messages")
81 81
 	defer setupTest(t)()
82 82
 	ctx := context.Background()
83 83
 	client := testEnv.APIClient()
... ...
@@ -128,7 +128,7 @@ func TestEventsBackwardsCompatible(t *testing.T) {
128 128
 // TestEventsVolumeCreate verifies that volume create events are only fired
129 129
 // once: when creating the volume, and not when attaching to a container.
130 130
 func TestEventsVolumeCreate(t *testing.T) {
131
-	skip.If(t, testEnv.OSType == "windows", "FIXME: Windows doesn't trigger the events? Could be a race")
131
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME: Windows doesn't trigger the events? Could be a race")
132 132
 
133 133
 	defer setupTest(t)()
134 134
 	ctx, cancel := context.WithCancel(context.Background())
... ...
@@ -19,5 +19,5 @@ func TestVersion(t *testing.T) {
19 19
 	assert.Check(t, version.Version != "")
20 20
 	assert.Check(t, version.MinAPIVersion != "")
21 21
 	assert.Check(t, is.Equal(testEnv.DaemonInfo.ExperimentalBuild, version.Experimental))
22
-	assert.Check(t, is.Equal(testEnv.OSType, version.Os))
22
+	assert.Check(t, is.Equal(testEnv.DaemonInfo.OSType, version.Os))
23 23
 }
... ...
@@ -32,7 +32,7 @@ func TestVolumesCreateAndList(t *testing.T) {
32 32
 
33 33
 	name := t.Name()
34 34
 	// Windows file system is case insensitive
35
-	if testEnv.OSType == "windows" {
35
+	if testEnv.DaemonInfo.OSType == "windows" {
36 36
 		name = strings.ToLower(name)
37 37
 	}
38 38
 	vol, err := client.VolumeCreate(ctx, volume.CreateOptions{
... ...
@@ -112,7 +112,7 @@ func TestVolumesRemove(t *testing.T) {
112 112
 // Regression test for https://github.com/docker/cli/issues/4082
113 113
 func TestVolumesRemoveSwarmEnabled(t *testing.T) {
114 114
 	skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")
115
-	skip.If(t, testEnv.OSType == "windows", "TODO enable on windows")
115
+	skip.If(t, testEnv.DaemonInfo.OSType == "windows", "TODO enable on windows")
116 116
 	t.Parallel()
117 117
 	defer setupTest(t)()
118 118
 
... ...
@@ -249,7 +249,7 @@ func TestVolumesInvalidJSON(t *testing.T) {
249 249
 }
250 250
 
251 251
 func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) {
252
-	if testEnv.OSType == "windows" {
252
+	if testEnv.DaemonInfo.OSType == "windows" {
253 253
 		return "c:", `\`
254 254
 	}
255 255
 	return "", "/"
... ...
@@ -311,7 +311,7 @@ func TestVolumePruneAnonFromImage(t *testing.T) {
311 311
 	client := testEnv.APIClient()
312 312
 
313 313
 	volDest := "/foo"
314
-	if testEnv.OSType == "windows" {
314
+	if testEnv.DaemonInfo.OSType == "windows" {
315 315
 		volDest = `c:\\foo`
316 316
 	}
317 317
 
... ...
@@ -21,7 +21,7 @@ func (e *Execution) Clean(t testing.TB) {
21 21
 	t.Helper()
22 22
 	apiClient := e.APIClient()
23 23
 
24
-	platform := e.OSType
24
+	platform := e.DaemonInfo.OSType
25 25
 	if (platform != "windows") || (platform == "windows" && e.DaemonInfo.Isolation == "hyperv") {
26 26
 		unpauseAllContainers(t, apiClient)
27 27
 	}
... ...
@@ -21,7 +21,6 @@ import (
21 21
 type Execution struct {
22 22
 	client            client.APIClient
23 23
 	DaemonInfo        types.Info
24
-	OSType            string
25 24
 	PlatformDefaults  PlatformDefaults
26 25
 	protectedElements protectedElements
27 26
 }
... ...
@@ -53,7 +52,6 @@ func FromClient(c *client.Client) (*Execution, error) {
53 53
 	return &Execution{
54 54
 		client:            c,
55 55
 		DaemonInfo:        info,
56
-		OSType:            info.OSType,
57 56
 		PlatformDefaults:  getPlatformDefaults(info),
58 57
 		protectedElements: newProtectedElements(),
59 58
 	}, nil
... ...
@@ -208,7 +206,7 @@ func (e *Execution) HasExistingImage(t testing.TB, reference string) bool {
208 208
 // EnsureFrozenImagesLinux loads frozen test images into the daemon
209 209
 // if they aren't already loaded
210 210
 func EnsureFrozenImagesLinux(testEnv *Execution) error {
211
-	if testEnv.OSType == "linux" {
211
+	if testEnv.DaemonInfo.OSType == "linux" {
212 212
 		err := load.FrozenImagesLinux(testEnv.APIClient(), frozenImages...)
213 213
 		if err != nil {
214 214
 			return errors.Wrap(err, "error loading frozen images")
... ...
@@ -40,7 +40,7 @@ func ProtectAll(t testing.TB, testEnv *Execution) {
40 40
 	ProtectImages(t, testEnv)
41 41
 	ProtectNetworks(t, testEnv)
42 42
 	ProtectVolumes(t, testEnv)
43
-	if testEnv.OSType == "linux" {
43
+	if testEnv.DaemonInfo.OSType == "linux" {
44 44
 		ProtectPlugins(t, testEnv)
45 45
 	}
46 46
 }
... ...
@@ -91,7 +91,7 @@ func ProtectImages(t testing.TB, testEnv *Execution) {
91 91
 	t.Helper()
92 92
 	images := getExistingImages(t, testEnv)
93 93
 
94
-	if testEnv.OSType == "linux" {
94
+	if testEnv.DaemonInfo.OSType == "linux" {
95 95
 		images = append(images, frozenImages...)
96 96
 	}
97 97
 	testEnv.ProtectImage(t, images...)
... ...
@@ -35,7 +35,7 @@ func ensureHTTPServerImage(t testing.TB) {
35 35
 	}
36 36
 	defer os.RemoveAll(tmp)
37 37
 
38
-	goos := testEnv.OSType
38
+	goos := testEnv.DaemonInfo.OSType
39 39
 	if goos == "" {
40 40
 		goos = "linux"
41 41
 	}