Browse code

Remove SameHostDaemon, use testEnv.IsLocalDaemon instead

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

Sebastiaan van Stijn authored on 2018/12/24 21:25:53
Showing 36 changed files
... ...
@@ -125,7 +125,7 @@ func (s *DockerRegistrySuite) OnTimeout(c *check.C) {
125 125
 }
126 126
 
127 127
 func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
128
-	testRequires(c, DaemonIsLinux, RegistryHosting, SameHostDaemon)
128
+	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
129 129
 	s.reg = registry.NewV2(c)
130 130
 	s.reg.WaitReady(c)
131 131
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
... ...
@@ -158,7 +158,7 @@ func (s *DockerSchema1RegistrySuite) OnTimeout(c *check.C) {
158 158
 }
159 159
 
160 160
 func (s *DockerSchema1RegistrySuite) SetUpTest(c *check.C) {
161
-	testRequires(c, DaemonIsLinux, RegistryHosting, NotArm64, SameHostDaemon)
161
+	testRequires(c, DaemonIsLinux, RegistryHosting, NotArm64, testEnv.IsLocalDaemon)
162 162
 	s.reg = registry.NewV2(c, registry.Schema1)
163 163
 	s.reg.WaitReady(c)
164 164
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
... ...
@@ -191,7 +191,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) OnTimeout(c *check.C) {
191 191
 }
192 192
 
193 193
 func (s *DockerRegistryAuthHtpasswdSuite) SetUpTest(c *check.C) {
194
-	testRequires(c, DaemonIsLinux, RegistryHosting, SameHostDaemon)
194
+	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
195 195
 	s.reg = registry.NewV2(c, registry.Htpasswd)
196 196
 	s.reg.WaitReady(c)
197 197
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
... ...
@@ -226,7 +226,7 @@ func (s *DockerRegistryAuthTokenSuite) OnTimeout(c *check.C) {
226 226
 }
227 227
 
228 228
 func (s *DockerRegistryAuthTokenSuite) SetUpTest(c *check.C) {
229
-	testRequires(c, DaemonIsLinux, RegistryHosting, SameHostDaemon)
229
+	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
230 230
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
231 231
 }
232 232
 
... ...
@@ -266,12 +266,12 @@ func (s *DockerDaemonSuite) OnTimeout(c *check.C) {
266 266
 }
267 267
 
268 268
 func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
269
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
269
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
270 270
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
271 271
 }
272 272
 
273 273
 func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
274
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
274
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
275 275
 	if s.d != nil {
276 276
 		s.d.Stop(c)
277 277
 	}
... ...
@@ -318,7 +318,7 @@ func (s *DockerSwarmSuite) OnTimeout(c *check.C) {
318 318
 }
319 319
 
320 320
 func (s *DockerSwarmSuite) SetUpTest(c *check.C) {
321
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
321
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
322 322
 }
323 323
 
324 324
 func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemon.Daemon {
... ...
@@ -1252,7 +1252,7 @@ func (s *DockerSuite) TestContainerAPIDeleteConflict(c *check.C) {
1252 1252
 }
1253 1253
 
1254 1254
 func (s *DockerSuite) TestContainerAPIDeleteRemoveVolume(c *check.C) {
1255
-	testRequires(c, SameHostDaemon)
1255
+	testRequires(c, testEnv.IsLocalDaemon)
1256 1256
 
1257 1257
 	vol := "/testvolume"
1258 1258
 	if testEnv.OSType == "windows" {
... ...
@@ -1426,7 +1426,7 @@ func (s *DockerSuite) TestPutContainerArchiveErrSymlinkInVolumeToReadOnlyRootfs(
1426 1426
 	// Windows does not support read-only rootfs
1427 1427
 	// Requires local volume mount bind.
1428 1428
 	// --read-only + userns has remount issues
1429
-	testRequires(c, SameHostDaemon, NotUserNamespace, DaemonIsLinux)
1429
+	testRequires(c, testEnv.IsLocalDaemon, NotUserNamespace, DaemonIsLinux)
1430 1430
 
1431 1431
 	testVol := getTestDir(c, "test-put-container-archive-err-symlink-in-volume-to-read-only-rootfs-")
1432 1432
 	defer os.RemoveAll(testVol)
... ...
@@ -1797,7 +1797,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
1797 1797
 		},
1798 1798
 	}
1799 1799
 
1800
-	if SameHostDaemon() {
1800
+	if testEnv.IsLocalDaemon() {
1801 1801
 		tmpDir, err := ioutils.TempDir("", "test-mounts-api")
1802 1802
 		c.Assert(err, checker.IsNil)
1803 1803
 		defer os.RemoveAll(tmpDir)
... ...
@@ -1900,7 +1900,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsValidation(c *check.C) {
1900 1900
 }
1901 1901
 
1902 1902
 func (s *DockerSuite) TestContainerAPICreateMountsBindRead(c *check.C) {
1903
-	testRequires(c, NotUserNamespace, SameHostDaemon)
1903
+	testRequires(c, NotUserNamespace, testEnv.IsLocalDaemon)
1904 1904
 	// also with data in the host side
1905 1905
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
1906 1906
 	destPath := prefix + slash + "foo"
... ...
@@ -1988,7 +1988,7 @@ func (s *DockerSuite) TestContainersAPICreateMountsCreate(c *check.C) {
1988 1988
 		},
1989 1989
 	}
1990 1990
 
1991
-	if SameHostDaemon() {
1991
+	if testEnv.IsLocalDaemon() {
1992 1992
 		// setup temp dir for testing binds
1993 1993
 		tmpDir1, err := ioutil.TempDir("", "test-mounts-api-1")
1994 1994
 		c.Assert(err, checker.IsNil)
... ...
@@ -19,7 +19,7 @@ import (
19 19
 )
20 20
 
21 21
 func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *check.C) {
22
-	testRequires(c, SameHostDaemon, DaemonIsWindowsAtLeastBuild(16299)) // Named pipe support was added in RS3
22
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsWindowsAtLeastBuild(16299)) // Named pipe support was added in RS3
23 23
 
24 24
 	// Create a host pipe to map into the container
25 25
 	hostPipeName := fmt.Sprintf(`\\.\pipe\docker-cli-test-pipe-%x`, rand.Uint64())
... ...
@@ -212,7 +212,7 @@ func (s *DockerSuite) TestExecAPIStartInvalidCommand(c *check.C) {
212 212
 }
213 213
 
214 214
 func (s *DockerSuite) TestExecStateCleanup(c *check.C) {
215
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
215
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
216 216
 
217 217
 	// This test checks accidental regressions. Not part of stable API.
218 218
 
... ...
@@ -147,7 +147,7 @@ func (s *DockerSuite) TestAPIImagesImportBadSrc(c *check.C) {
147 147
 		}
148 148
 	}
149 149
 
150
-	testRequires(c, Network, SameHostDaemon)
150
+	testRequires(c, Network, testEnv.IsLocalDaemon)
151 151
 
152 152
 	server := httptest.NewServer(http.NewServeMux())
153 153
 	defer server.Close()
... ...
@@ -97,7 +97,7 @@ func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *check.C) {
97 97
 }
98 98
 
99 99
 func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) {
100
-	testRequires(c, SameHostDaemon)
100
+	testRequires(c, testEnv.IsLocalDaemon)
101 101
 
102 102
 	out := runSleepingContainer(c)
103 103
 	id := strings.TrimSpace(out)
... ...
@@ -165,7 +165,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) {
165 165
 
166 166
 func (s *DockerSuite) TestAPIStatsNetworkStatsVersioning(c *check.C) {
167 167
 	// Windows doesn't support API versions less than 1.25, so no point testing 1.17 .. 1.21
168
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
168
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
169 169
 
170 170
 	out := runSleepingContainer(c)
171 171
 	id := strings.TrimSpace(out)
... ...
@@ -538,7 +538,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicePlacementPrefs(c *check.C) {
538 538
 }
539 539
 
540 540
 func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *check.C) {
541
-	testRequires(c, SameHostDaemon)
541
+	testRequires(c, testEnv.IsLocalDaemon)
542 542
 	testRequires(c, DaemonIsLinux)
543 543
 
544 544
 	d1 := s.AddDaemon(c, true, true)
... ...
@@ -16,7 +16,7 @@ import (
16 16
 
17 17
 // #9860 Make sure attach ends when container ends (with no errors)
18 18
 func (s *DockerSuite) TestAttachClosedOnContainerStop(c *check.C) {
19
-	testRequires(c, SameHostDaemon)
19
+	testRequires(c, testEnv.IsLocalDaemon)
20 20
 
21 21
 	out, _ := dockerCmd(c, "run", "-dti", "busybox", "/bin/sh", "-c", `trap 'exit 0' SIGTERM; while true; do sleep 1; done`)
22 22
 
... ...
@@ -1047,7 +1047,7 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
1047 1047
 // Issue #5270 - ensure we throw a better error than "unexpected EOF"
1048 1048
 // when we can't access files in the context.
1049 1049
 func (s *DockerSuite) TestBuildWithInaccessibleFilesInContext(c *check.C) {
1050
-	testRequires(c, DaemonIsLinux, UnixCli, SameHostDaemon) // test uses chown/chmod: not available on windows
1050
+	testRequires(c, DaemonIsLinux, UnixCli, testEnv.IsLocalDaemon) // test uses chown/chmod: not available on windows
1051 1051
 
1052 1052
 	{
1053 1053
 		name := "testbuildinaccessiblefiles"
... ...
@@ -1510,7 +1510,7 @@ func (s *DockerSuite) TestBuildPATH(c *check.C) {
1510 1510
 }
1511 1511
 
1512 1512
 func (s *DockerSuite) TestBuildContextCleanup(c *check.C) {
1513
-	testRequires(c, SameHostDaemon)
1513
+	testRequires(c, testEnv.IsLocalDaemon)
1514 1514
 
1515 1515
 	name := "testbuildcontextcleanup"
1516 1516
 	entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
... ...
@@ -1532,7 +1532,7 @@ func (s *DockerSuite) TestBuildContextCleanup(c *check.C) {
1532 1532
 }
1533 1533
 
1534 1534
 func (s *DockerSuite) TestBuildContextCleanupFailedBuild(c *check.C) {
1535
-	testRequires(c, SameHostDaemon)
1535
+	testRequires(c, testEnv.IsLocalDaemon)
1536 1536
 
1537 1537
 	name := "testbuildcontextcleanup"
1538 1538
 	entries, err := ioutil.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp"))
... ...
@@ -3971,7 +3971,7 @@ func (s *DockerSuite) TestBuildEmptyStringVolume(c *check.C) {
3971 3971
 }
3972 3972
 
3973 3973
 func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {
3974
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
3974
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
3975 3975
 
3976 3976
 	cgroupParent := "test"
3977 3977
 	data, err := ioutil.ReadFile("/proc/self/cgroup")
... ...
@@ -256,7 +256,7 @@ func (s *DockerSuite) TestCpFromSymlinkToDirectory(c *check.C) {
256 256
 // container.
257 257
 func (s *DockerSuite) TestCpToSymlinkToDirectory(c *check.C) {
258 258
 	testRequires(c, DaemonIsLinux)
259
-	testRequires(c, SameHostDaemon) // Requires local volume mount bind.
259
+	testRequires(c, testEnv.IsLocalDaemon) // Requires local volume mount bind.
260 260
 
261 261
 	testVol, err := ioutil.TempDir("", "test-cp-to-symlink-to-dir-")
262 262
 	c.Assert(err, checker.IsNil)
... ...
@@ -379,7 +379,7 @@ func (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {
379 379
 
380 380
 // Check that cp with unprivileged user doesn't return any error
381 381
 func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
382
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
382
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
383 383
 	testRequires(c, UnixCli) // uses chmod/su: not available on windows
384 384
 
385 385
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "touch "+cpTestName)
... ...
@@ -404,7 +404,7 @@ func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
404 404
 
405 405
 func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
406 406
 	testRequires(c, DaemonIsLinux)
407
-	testRequires(c, SameHostDaemon)
407
+	testRequires(c, testEnv.IsLocalDaemon)
408 408
 
409 409
 	outDir, err := ioutil.TempDir("", "cp-test-special-files")
410 410
 	c.Assert(err, checker.IsNil)
... ...
@@ -453,7 +453,7 @@ func (s *DockerSuite) TestCpVolumePath(c *check.C) {
453 453
 	//  stat /tmp/cp-test-volumepath851508420/test gets permission denied for the user
454 454
 	testRequires(c, NotUserNamespace)
455 455
 	testRequires(c, DaemonIsLinux)
456
-	testRequires(c, SameHostDaemon)
456
+	testRequires(c, testEnv.IsLocalDaemon)
457 457
 
458 458
 	tmpDir, err := ioutil.TempDir("", "cp-test-volumepath")
459 459
 	c.Assert(err, checker.IsNil)
... ...
@@ -560,7 +560,7 @@ func (s *DockerSuite) TestCpToStdout(c *check.C) {
560 560
 }
561 561
 
562 562
 func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
563
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
563
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
564 564
 
565 565
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /te:s:t")
566 566
 
... ...
@@ -23,7 +23,7 @@ func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
23 23
 	//  stat /tmp/test-cp-to-symlink-destination-262430901/vol3 gets permission denied for the user
24 24
 	testRequires(c, NotUserNamespace)
25 25
 	testRequires(c, DaemonIsLinux)
26
-	testRequires(c, SameHostDaemon) // Requires local volume mount bind.
26
+	testRequires(c, testEnv.IsLocalDaemon) // Requires local volume mount bind.
27 27
 
28 28
 	testVol := getTestDir(c, "test-cp-to-symlink-destination-")
29 29
 	defer os.RemoveAll(testVol)
... ...
@@ -15,7 +15,7 @@ import (
15 15
 )
16 16
 
17 17
 func (s *DockerSuite) TestCpToContainerWithPermissions(c *check.C) {
18
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
18
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
19 19
 
20 20
 	tmpDir := getTestDir(c, "test-cp-to-host-with-permissions")
21 21
 	defer os.RemoveAll(tmpDir)
... ...
@@ -39,7 +39,7 @@ func (s *DockerSuite) TestCpToContainerWithPermissions(c *check.C) {
39 39
 
40 40
 // Check ownership is root, both in non-userns and userns enabled modes
41 41
 func (s *DockerSuite) TestCpCheckDestOwnership(c *check.C) {
42
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
42
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
43 43
 	tmpVolDir := getTestDir(c, "test-cp-tmpvol")
44 44
 	containerID := makeTestContainer(c,
45 45
 		testContainerOptions{volumes: []string{fmt.Sprintf("%s:/tmpvol", tmpVolDir)}})
... ...
@@ -291,7 +291,7 @@ func containerStartOutputEquals(c *check.C, containerID, contents string) (err e
291 291
 }
292 292
 
293 293
 func defaultVolumes(tmpDir string) []string {
294
-	if SameHostDaemon() {
294
+	if testEnv.IsLocalDaemon() {
295 295
 		return []string{
296 296
 			"/vol1",
297 297
 			fmt.Sprintf("%s:/vol2", tmpDir),
... ...
@@ -171,7 +171,7 @@ func (s *DockerSuite) TestCreateEchoStdout(c *check.C) {
171 171
 }
172 172
 
173 173
 func (s *DockerSuite) TestCreateVolumesCreated(c *check.C) {
174
-	testRequires(c, SameHostDaemon)
174
+	testRequires(c, testEnv.IsLocalDaemon)
175 175
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
176 176
 
177 177
 	name := "test_create_volume"
... ...
@@ -249,7 +249,7 @@ func (s *DockerSuite) TestCreateRM(c *check.C) {
249 249
 
250 250
 func (s *DockerSuite) TestCreateModeIpcContainer(c *check.C) {
251 251
 	// Uses Linux specific functionality (--ipc)
252
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
252
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
253 253
 
254 254
 	out, _ := dockerCmd(c, "create", "busybox")
255 255
 	id := strings.TrimSpace(out)
... ...
@@ -121,7 +121,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C)
121 121
 
122 122
 // TestDaemonShutdownWithPlugins shuts down running plugins.
123 123
 func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
124
-	testRequires(c, IsAmd64, Network, SameHostDaemon)
124
+	testRequires(c, IsAmd64, Network, testEnv.IsLocalDaemon)
125 125
 
126 126
 	s.d.Start(c)
127 127
 	if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil {
... ...
@@ -159,7 +159,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
159 159
 
160 160
 // TestDaemonKillWithPlugins leaves plugins running.
161 161
 func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) {
162
-	testRequires(c, IsAmd64, Network, SameHostDaemon)
162
+	testRequires(c, IsAmd64, Network, testEnv.IsLocalDaemon)
163 163
 
164 164
 	s.d.Start(c)
165 165
 	if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil {
... ...
@@ -413,7 +413,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6Enabled(c *check.C) {
413 413
 // that running containers are given a link-local and global IPv6 address
414 414
 func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *check.C) {
415 415
 	// IPv6 setup is messing with local bridge address.
416
-	testRequires(c, SameHostDaemon)
416
+	testRequires(c, testEnv.IsLocalDaemon)
417 417
 	// Delete the docker0 bridge if its left around from previous daemon. It has to be recreated with
418 418
 	// ipv6 enabled
419 419
 	deleteInterface(c, "docker0")
... ...
@@ -440,7 +440,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *check.C) {
440 440
 // the running containers are given an IPv6 address derived from the MAC address and the ipv6 fixed CIDR
441 441
 func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *check.C) {
442 442
 	// IPv6 setup is messing with local bridge address.
443
-	testRequires(c, SameHostDaemon)
443
+	testRequires(c, testEnv.IsLocalDaemon)
444 444
 	// Delete the docker0 bridge if its left around from previous daemon. It has to be recreated with
445 445
 	// ipv6 enabled
446 446
 	deleteInterface(c, "docker0")
... ...
@@ -458,7 +458,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *check.C) {
458 458
 // TestDaemonIPv6HostMode checks that when the running a container with
459 459
 // network=host the host ipv6 addresses are not removed
460 460
 func (s *DockerDaemonSuite) TestDaemonIPv6HostMode(c *check.C) {
461
-	testRequires(c, SameHostDaemon)
461
+	testRequires(c, testEnv.IsLocalDaemon)
462 462
 	deleteInterface(c, "docker0")
463 463
 
464 464
 	s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:2::/64")
... ...
@@ -822,7 +822,7 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4ExplicitOutsideContainer
822 822
 }
823 823
 
824 824
 func (s *DockerDaemonSuite) TestDaemonDefaultNetworkInvalidClusterConfig(c *check.C) {
825
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
825
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
826 826
 
827 827
 	// Start daemon without docker0 bridge
828 828
 	defaultNetworkBridge := "docker0"
... ...
@@ -1770,7 +1770,7 @@ func (s *DockerDaemonSuite) TestBridgeIPIsExcludedFromAllocatorPool(c *check.C)
1770 1770
 
1771 1771
 // Test daemon for no space left on device error
1772 1772
 func (s *DockerDaemonSuite) TestDaemonNoSpaceLeftOnDeviceError(c *check.C) {
1773
-	testRequires(c, SameHostDaemon, DaemonIsLinux, Network)
1773
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, Network)
1774 1774
 
1775 1775
 	testDir, err := ioutil.TempDir("", "no-space-left-on-device-test")
1776 1776
 	c.Assert(err, checker.IsNil)
... ...
@@ -2203,7 +2203,7 @@ func (s *DockerDaemonSuite) TestDaemonDebugLog(c *check.C) {
2203 2203
 }
2204 2204
 
2205 2205
 func (s *DockerDaemonSuite) TestDaemonDiscoveryBackendConfigReload(c *check.C) {
2206
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2206
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2207 2207
 
2208 2208
 	// daemon config file
2209 2209
 	daemonConfig := `{ "debug" : false }`
... ...
@@ -2274,7 +2274,7 @@ func (s *DockerDaemonSuite) TestDaemonMaxConcurrency(c *check.C) {
2274 2274
 
2275 2275
 // Test case for #20936, #22443
2276 2276
 func (s *DockerDaemonSuite) TestDaemonMaxConcurrencyWithConfigFile(c *check.C) {
2277
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2277
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2278 2278
 
2279 2279
 	// daemon config file
2280 2280
 	configFilePath := "test.json"
... ...
@@ -2315,7 +2315,7 @@ func (s *DockerDaemonSuite) TestDaemonMaxConcurrencyWithConfigFile(c *check.C) {
2315 2315
 
2316 2316
 // Test case for #20936, #22443
2317 2317
 func (s *DockerDaemonSuite) TestDaemonMaxConcurrencyWithConfigFileReload(c *check.C) {
2318
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2318
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2319 2319
 
2320 2320
 	// daemon config file
2321 2321
 	configFilePath := "test.json"
... ...
@@ -2387,7 +2387,7 @@ func (s *DockerDaemonSuite) TestBuildOnDisabledBridgeNetworkDaemon(c *check.C) {
2387 2387
 
2388 2388
 // Test case for #21976
2389 2389
 func (s *DockerDaemonSuite) TestDaemonDNSFlagsInHostMode(c *check.C) {
2390
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2390
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2391 2391
 
2392 2392
 	s.d.StartWithBusybox(c, "--dns", "1.2.3.4", "--dns-search", "example.com", "--dns-opt", "timeout:3")
2393 2393
 
... ...
@@ -2643,7 +2643,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartSaveContainerExitCode(c *check.C) {
2643 2643
 }
2644 2644
 
2645 2645
 func (s *DockerDaemonSuite) TestDaemonWithUserlandProxyPath(c *check.C) {
2646
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2646
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2647 2647
 
2648 2648
 	dockerProxyPath, err := exec.LookPath("docker-proxy")
2649 2649
 	c.Assert(err, checker.IsNil)
... ...
@@ -2674,7 +2674,7 @@ func (s *DockerDaemonSuite) TestDaemonWithUserlandProxyPath(c *check.C) {
2674 2674
 
2675 2675
 // Test case for #22471
2676 2676
 func (s *DockerDaemonSuite) TestDaemonShutdownTimeout(c *check.C) {
2677
-	testRequires(c, SameHostDaemon)
2677
+	testRequires(c, testEnv.IsLocalDaemon)
2678 2678
 	s.d.StartWithBusybox(c, "--shutdown-timeout=3")
2679 2679
 
2680 2680
 	_, err := s.d.Cmd("run", "-d", "busybox", "top")
... ...
@@ -2695,7 +2695,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownTimeout(c *check.C) {
2695 2695
 
2696 2696
 // Test case for #22471
2697 2697
 func (s *DockerDaemonSuite) TestDaemonShutdownTimeoutWithConfigFile(c *check.C) {
2698
-	testRequires(c, SameHostDaemon)
2698
+	testRequires(c, testEnv.IsLocalDaemon)
2699 2699
 
2700 2700
 	// daemon config file
2701 2701
 	configFilePath := "test.json"
... ...
@@ -2757,7 +2757,7 @@ func (s *DockerDaemonSuite) TestExecWithUserAfterLiveRestore(c *check.C) {
2757 2757
 }
2758 2758
 
2759 2759
 func (s *DockerDaemonSuite) TestRemoveContainerAfterLiveRestore(c *check.C) {
2760
-	testRequires(c, DaemonIsLinux, overlayFSSupported, SameHostDaemon)
2760
+	testRequires(c, DaemonIsLinux, overlayFSSupported, testEnv.IsLocalDaemon)
2761 2761
 	s.d.StartWithBusybox(c, "--live-restore", "--storage-driver", "overlay")
2762 2762
 	out, err := s.d.Cmd("run", "-d", "--name=top", "busybox", "top")
2763 2763
 	c.Assert(err, check.IsNil, check.Commentf("Output: %s", out))
... ...
@@ -2790,7 +2790,7 @@ func (s *DockerDaemonSuite) TestRemoveContainerAfterLiveRestore(c *check.C) {
2790 2790
 
2791 2791
 // #29598
2792 2792
 func (s *DockerDaemonSuite) TestRestartPolicyWithLiveRestore(c *check.C) {
2793
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
2793
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
2794 2794
 	s.d.StartWithBusybox(c, "--live-restore")
2795 2795
 
2796 2796
 	out, err := s.d.Cmd("run", "-d", "--restart", "always", "busybox", "top")
... ...
@@ -2939,7 +2939,7 @@ func testDaemonStartIpcMode(c *check.C, from, mode string, valid bool) {
2939 2939
 // arguments for default IPC mode, and bails out with incorrect ones.
2940 2940
 // Both CLI option (--default-ipc-mode) and config parameter are tested.
2941 2941
 func (s *DockerDaemonSuite) TestDaemonStartWithIpcModes(c *check.C) {
2942
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
2942
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
2943 2943
 
2944 2944
 	ipcModes := []struct {
2945 2945
 		mode  string
... ...
@@ -3004,7 +3004,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartIpcMode(c *check.C) {
3004 3004
 // TestFailedPluginRemove makes sure that a failed plugin remove does not block
3005 3005
 // the daemon from starting
3006 3006
 func (s *DockerDaemonSuite) TestFailedPluginRemove(c *check.C) {
3007
-	testRequires(c, DaemonIsLinux, IsAmd64, SameHostDaemon)
3007
+	testRequires(c, DaemonIsLinux, IsAmd64, testEnv.IsLocalDaemon)
3008 3008
 	d := daemon.New(c, dockerBinary, dockerdBinary)
3009 3009
 	d.Start(c)
3010 3010
 	cli, err := client.NewClient(d.Sock(), api.DefaultVersion, nil, nil)
... ...
@@ -564,7 +564,7 @@ func (s *DockerRegistrySuite) TestEventsImageFilterPush(c *check.C) {
564 564
 
565 565
 func (s *DockerSuite) TestEventsFilterType(c *check.C) {
566 566
 	// FIXME(vdemeester) fails on e2e run
567
-	testRequires(c, SameHostDaemon)
567
+	testRequires(c, testEnv.IsLocalDaemon)
568 568
 	since := daemonUnixTime(c)
569 569
 	name := "labelfiltertest"
570 570
 	label := "io.docker.testing=image"
... ...
@@ -389,7 +389,7 @@ func (s *DockerSuite) TestEventsFilterNetworkID(c *check.C) {
389 389
 }
390 390
 
391 391
 func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
392
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
392
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
393 393
 
394 394
 	// daemon config file
395 395
 	configFilePath := "test.json"
... ...
@@ -458,7 +458,7 @@ func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
458 458
 }
459 459
 
460 460
 func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *check.C) {
461
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
461
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
462 462
 
463 463
 	// daemon config file
464 464
 	configFilePath := "test.json"
... ...
@@ -86,7 +86,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
86 86
 
87 87
 func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
88 88
 	// TODO Windows CI: Requires a little work to get this ported.
89
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
89
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
90 90
 	s.d.StartWithBusybox(c)
91 91
 
92 92
 	out, err := s.d.Cmd("run", "-d", "--name", "top", "-p", "80", "busybox:latest", "top")
... ...
@@ -394,7 +394,7 @@ func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
394 394
 
395 395
 func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
396 396
 	// Not applicable on Windows to Windows CI.
397
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
397
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
398 398
 	for _, fn := range []string{"resolv.conf", "hosts"} {
399 399
 		containers := cli.DockerCmd(c, "ps", "-q", "-a").Combined()
400 400
 		if containers != "" {
... ...
@@ -45,7 +45,7 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
45 45
 }
46 46
 
47 47
 func (s *DockerSuite) TestExecTTY(c *check.C) {
48
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
48
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
49 49
 	dockerCmd(c, "run", "-d", "--name=test", "busybox", "sh", "-c", "echo hello > /foo && top")
50 50
 
51 51
 	cmd := exec.Command(dockerBinary, "exec", "-it", "test", "sh")
... ...
@@ -75,7 +75,7 @@ func (s *DockerSuite) TestExecTTY(c *check.C) {
75 75
 
76 76
 // Test the TERM env var is set when -t is provided on exec
77 77
 func (s *DockerSuite) TestExecWithTERM(c *check.C) {
78
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
78
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
79 79
 	out, _ := dockerCmd(c, "run", "-id", "busybox", "/bin/cat")
80 80
 	contID := strings.TrimSpace(out)
81 81
 	cmd := exec.Command(dockerBinary, "exec", "-t", contID, "sh", "-c", "if [ -z $TERM ]; then exit 1; else exit 0; fi")
... ...
@@ -87,7 +87,7 @@ func (s *DockerSuite) TestExecWithTERM(c *check.C) {
87 87
 // Test that the TERM env var is not set on exec when -t is not provided, even if it was set
88 88
 // on run
89 89
 func (s *DockerSuite) TestExecWithNoTERM(c *check.C) {
90
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
90
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
91 91
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "/bin/cat")
92 92
 	contID := strings.TrimSpace(out)
93 93
 	cmd := exec.Command(dockerBinary, "exec", contID, "sh", "-c", "if [ -z $TERM ]; then exit 0; else exit 1; fi")
... ...
@@ -51,7 +51,7 @@ type DockerExternalVolumeSuite struct {
51 51
 }
52 52
 
53 53
 func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {
54
-	testRequires(c, SameHostDaemon)
54
+	testRequires(c, testEnv.IsLocalDaemon)
55 55
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
56 56
 	s.ec = &eventCounter{}
57 57
 }
... ...
@@ -70,7 +70,7 @@ func (s *DockerSuite) TestInfoFormat(c *check.C) {
70 70
 // TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and
71 71
 // `--cluster-store` properly show the backend's endpoint in info output.
72 72
 func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
73
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
73
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
74 74
 
75 75
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
76 76
 	discoveryBackend := "consul://consuladdr:consulport/some/path"
... ...
@@ -87,7 +87,7 @@ func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
87 87
 // TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with
88 88
 // an invalid `--cluster-advertise` configuration
89 89
 func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
90
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
90
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
91 91
 
92 92
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
93 93
 	discoveryBackend := "consul://consuladdr:consulport/some/path"
... ...
@@ -104,7 +104,7 @@ func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
104 104
 // TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise`
105 105
 // configured with interface name properly show the advertise ip-address in info output.
106 106
 func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) {
107
-	testRequires(c, SameHostDaemon, Network, DaemonIsLinux)
107
+	testRequires(c, testEnv.IsLocalDaemon, Network, DaemonIsLinux)
108 108
 
109 109
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
110 110
 	discoveryBackend := "consul://consuladdr:consulport/some/path"
... ...
@@ -175,7 +175,7 @@ func (s *DockerSuite) TestInfoDisplaysStoppedContainers(c *check.C) {
175 175
 }
176 176
 
177 177
 func (s *DockerSuite) TestInfoDebug(c *check.C) {
178
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
178
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
179 179
 
180 180
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
181 181
 	d.Start(c, "--debug")
... ...
@@ -193,7 +193,7 @@ func (s *DockerSuite) TestInfoDebug(c *check.C) {
193 193
 }
194 194
 
195 195
 func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
196
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
196
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
197 197
 
198 198
 	registryCIDR := "192.168.1.0/24"
199 199
 	registryHost := "insecurehost.com:5000"
... ...
@@ -210,7 +210,7 @@ func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
210 210
 }
211 211
 
212 212
 func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) {
213
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
213
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
214 214
 
215 215
 	registryMirror1 := "https://192.168.1.2"
216 216
 	registryMirror2 := "http://registry.mirror.com:5000"
... ...
@@ -8,7 +8,7 @@ import (
8 8
 )
9 9
 
10 10
 func (s *DockerSuite) TestInfoSecurityOptions(c *check.C) {
11
-	testRequires(c, SameHostDaemon, seccompEnabled, Apparmor, DaemonIsLinux)
11
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor, DaemonIsLinux)
12 12
 
13 13
 	out, _ := dockerCmd(c, "info")
14 14
 	c.Assert(out, checker.Contains, "Security Options:\n apparmor\n seccomp\n  Profile: default\n")
... ...
@@ -139,7 +139,7 @@ func (s *DockerSuite) TestLinksNotStartedParentNotFail(c *check.C) {
139 139
 
140 140
 func (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {
141 141
 	testRequires(c, DaemonIsLinux)
142
-	testRequires(c, SameHostDaemon, ExecSupport)
142
+	testRequires(c, testEnv.IsLocalDaemon, ExecSupport)
143 143
 
144 144
 	out, _ := dockerCmd(c, "run", "-itd", "--name", "one", "busybox", "top")
145 145
 	idOne := strings.TrimSpace(out)
... ...
@@ -157,7 +157,7 @@ func (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {
157 157
 
158 158
 func (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {
159 159
 	testRequires(c, DaemonIsLinux)
160
-	testRequires(c, SameHostDaemon, ExecSupport)
160
+	testRequires(c, testEnv.IsLocalDaemon, ExecSupport)
161 161
 	dockerCmd(c, "run", "-d", "--name", "one", "busybox", "top")
162 162
 	out, _ := dockerCmd(c, "run", "-d", "--name", "two", "--link", "one:onetwo", "--link", "one:one", "busybox", "top")
163 163
 	id := strings.TrimSpace(string(out))
... ...
@@ -590,7 +590,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *check.C) {
590 590
 }
591 591
 
592 592
 func (s *DockerNetworkSuite) TestDockerNetworkIPAMMultipleNetworks(c *check.C) {
593
-	testRequires(c, SameHostDaemon)
593
+	testRequires(c, testEnv.IsLocalDaemon)
594 594
 	// test0 bridge network
595 595
 	dockerCmd(c, "network", "create", "--subnet=192.168.0.0/16", "test1")
596 596
 	assertNwIsAvailable(c, "test1")
... ...
@@ -631,7 +631,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIPAMMultipleNetworks(c *check.C) {
631 631
 }
632 632
 
633 633
 func (s *DockerNetworkSuite) TestDockerNetworkCustomIPAM(c *check.C) {
634
-	testRequires(c, SameHostDaemon)
634
+	testRequires(c, testEnv.IsLocalDaemon)
635 635
 	// Create a bridge network using custom ipam driver
636 636
 	dockerCmd(c, "network", "create", "--ipam-driver", dummyIPAMDriver, "br0")
637 637
 	assertNwIsAvailable(c, "br0")
... ...
@@ -647,7 +647,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkCustomIPAM(c *check.C) {
647 647
 }
648 648
 
649 649
 func (s *DockerNetworkSuite) TestDockerNetworkIPAMOptions(c *check.C) {
650
-	testRequires(c, SameHostDaemon)
650
+	testRequires(c, testEnv.IsLocalDaemon)
651 651
 	// Create a bridge network using custom ipam driver and options
652 652
 	dockerCmd(c, "network", "create", "--ipam-driver", dummyIPAMDriver, "--ipam-opt", "opt1=drv1", "--ipam-opt", "opt2=drv2", "br0")
653 653
 	assertNwIsAvailable(c, "br0")
... ...
@@ -660,7 +660,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIPAMOptions(c *check.C) {
660 660
 }
661 661
 
662 662
 func (s *DockerNetworkSuite) TestDockerNetworkNullIPAMDriver(c *check.C) {
663
-	testRequires(c, SameHostDaemon)
663
+	testRequires(c, testEnv.IsLocalDaemon)
664 664
 	// Create a network with null ipam driver
665 665
 	_, _, err := dockerCmdWithError("network", "create", "-d", dummyNetworkDriver, "--ipam-driver", "null", "test000")
666 666
 	c.Assert(err, check.IsNil)
... ...
@@ -766,7 +766,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIPAMInvalidCombinations(c *check.C
766 766
 }
767 767
 
768 768
 func (s *DockerNetworkSuite) TestDockerNetworkDriverOptions(c *check.C) {
769
-	testRequires(c, SameHostDaemon)
769
+	testRequires(c, testEnv.IsLocalDaemon)
770 770
 	dockerCmd(c, "network", "create", "-d", dummyNetworkDriver, "-o", "opt1=drv1", "-o", "opt2=drv2", "testopt")
771 771
 	assertNwIsAvailable(c, "testopt")
772 772
 	gopts := remoteDriverNetworkRequest.Options[netlabel.GenericData]
... ...
@@ -950,7 +950,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkLinkOnDefaultNetworkOnly(c *check.
950 950
 }
951 951
 
952 952
 func (s *DockerNetworkSuite) TestDockerNetworkOverlayPortMapping(c *check.C) {
953
-	testRequires(c, SameHostDaemon)
953
+	testRequires(c, testEnv.IsLocalDaemon)
954 954
 	// Verify exposed ports are present in ps output when running a container on
955 955
 	// a network managed by a driver which does not provide the default gateway
956 956
 	// for the container
... ...
@@ -977,7 +977,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkOverlayPortMapping(c *check.C) {
977 977
 }
978 978
 
979 979
 func (s *DockerNetworkSuite) TestDockerNetworkDriverUngracefulRestart(c *check.C) {
980
-	testRequires(c, DaemonIsLinux, NotUserNamespace, SameHostDaemon)
980
+	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
981 981
 	dnd := "dnd"
982 982
 	did := "did"
983 983
 
... ...
@@ -1018,7 +1018,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverUngracefulRestart(c *check.C
1018 1018
 }
1019 1019
 
1020 1020
 func (s *DockerNetworkSuite) TestDockerNetworkMacInspect(c *check.C) {
1021
-	testRequires(c, SameHostDaemon)
1021
+	testRequires(c, testEnv.IsLocalDaemon)
1022 1022
 	// Verify endpoint MAC address is correctly populated in container's network settings
1023 1023
 	nwn := "ov"
1024 1024
 	ctn := "bb"
... ...
@@ -1084,7 +1084,7 @@ func verifyContainerIsConnectedToNetworks(c *check.C, d *daemon.Daemon, cName st
1084 1084
 }
1085 1085
 
1086 1086
 func (s *DockerNetworkSuite) TestDockerNetworkMultipleNetworksGracefulDaemonRestart(c *check.C) {
1087
-	testRequires(c, SameHostDaemon)
1087
+	testRequires(c, testEnv.IsLocalDaemon)
1088 1088
 	cName := "bb"
1089 1089
 	nwList := []string{"nw1", "nw2", "nw3"}
1090 1090
 
... ...
@@ -1103,7 +1103,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMultipleNetworksGracefulDaemonRest
1103 1103
 }
1104 1104
 
1105 1105
 func (s *DockerNetworkSuite) TestDockerNetworkMultipleNetworksUngracefulDaemonRestart(c *check.C) {
1106
-	testRequires(c, SameHostDaemon)
1106
+	testRequires(c, testEnv.IsLocalDaemon)
1107 1107
 	cName := "cc"
1108 1108
 	nwList := []string{"nw1", "nw2", "nw3"}
1109 1109
 
... ...
@@ -1130,7 +1130,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkRunNetByID(c *check.C) {
1130 1130
 }
1131 1131
 
1132 1132
 func (s *DockerNetworkSuite) TestDockerNetworkHostModeUngracefulDaemonRestart(c *check.C) {
1133
-	testRequires(c, DaemonIsLinux, NotUserNamespace, SameHostDaemon)
1133
+	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
1134 1134
 	s.d.StartWithBusybox(c)
1135 1135
 
1136 1136
 	// Run a few containers on host network
... ...
@@ -1256,7 +1256,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkRestartWithMultipleNetworks(c *che
1256 1256
 }
1257 1257
 
1258 1258
 func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnectToStoppedContainer(c *check.C) {
1259
-	testRequires(c, SameHostDaemon)
1259
+	testRequires(c, testEnv.IsLocalDaemon)
1260 1260
 	dockerCmd(c, "network", "create", "test")
1261 1261
 	dockerCmd(c, "create", "--name=foo", "busybox", "top")
1262 1262
 	dockerCmd(c, "network", "connect", "test", "foo")
... ...
@@ -1785,7 +1785,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDisconnectFromBridge(c *check.C) {
1785 1785
 // TestConntrackFlowsLeak covers the failure scenario of ticket: https://github.com/docker/docker/issues/8795
1786 1786
 // Validates that conntrack is correctly cleaned once a container is destroyed
1787 1787
 func (s *DockerNetworkSuite) TestConntrackFlowsLeak(c *check.C) {
1788
-	testRequires(c, IsAmd64, DaemonIsLinux, Network, SameHostDaemon)
1788
+	testRequires(c, IsAmd64, DaemonIsLinux, Network, testEnv.IsLocalDaemon)
1789 1789
 
1790 1790
 	// Create a new network
1791 1791
 	cli.DockerCmd(c, "network", "create", "--subnet=192.168.10.0/24", "--gateway=192.168.10.1", "-o", "com.docker.network.bridge.host_binding_ipv4=192.168.10.1", "testbind")
... ...
@@ -440,7 +440,7 @@ enabled: false`, id, name)
440 440
 }
441 441
 
442 442
 func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
443
-	testRequires(c, DaemonIsLinux, Network, SameHostDaemon, IsAmd64, NotUserNamespace)
443
+	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64, NotUserNamespace)
444 444
 	plugin := "cpuguy83/docker-volume-driver-plugin-local:latest"
445 445
 	pluginV2 := "cpuguy83/docker-volume-driver-plugin-local:v2"
446 446
 
... ...
@@ -472,7 +472,7 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
472 472
 }
473 473
 
474 474
 func (s *DockerSuite) TestPluginMetricsCollector(c *check.C) {
475
-	testRequires(c, DaemonIsLinux, Network, SameHostDaemon, IsAmd64)
475
+	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64)
476 476
 	d := daemon.New(c, dockerBinary, dockerdBinary)
477 477
 	d.Start(c)
478 478
 	defer d.Stop(c)
... ...
@@ -10,7 +10,7 @@ import (
10 10
 )
11 11
 
12 12
 func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) {
13
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
13
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
14 14
 
15 15
 	icmd.RunCmd(icmd.Cmd{
16 16
 		Command: []string{dockerBinary, "info"},
... ...
@@ -21,7 +21,7 @@ func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) {
21 21
 // Can't use localhost here since go has a special case to not use proxy if connecting to localhost
22 22
 // See https://golang.org/pkg/net/http/#ProxyFromEnvironment
23 23
 func (s *DockerDaemonSuite) TestCLIProxyProxyTCPSock(c *check.C) {
24
-	testRequires(c, SameHostDaemon)
24
+	testRequires(c, testEnv.IsLocalDaemon)
25 25
 	// get the IP to use to connect since we can't use localhost
26 26
 	addrs, err := net.InterfaceAddrs()
27 27
 	c.Assert(err, checker.IsNil)
... ...
@@ -76,7 +76,7 @@ func (s *DockerSuite) TestRestartWithVolumes(c *check.C) {
76 76
 }
77 77
 
78 78
 func (s *DockerSuite) TestRestartDisconnectedContainer(c *check.C) {
79
-	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace, NotArm)
79
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
80 80
 
81 81
 	// Run a container on the default bridge network
82 82
 	out, _ := dockerCmd(c, "run", "-d", "--name", "c0", "busybox", "top")
... ...
@@ -164,7 +164,7 @@ func (s *DockerSuite) TestRestartContainerwithGoodContainer(c *check.C) {
164 164
 }
165 165
 
166 166
 func (s *DockerSuite) TestRestartContainerSuccess(c *check.C) {
167
-	testRequires(c, SameHostDaemon)
167
+	testRequires(c, testEnv.IsLocalDaemon)
168 168
 
169 169
 	out := runSleepingContainer(c, "-d", "--restart=always")
170 170
 	id := strings.TrimSpace(out)
... ...
@@ -191,7 +191,7 @@ func (s *DockerSuite) TestRestartContainerSuccess(c *check.C) {
191 191
 
192 192
 func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *check.C) {
193 193
 	// TODO Windows. This may be portable following HNS integration post TP5.
194
-	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace, NotArm)
194
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
195 195
 	dockerCmd(c, "network", "create", "-d", "bridge", "udNet")
196 196
 
197 197
 	dockerCmd(c, "run", "-d", "--net=udNet", "--name=first", "busybox", "top")
... ...
@@ -234,7 +234,7 @@ func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *check.C) {
234 234
 }
235 235
 
236 236
 func (s *DockerSuite) TestRestartPolicyAfterRestart(c *check.C) {
237
-	testRequires(c, SameHostDaemon)
237
+	testRequires(c, testEnv.IsLocalDaemon)
238 238
 
239 239
 	out := runSleepingContainer(c, "-d", "--restart=always")
240 240
 	id := strings.TrimSpace(out)
... ...
@@ -383,7 +383,7 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir(c *check.C) {
383 383
 	)
384 384
 	// This test cannot run on a Windows daemon as
385 385
 	// Windows does not support symlinks inside a volume path
386
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
386
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
387 387
 	name := "test-volume-symlink"
388 388
 
389 389
 	dir, err := ioutil.TempDir("", name)
... ...
@@ -427,7 +427,7 @@ func (s *DockerSuite) TestRunCreateVolumesInSymlinkDir2(c *check.C) {
427 427
 	)
428 428
 	// This test cannot run on a Windows daemon as
429 429
 	// Windows does not support symlinks inside a volume path
430
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
430
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
431 431
 	name := "test-volume-symlink2"
432 432
 
433 433
 	if testEnv.OSType == "windows" {
... ...
@@ -494,7 +494,7 @@ func (s *DockerSuite) TestRunVolumesFromInReadWriteMode(c *check.C) {
494 494
 }
495 495
 
496 496
 func (s *DockerSuite) TestVolumesFromGetsProperMode(c *check.C) {
497
-	testRequires(c, SameHostDaemon)
497
+	testRequires(c, testEnv.IsLocalDaemon)
498 498
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
499 499
 	hostpath := RandomTmpDirPath("test", testEnv.OSType)
500 500
 	if err := os.MkdirAll(hostpath, 0755); err != nil {
... ...
@@ -525,7 +525,7 @@ func (s *DockerSuite) TestRunNoDupVolumes(c *check.C) {
525 525
 	someplace := ":/someplace"
526 526
 	if testEnv.OSType == "windows" {
527 527
 		// Windows requires that the source directory exists before calling HCS
528
-		testRequires(c, SameHostDaemon)
528
+		testRequires(c, testEnv.IsLocalDaemon)
529 529
 		someplace = `:c:\someplace`
530 530
 		if err := os.MkdirAll(path1, 0755); err != nil {
531 531
 			c.Fatalf("Failed to create %s: %q", path1, err)
... ...
@@ -1198,7 +1198,7 @@ func (s *DockerSuite) TestRunAddingOptionalDevicesInvalidMode(c *check.C) {
1198 1198
 
1199 1199
 func (s *DockerSuite) TestRunModeHostname(c *check.C) {
1200 1200
 	// Not applicable on Windows as Windows does not support -h
1201
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
1201
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
1202 1202
 
1203 1203
 	out, _ := dockerCmd(c, "run", "-h=testhostname", "busybox", "cat", "/etc/hostname")
1204 1204
 
... ...
@@ -1253,7 +1253,7 @@ func (s *DockerSuite) TestRunDisallowBindMountingRootToRoot(c *check.C) {
1253 1253
 // Verify that a container gets default DNS when only localhost resolvers exist
1254 1254
 func (s *DockerSuite) TestRunDNSDefaultOptions(c *check.C) {
1255 1255
 	// Not applicable on Windows as this is testing Unix specific functionality
1256
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
1256
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
1257 1257
 
1258 1258
 	// preserve original resolv.conf for restoring after test
1259 1259
 	origResolvConf, err := ioutil.ReadFile("/etc/resolv.conf")
... ...
@@ -1321,7 +1321,7 @@ func (s *DockerSuite) TestRunDNSRepeatOptions(c *check.C) {
1321 1321
 
1322 1322
 func (s *DockerSuite) TestRunDNSOptionsBasedOnHostResolvConf(c *check.C) {
1323 1323
 	// Not applicable on Windows as testing Unix specific functionality
1324
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
1324
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
1325 1325
 
1326 1326
 	origResolvConf, err := ioutil.ReadFile("/etc/resolv.conf")
1327 1327
 	if os.IsNotExist(err) {
... ...
@@ -1403,7 +1403,7 @@ func (s *DockerSuite) TestRunDNSOptionsBasedOnHostResolvConf(c *check.C) {
1403 1403
 // check if the container resolv.conf file has at least 0644 perm.
1404 1404
 func (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) {
1405 1405
 	// Not applicable on Windows as Windows does not support --user
1406
-	testRequires(c, SameHostDaemon, Network, DaemonIsLinux, NotArm)
1406
+	testRequires(c, testEnv.IsLocalDaemon, Network, DaemonIsLinux, NotArm)
1407 1407
 
1408 1408
 	dockerCmd(c, "run", "--name=testperm", "--user=nobody", "busybox", "nslookup", "apt.dockerproject.org")
1409 1409
 
... ...
@@ -1425,7 +1425,7 @@ func (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) {
1425 1425
 // uses the host's /etc/resolv.conf and does not have any dns options provided.
1426 1426
 func (s *DockerSuite) TestRunResolvconfUpdate(c *check.C) {
1427 1427
 	// Not applicable on Windows as testing unix specific functionality
1428
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
1428
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
1429 1429
 	c.Skip("Unstable test, to be re-activated once #19937 is resolved")
1430 1430
 
1431 1431
 	tmpResolvConf := []byte("search pommesfrites.fr\nnameserver 12.34.56.78\n")
... ...
@@ -1880,7 +1880,7 @@ func (s *DockerSuite) TestRunEntrypoint(c *check.C) {
1880 1880
 }
1881 1881
 
1882 1882
 func (s *DockerSuite) TestRunBindMounts(c *check.C) {
1883
-	testRequires(c, SameHostDaemon)
1883
+	testRequires(c, testEnv.IsLocalDaemon)
1884 1884
 	if testEnv.OSType == "linux" {
1885 1885
 		testRequires(c, DaemonIsLinux, NotUserNamespace)
1886 1886
 	}
... ...
@@ -2025,7 +2025,7 @@ func (s *DockerSuite) TestRunWithInvalidMacAddress(c *check.C) {
2025 2025
 
2026 2026
 func (s *DockerSuite) TestRunDeallocatePortOnMissingIptablesRule(c *check.C) {
2027 2027
 	// TODO Windows. Network settings are not propagated back to inspect.
2028
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2028
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2029 2029
 
2030 2030
 	out := cli.DockerCmd(c, "run", "-d", "-p", "23:23", "busybox", "top").Combined()
2031 2031
 
... ...
@@ -2043,7 +2043,7 @@ func (s *DockerSuite) TestRunPortInUse(c *check.C) {
2043 2043
 	// TODO Windows. The duplicate NAT message returned by Windows will be
2044 2044
 	// changing as is currently completely undecipherable. Does need modifying
2045 2045
 	// to run sh rather than top though as top isn't in Windows busybox.
2046
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2046
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2047 2047
 
2048 2048
 	port := "1234"
2049 2049
 	dockerCmd(c, "run", "-d", "-p", port+":80", "busybox", "top")
... ...
@@ -2081,7 +2081,7 @@ func (s *DockerSuite) TestRunAllocatePortInReservedRange(c *check.C) {
2081 2081
 // Regression test for #7792
2082 2082
 func (s *DockerSuite) TestRunMountOrdering(c *check.C) {
2083 2083
 	// TODO Windows: Post RS1. Windows does not support nested mounts.
2084
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2084
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2085 2085
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
2086 2086
 
2087 2087
 	tmpDir, err := ioutil.TempDir("", "docker_nested_mount_test")
... ...
@@ -2126,7 +2126,7 @@ func (s *DockerSuite) TestRunMountOrdering(c *check.C) {
2126 2126
 // Regression test for https://github.com/docker/docker/issues/8259
2127 2127
 func (s *DockerSuite) TestRunReuseBindVolumeThatIsSymlink(c *check.C) {
2128 2128
 	// Not applicable on Windows as Windows does not support volumes
2129
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2129
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2130 2130
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
2131 2131
 
2132 2132
 	tmpDir, err := ioutil.TempDir(os.TempDir(), "testlink")
... ...
@@ -2205,7 +2205,7 @@ func (s *DockerSuite) TestRunNoOutputFromPullInStdout(c *check.C) {
2205 2205
 }
2206 2206
 
2207 2207
 func (s *DockerSuite) TestRunVolumesCleanPaths(c *check.C) {
2208
-	testRequires(c, SameHostDaemon)
2208
+	testRequires(c, testEnv.IsLocalDaemon)
2209 2209
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
2210 2210
 	buildImageSuccessfully(c, "run_volumes_clean_paths", build.WithDockerfile(`FROM busybox
2211 2211
 		VOLUME `+prefix+`/foo/`))
... ...
@@ -2294,7 +2294,7 @@ func (s *DockerSuite) TestRunExposePort(c *check.C) {
2294 2294
 
2295 2295
 func (s *DockerSuite) TestRunModeIpcHost(c *check.C) {
2296 2296
 	// Not applicable on Windows as uses Unix-specific capabilities
2297
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2297
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2298 2298
 
2299 2299
 	hostIpc, err := os.Readlink("/proc/1/ns/ipc")
2300 2300
 	if err != nil {
... ...
@@ -2325,7 +2325,7 @@ func (s *DockerSuite) TestRunModeIpcContainerNotExists(c *check.C) {
2325 2325
 
2326 2326
 func (s *DockerSuite) TestRunModeIpcContainerNotRunning(c *check.C) {
2327 2327
 	// Not applicable on Windows as uses Unix-specific capabilities
2328
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2328
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2329 2329
 
2330 2330
 	out, _ := dockerCmd(c, "create", "busybox")
2331 2331
 
... ...
@@ -2338,7 +2338,7 @@ func (s *DockerSuite) TestRunModeIpcContainerNotRunning(c *check.C) {
2338 2338
 
2339 2339
 func (s *DockerSuite) TestRunModePIDContainer(c *check.C) {
2340 2340
 	// Not applicable on Windows as uses Unix-specific capabilities
2341
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2341
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2342 2342
 
2343 2343
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "top")
2344 2344
 
... ...
@@ -2372,7 +2372,7 @@ func (s *DockerSuite) TestRunModePIDContainerNotExists(c *check.C) {
2372 2372
 
2373 2373
 func (s *DockerSuite) TestRunModePIDContainerNotRunning(c *check.C) {
2374 2374
 	// Not applicable on Windows as uses Unix-specific capabilities
2375
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2375
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2376 2376
 
2377 2377
 	out, _ := dockerCmd(c, "create", "busybox")
2378 2378
 
... ...
@@ -2385,7 +2385,7 @@ func (s *DockerSuite) TestRunModePIDContainerNotRunning(c *check.C) {
2385 2385
 
2386 2386
 func (s *DockerSuite) TestRunMountShmMqueueFromHost(c *check.C) {
2387 2387
 	// Not applicable on Windows as uses Unix-specific capabilities
2388
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2388
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2389 2389
 
2390 2390
 	dockerCmd(c, "run", "-d", "--name", "shmfromhost", "-v", "/dev/shm:/dev/shm", "-v", "/dev/mqueue:/dev/mqueue", "busybox", "sh", "-c", "echo -n test > /dev/shm/test && touch /dev/mqueue/toto && top")
2391 2391
 	defer os.Remove("/dev/mqueue/toto")
... ...
@@ -2409,7 +2409,7 @@ func (s *DockerSuite) TestRunMountShmMqueueFromHost(c *check.C) {
2409 2409
 
2410 2410
 func (s *DockerSuite) TestContainerNetworkMode(c *check.C) {
2411 2411
 	// Not applicable on Windows as uses Unix-specific capabilities
2412
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2412
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2413 2413
 
2414 2414
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
2415 2415
 	id := strings.TrimSpace(out)
... ...
@@ -2430,7 +2430,7 @@ func (s *DockerSuite) TestContainerNetworkMode(c *check.C) {
2430 2430
 
2431 2431
 func (s *DockerSuite) TestRunModePIDHost(c *check.C) {
2432 2432
 	// Not applicable on Windows as uses Unix-specific capabilities
2433
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2433
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2434 2434
 
2435 2435
 	hostPid, err := os.Readlink("/proc/1/ns/pid")
2436 2436
 	if err != nil {
... ...
@@ -2452,7 +2452,7 @@ func (s *DockerSuite) TestRunModePIDHost(c *check.C) {
2452 2452
 
2453 2453
 func (s *DockerSuite) TestRunModeUTSHost(c *check.C) {
2454 2454
 	// Not applicable on Windows as uses Unix-specific capabilities
2455
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
2455
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
2456 2456
 
2457 2457
 	hostUTS, err := os.Readlink("/proc/1/ns/uts")
2458 2458
 	if err != nil {
... ...
@@ -2477,7 +2477,7 @@ func (s *DockerSuite) TestRunModeUTSHost(c *check.C) {
2477 2477
 
2478 2478
 func (s *DockerSuite) TestRunTLSVerify(c *check.C) {
2479 2479
 	// Remote daemons use TLS and this test is not applicable when TLS is required.
2480
-	testRequires(c, SameHostDaemon)
2480
+	testRequires(c, testEnv.IsLocalDaemon)
2481 2481
 	if out, code, err := dockerCmdWithError("ps"); err != nil || code != 0 {
2482 2482
 		c.Fatalf("Should have worked: %v:\n%v", err, out)
2483 2483
 	}
... ...
@@ -2574,7 +2574,7 @@ func (s *DockerSuite) TestRunNonLocalMacAddress(c *check.C) {
2574 2574
 
2575 2575
 func (s *DockerSuite) TestRunNetHost(c *check.C) {
2576 2576
 	// Not applicable on Windows as uses Unix-specific capabilities
2577
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2577
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2578 2578
 
2579 2579
 	hostNet, err := os.Readlink("/proc/1/ns/net")
2580 2580
 	if err != nil {
... ...
@@ -2597,7 +2597,7 @@ func (s *DockerSuite) TestRunNetHost(c *check.C) {
2597 2597
 func (s *DockerSuite) TestRunNetHostTwiceSameName(c *check.C) {
2598 2598
 	// TODO Windows. As Windows networking evolves and converges towards
2599 2599
 	// CNM, this test may be possible to enable on Windows.
2600
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2600
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2601 2601
 
2602 2602
 	dockerCmd(c, "run", "--rm", "--name=thost", "--net=host", "busybox", "true")
2603 2603
 	dockerCmd(c, "run", "--rm", "--name=thost", "--net=host", "busybox", "true")
... ...
@@ -2605,7 +2605,7 @@ func (s *DockerSuite) TestRunNetHostTwiceSameName(c *check.C) {
2605 2605
 
2606 2606
 func (s *DockerSuite) TestRunNetContainerWhichHost(c *check.C) {
2607 2607
 	// Not applicable on Windows as uses Unix-specific capabilities
2608
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
2608
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
2609 2609
 
2610 2610
 	hostNet, err := os.Readlink("/proc/1/ns/net")
2611 2611
 	if err != nil {
... ...
@@ -3068,7 +3068,7 @@ func (s *DockerSuite) TestRunWriteFilteredProc(c *check.C) {
3068 3068
 
3069 3069
 func (s *DockerSuite) TestRunNetworkFilesBindMount(c *check.C) {
3070 3070
 	// Not applicable on Windows as uses Unix specific functionality
3071
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
3071
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
3072 3072
 
3073 3073
 	expected := "test123"
3074 3074
 
... ...
@@ -3092,7 +3092,7 @@ func (s *DockerSuite) TestRunNetworkFilesBindMount(c *check.C) {
3092 3092
 
3093 3093
 func (s *DockerSuite) TestRunNetworkFilesBindMountRO(c *check.C) {
3094 3094
 	// Not applicable on Windows as uses Unix specific functionality
3095
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
3095
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
3096 3096
 
3097 3097
 	filename := createTmpFile(c, "test123")
3098 3098
 	defer os.Remove(filename)
... ...
@@ -3114,7 +3114,7 @@ func (s *DockerSuite) TestRunNetworkFilesBindMountRO(c *check.C) {
3114 3114
 
3115 3115
 func (s *DockerSuite) TestRunNetworkFilesBindMountROFilesystem(c *check.C) {
3116 3116
 	// Not applicable on Windows as uses Unix specific functionality
3117
-	testRequires(c, SameHostDaemon, DaemonIsLinux, UserNamespaceROMount)
3117
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, UserNamespaceROMount)
3118 3118
 
3119 3119
 	filename := createTmpFile(c, "test123")
3120 3120
 	defer os.Remove(filename)
... ...
@@ -3143,7 +3143,7 @@ func (s *DockerSuite) TestRunNetworkFilesBindMountROFilesystem(c *check.C) {
3143 3143
 
3144 3144
 func (s *DockerSuite) TestPtraceContainerProcsFromHost(c *check.C) {
3145 3145
 	// Not applicable on Windows as uses Unix specific functionality
3146
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
3146
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
3147 3147
 
3148 3148
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
3149 3149
 	id := strings.TrimSpace(out)
... ...
@@ -3158,7 +3158,7 @@ func (s *DockerSuite) TestPtraceContainerProcsFromHost(c *check.C) {
3158 3158
 
3159 3159
 func (s *DockerSuite) TestAppArmorDeniesPtrace(c *check.C) {
3160 3160
 	// Not applicable on Windows as uses Unix specific functionality
3161
-	testRequires(c, SameHostDaemon, Apparmor, DaemonIsLinux)
3161
+	testRequires(c, testEnv.IsLocalDaemon, Apparmor, DaemonIsLinux)
3162 3162
 
3163 3163
 	// Run through 'sh' so we are NOT pid 1. Pid 1 may be able to trace
3164 3164
 	// itself, but pid>1 should not be able to trace pid1.
... ...
@@ -3170,7 +3170,7 @@ func (s *DockerSuite) TestAppArmorDeniesPtrace(c *check.C) {
3170 3170
 
3171 3171
 func (s *DockerSuite) TestAppArmorTraceSelf(c *check.C) {
3172 3172
 	// Not applicable on Windows as uses Unix specific functionality
3173
-	testRequires(c, DaemonIsLinux, SameHostDaemon, Apparmor)
3173
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, Apparmor)
3174 3174
 
3175 3175
 	_, exitCode, _ := dockerCmdWithError("run", "busybox", "readlink", "/proc/1/ns/net")
3176 3176
 	if exitCode != 0 {
... ...
@@ -3180,7 +3180,7 @@ func (s *DockerSuite) TestAppArmorTraceSelf(c *check.C) {
3180 3180
 
3181 3181
 func (s *DockerSuite) TestAppArmorDeniesChmodProc(c *check.C) {
3182 3182
 	// Not applicable on Windows as uses Unix specific functionality
3183
-	testRequires(c, SameHostDaemon, Apparmor, DaemonIsLinux, NotUserNamespace)
3183
+	testRequires(c, testEnv.IsLocalDaemon, Apparmor, DaemonIsLinux, NotUserNamespace)
3184 3184
 	_, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "744", "/proc/cpuinfo")
3185 3185
 	if exitCode == 0 {
3186 3186
 		// If our test failed, attempt to repair the host system...
... ...
@@ -3771,7 +3771,7 @@ func (s *DockerSuite) TestRunWithOomScoreAdjInvalidRange(c *check.C) {
3771 3771
 func (s *DockerSuite) TestRunVolumesMountedAsShared(c *check.C) {
3772 3772
 	// Volume propagation is linux only. Also it creates directories for
3773 3773
 	// bind mounting, so needs to be same host.
3774
-	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace)
3774
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace)
3775 3775
 
3776 3776
 	// Prepare a source directory to bind mount
3777 3777
 	tmpDir, err := ioutil.TempDir("", "volume-source")
... ...
@@ -3802,7 +3802,7 @@ func (s *DockerSuite) TestRunVolumesMountedAsShared(c *check.C) {
3802 3802
 func (s *DockerSuite) TestRunVolumesMountedAsSlave(c *check.C) {
3803 3803
 	// Volume propagation is linux only. Also it creates directories for
3804 3804
 	// bind mounting, so needs to be same host.
3805
-	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace)
3805
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace)
3806 3806
 
3807 3807
 	// Prepare a source directory to bind mount
3808 3808
 	tmpDir, err := ioutil.TempDir("", "volume-source")
... ...
@@ -4164,14 +4164,14 @@ func (s *DockerSuite) TestRunCredentialSpecFailures(c *check.C) {
4164 4164
 // Note it won't actually do anything in CI configuration with the spec, but
4165 4165
 // it should not fail to run a container.
4166 4166
 func (s *DockerSuite) TestRunCredentialSpecWellFormed(c *check.C) {
4167
-	testRequires(c, DaemonIsWindows, SameHostDaemon)
4167
+	testRequires(c, DaemonIsWindows, testEnv.IsLocalDaemon)
4168 4168
 	validCS := readFile(`fixtures\credentialspecs\valid.json`, c)
4169 4169
 	writeFile(filepath.Join(testEnv.DaemonInfo.DockerRootDir, `credentialspecs\valid.json`), validCS, c)
4170 4170
 	dockerCmd(c, "run", `--security-opt=credentialspec=file://valid.json`, "busybox", "true")
4171 4171
 }
4172 4172
 
4173 4173
 func (s *DockerSuite) TestRunDuplicateMount(c *check.C) {
4174
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
4174
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
4175 4175
 
4176 4176
 	tmpFile, err := ioutil.TempFile("", "touch-me")
4177 4177
 	c.Assert(err, checker.IsNil)
... ...
@@ -4307,7 +4307,7 @@ func (s *delayedReader) Read([]byte) (int, error) {
4307 4307
 
4308 4308
 // #28823 (originally #28639)
4309 4309
 func (s *DockerSuite) TestRunMountReadOnlyDevShm(c *check.C) {
4310
-	testRequires(c, SameHostDaemon, DaemonIsLinux, NotUserNamespace)
4310
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux, NotUserNamespace)
4311 4311
 	emptyDir, err := ioutil.TempDir("", "test-read-only-dev-shm")
4312 4312
 	c.Assert(err, check.IsNil)
4313 4313
 	defer os.RemoveAll(emptyDir)
... ...
@@ -4319,7 +4319,7 @@ func (s *DockerSuite) TestRunMountReadOnlyDevShm(c *check.C) {
4319 4319
 }
4320 4320
 
4321 4321
 func (s *DockerSuite) TestRunMount(c *check.C) {
4322
-	testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace)
4322
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace)
4323 4323
 
4324 4324
 	// mnt1, mnt2, and testCatFooBar are commonly used in multiple test cases
4325 4325
 	tmpDir, err := ioutil.TempDir("", "mount")
... ...
@@ -61,7 +61,7 @@ func (s *DockerSuite) TestRunRedirectStdout(c *check.C) {
61 61
 // Test recursive bind mount works by default
62 62
 func (s *DockerSuite) TestRunWithVolumesIsRecursive(c *check.C) {
63 63
 	// /tmp gets permission denied
64
-	testRequires(c, NotUserNamespace, SameHostDaemon)
64
+	testRequires(c, NotUserNamespace, testEnv.IsLocalDaemon)
65 65
 	tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
66 66
 	c.Assert(err, checker.IsNil)
67 67
 
... ...
@@ -680,7 +680,7 @@ func (s *DockerSuite) TestRunWithSwappinessInvalid(c *check.C) {
680 680
 }
681 681
 
682 682
 func (s *DockerSuite) TestRunWithMemoryReservation(c *check.C) {
683
-	testRequires(c, SameHostDaemon, memoryReservationSupport)
683
+	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
684 684
 
685 685
 	file := "/sys/fs/cgroup/memory/memory.soft_limit_in_bytes"
686 686
 	out, _ := dockerCmd(c, "run", "--memory-reservation", "200M", "--name", "test", "busybox", "cat", file)
... ...
@@ -692,7 +692,7 @@ func (s *DockerSuite) TestRunWithMemoryReservation(c *check.C) {
692 692
 
693 693
 func (s *DockerSuite) TestRunWithMemoryReservationInvalid(c *check.C) {
694 694
 	testRequires(c, memoryLimitSupport)
695
-	testRequires(c, SameHostDaemon, memoryReservationSupport)
695
+	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
696 696
 	out, _, err := dockerCmdWithError("run", "-m", "500M", "--memory-reservation", "800M", "busybox", "true")
697 697
 	c.Assert(err, check.NotNil)
698 698
 	expected := "Minimum memory limit can not be less than memory reservation limit"
... ...
@@ -727,7 +727,7 @@ func (s *DockerSuite) TestRunSwapLessThanMemoryLimit(c *check.C) {
727 727
 }
728 728
 
729 729
 func (s *DockerSuite) TestRunInvalidCpusetCpusFlagValue(c *check.C) {
730
-	testRequires(c, cgroupCpuset, SameHostDaemon)
730
+	testRequires(c, cgroupCpuset, testEnv.IsLocalDaemon)
731 731
 
732 732
 	sysInfo := sysinfo.New(true)
733 733
 	cpus, err := parsers.ParseUintList(sysInfo.Cpus)
... ...
@@ -921,7 +921,7 @@ func (s *DockerSuite) TestRunSysctls(c *check.C) {
921 921
 
922 922
 // TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:jessie unshare' exits with operation not permitted.
923 923
 func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *check.C) {
924
-	testRequires(c, SameHostDaemon, seccompEnabled, NotArm, Apparmor)
924
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
925 925
 	jsonData := `{
926 926
 	"defaultAction": "SCMP_ACT_ALLOW",
927 927
 	"syscalls": [
... ...
@@ -950,7 +950,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *check.C) {
950 950
 
951 951
 // TestRunSeccompProfileDenyChmod checks that 'docker run --security-opt seccomp=/tmp/profile.json busybox chmod 400 /etc/hostname' exits with operation not permitted.
952 952
 func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *check.C) {
953
-	testRequires(c, SameHostDaemon, seccompEnabled)
953
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
954 954
 	jsonData := `{
955 955
 	"defaultAction": "SCMP_ACT_ALLOW",
956 956
 	"syscalls": [
... ...
@@ -985,7 +985,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *check.C) {
985 985
 // TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:jessie unshare --map-root-user --user sh -c whoami' with a specific profile to
986 986
 // deny unshare of a userns exits with operation not permitted.
987 987
 func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *check.C) {
988
-	testRequires(c, SameHostDaemon, seccompEnabled, NotArm, Apparmor)
988
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
989 989
 	// from sched.h
990 990
 	jsonData := fmt.Sprintf(`{
991 991
 	"defaultAction": "SCMP_ACT_ALLOW",
... ...
@@ -1023,7 +1023,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *check.C) {
1023 1023
 // TestRunSeccompProfileDenyCloneUserns checks that 'docker run syscall-test'
1024 1024
 // with a the default seccomp profile exits with operation not permitted.
1025 1025
 func (s *DockerSuite) TestRunSeccompProfileDenyCloneUserns(c *check.C) {
1026
-	testRequires(c, SameHostDaemon, seccompEnabled)
1026
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1027 1027
 	ensureSyscallTest(c)
1028 1028
 
1029 1029
 	icmd.RunCommand(dockerBinary, "run", "syscall-test", "userns-test", "id").Assert(c, icmd.Expected{
... ...
@@ -1035,7 +1035,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyCloneUserns(c *check.C) {
1035 1035
 // TestRunSeccompUnconfinedCloneUserns checks that
1036 1036
 // 'docker run --security-opt seccomp=unconfined syscall-test' allows creating a userns.
1037 1037
 func (s *DockerSuite) TestRunSeccompUnconfinedCloneUserns(c *check.C) {
1038
-	testRequires(c, SameHostDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace, unprivilegedUsernsClone)
1038
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace, unprivilegedUsernsClone)
1039 1039
 	ensureSyscallTest(c)
1040 1040
 
1041 1041
 	// make sure running w privileged is ok
... ...
@@ -1048,7 +1048,7 @@ func (s *DockerSuite) TestRunSeccompUnconfinedCloneUserns(c *check.C) {
1048 1048
 // TestRunSeccompAllowPrivCloneUserns checks that 'docker run --privileged syscall-test'
1049 1049
 // allows creating a userns.
1050 1050
 func (s *DockerSuite) TestRunSeccompAllowPrivCloneUserns(c *check.C) {
1051
-	testRequires(c, SameHostDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace)
1051
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace)
1052 1052
 	ensureSyscallTest(c)
1053 1053
 
1054 1054
 	// make sure running w privileged is ok
... ...
@@ -1060,7 +1060,7 @@ func (s *DockerSuite) TestRunSeccompAllowPrivCloneUserns(c *check.C) {
1060 1060
 // TestRunSeccompProfileAllow32Bit checks that 32 bit code can run on x86_64
1061 1061
 // with the default seccomp profile.
1062 1062
 func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *check.C) {
1063
-	testRequires(c, SameHostDaemon, seccompEnabled, IsAmd64)
1063
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, IsAmd64)
1064 1064
 	ensureSyscallTest(c)
1065 1065
 
1066 1066
 	icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test").Assert(c, icmd.Success)
... ...
@@ -1068,14 +1068,14 @@ func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *check.C) {
1068 1068
 
1069 1069
 // TestRunSeccompAllowSetrlimit checks that 'docker run debian:jessie ulimit -v 1048510' succeeds.
1070 1070
 func (s *DockerSuite) TestRunSeccompAllowSetrlimit(c *check.C) {
1071
-	testRequires(c, SameHostDaemon, seccompEnabled)
1071
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1072 1072
 
1073 1073
 	// ulimit uses setrlimit, so we want to make sure we don't break it
1074 1074
 	icmd.RunCommand(dockerBinary, "run", "debian:jessie", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success)
1075 1075
 }
1076 1076
 
1077 1077
 func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1078
-	testRequires(c, SameHostDaemon, seccompEnabled, NotUserNamespace)
1078
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
1079 1079
 	ensureSyscallTest(c)
1080 1080
 
1081 1081
 	out, _, err := dockerCmdWithError("run", "syscall-test", "acct-test")
... ...
@@ -1105,7 +1105,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
1105 1105
 }
1106 1106
 
1107 1107
 func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1108
-	testRequires(c, SameHostDaemon, seccompEnabled, NotUserNamespace)
1108
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
1109 1109
 	ensureSyscallTest(c)
1110 1110
 
1111 1111
 	out, _, err := dockerCmdWithError("run", "syscall-test", "ns-test", "echo", "hello0")
... ...
@@ -1142,7 +1142,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
1142 1142
 // TestRunNoNewPrivSetuid checks that --security-opt='no-new-privileges=true' prevents
1143 1143
 // effective uid transitions on executing setuid binaries.
1144 1144
 func (s *DockerSuite) TestRunNoNewPrivSetuid(c *check.C) {
1145
-	testRequires(c, DaemonIsLinux, NotUserNamespace, SameHostDaemon)
1145
+	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
1146 1146
 	ensureNNPTest(c)
1147 1147
 
1148 1148
 	// test that running a setuid binary results in no effective uid transition
... ...
@@ -1155,7 +1155,7 @@ func (s *DockerSuite) TestRunNoNewPrivSetuid(c *check.C) {
1155 1155
 // TestLegacyRunNoNewPrivSetuid checks that --security-opt=no-new-privileges prevents
1156 1156
 // effective uid transitions on executing setuid binaries.
1157 1157
 func (s *DockerSuite) TestLegacyRunNoNewPrivSetuid(c *check.C) {
1158
-	testRequires(c, DaemonIsLinux, NotUserNamespace, SameHostDaemon)
1158
+	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
1159 1159
 	ensureNNPTest(c)
1160 1160
 
1161 1161
 	// test that running a setuid binary results in no effective uid transition
... ...
@@ -1166,7 +1166,7 @@ func (s *DockerSuite) TestLegacyRunNoNewPrivSetuid(c *check.C) {
1166 1166
 }
1167 1167
 
1168 1168
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChown(c *check.C) {
1169
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1169
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1170 1170
 	ensureSyscallTest(c)
1171 1171
 
1172 1172
 	// test that a root user has default capability CAP_CHOWN
... ...
@@ -1184,7 +1184,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChown(c *check.C) {
1184 1184
 }
1185 1185
 
1186 1186
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesDacOverride(c *check.C) {
1187
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1187
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1188 1188
 	ensureSyscallTest(c)
1189 1189
 
1190 1190
 	// test that a root user has default capability CAP_DAC_OVERRIDE
... ...
@@ -1197,7 +1197,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesDacOverride(c *check.C) {
1197 1197
 }
1198 1198
 
1199 1199
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesFowner(c *check.C) {
1200
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1200
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1201 1201
 	ensureSyscallTest(c)
1202 1202
 
1203 1203
 	// test that a root user has default capability CAP_FOWNER
... ...
@@ -1213,7 +1213,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesFowner(c *check.C) {
1213 1213
 // TODO CAP_KILL
1214 1214
 
1215 1215
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetuid(c *check.C) {
1216
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1216
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1217 1217
 	ensureSyscallTest(c)
1218 1218
 
1219 1219
 	// test that a root user has default capability CAP_SETUID
... ...
@@ -1231,7 +1231,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetuid(c *check.C) {
1231 1231
 }
1232 1232
 
1233 1233
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *check.C) {
1234
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1234
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1235 1235
 	ensureSyscallTest(c)
1236 1236
 
1237 1237
 	// test that a root user has default capability CAP_SETGID
... ...
@@ -1251,7 +1251,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *check.C) {
1251 1251
 // TODO CAP_SETPCAP
1252 1252
 
1253 1253
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetBindService(c *check.C) {
1254
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1254
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1255 1255
 	ensureSyscallTest(c)
1256 1256
 
1257 1257
 	// test that a root user has default capability CAP_NET_BIND_SERVICE
... ...
@@ -1269,7 +1269,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetBindService(c *check.C)
1269 1269
 }
1270 1270
 
1271 1271
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetRaw(c *check.C) {
1272
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1272
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1273 1273
 	ensureSyscallTest(c)
1274 1274
 
1275 1275
 	// test that a root user has default capability CAP_NET_RAW
... ...
@@ -1287,7 +1287,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetRaw(c *check.C) {
1287 1287
 }
1288 1288
 
1289 1289
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChroot(c *check.C) {
1290
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
1290
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
1291 1291
 	ensureSyscallTest(c)
1292 1292
 
1293 1293
 	// test that a root user has default capability CAP_SYS_CHROOT
... ...
@@ -1305,7 +1305,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChroot(c *check.C) {
1305 1305
 }
1306 1306
 
1307 1307
 func (s *DockerSuite) TestUserNoEffectiveCapabilitiesMknod(c *check.C) {
1308
-	testRequires(c, DaemonIsLinux, NotUserNamespace, SameHostDaemon)
1308
+	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
1309 1309
 	ensureSyscallTest(c)
1310 1310
 
1311 1311
 	// test that a root user has default capability CAP_MKNOD
... ...
@@ -1327,7 +1327,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesMknod(c *check.C) {
1327 1327
 // TODO CAP_SETFCAP
1328 1328
 
1329 1329
 func (s *DockerSuite) TestRunApparmorProcDirectory(c *check.C) {
1330
-	testRequires(c, SameHostDaemon, Apparmor)
1330
+	testRequires(c, testEnv.IsLocalDaemon, Apparmor)
1331 1331
 
1332 1332
 	// running w seccomp unconfined tests the apparmor profile
1333 1333
 	result := icmd.RunCommand(dockerBinary, "run", "--security-opt", "seccomp=unconfined", "busybox", "chmod", "777", "/proc/1/cgroup")
... ...
@@ -1346,7 +1346,7 @@ func (s *DockerSuite) TestRunApparmorProcDirectory(c *check.C) {
1346 1346
 // make sure the default profile can be successfully parsed (using unshare as it is
1347 1347
 // something which we know is blocked in the default profile)
1348 1348
 func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *check.C) {
1349
-	testRequires(c, SameHostDaemon, seccompEnabled)
1349
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1350 1350
 
1351 1351
 	out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:jessie", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
1352 1352
 	c.Assert(err, checker.NotNil, check.Commentf("%s", out))
... ...
@@ -1355,7 +1355,7 @@ func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *check.C) {
1355 1355
 
1356 1356
 // TestRunDeviceSymlink checks run with device that follows symlink (#13840 and #22271)
1357 1357
 func (s *DockerSuite) TestRunDeviceSymlink(c *check.C) {
1358
-	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm, SameHostDaemon)
1358
+	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm, testEnv.IsLocalDaemon)
1359 1359
 	if _, err := os.Stat("/dev/zero"); err != nil {
1360 1360
 		c.Skip("Host does not have /dev/zero")
1361 1361
 	}
... ...
@@ -1404,7 +1404,7 @@ func (s *DockerSuite) TestRunDeviceSymlink(c *check.C) {
1404 1404
 
1405 1405
 // TestRunPIDsLimit makes sure the pids cgroup is set with --pids-limit
1406 1406
 func (s *DockerSuite) TestRunPIDsLimit(c *check.C) {
1407
-	testRequires(c, SameHostDaemon, pidsLimit)
1407
+	testRequires(c, testEnv.IsLocalDaemon, pidsLimit)
1408 1408
 
1409 1409
 	file := "/sys/fs/cgroup/pids/pids.max"
1410 1410
 	out, _ := dockerCmd(c, "run", "--name", "skittles", "--pids-limit", "4", "busybox", "cat", file)
... ...
@@ -1441,7 +1441,7 @@ func (s *DockerSuite) TestRunUserDeviceAllowed(c *check.C) {
1441 1441
 }
1442 1442
 
1443 1443
 func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
1444
-	testRequires(c, SameHostDaemon, seccompEnabled)
1444
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1445 1445
 
1446 1446
 	s.d.StartWithBusybox(c)
1447 1447
 
... ...
@@ -1466,7 +1466,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
1466 1466
 }
1467 1467
 
1468 1468
 func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
1469
-	testRequires(c, SameHostDaemon, seccompEnabled)
1469
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1470 1470
 
1471 1471
 	s.d.StartWithBusybox(c)
1472 1472
 
... ...
@@ -1492,7 +1492,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
1492 1492
 }
1493 1493
 
1494 1494
 func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
1495
-	testRequires(c, SameHostDaemon, seccompEnabled)
1495
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1496 1496
 
1497 1497
 	s.d.StartWithBusybox(c)
1498 1498
 
... ...
@@ -1529,7 +1529,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
1529 1529
 }
1530 1530
 
1531 1531
 func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *check.C) {
1532
-	testRequires(c, SameHostDaemon, seccompEnabled)
1532
+	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1533 1533
 
1534 1534
 	s.d.StartWithBusybox(c)
1535 1535
 
... ...
@@ -332,7 +332,7 @@ func listTar(f io.Reader) ([]string, error) {
332 332
 func (s *DockerSuite) TestLoadZeroSizeLayer(c *check.C) {
333 333
 	// this will definitely not work if using remote daemon
334 334
 	// very weird test
335
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
335
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
336 336
 
337 337
 	dockerCmd(c, "load", "-i", "testdata/emptyLayer.tar")
338 338
 }
... ...
@@ -22,7 +22,7 @@ import (
22 22
 // 1. validate uid/gid maps are set properly
23 23
 // 2. verify that files created are owned by remapped root
24 24
 func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
25
-	testRequires(c, DaemonIsLinux, SameHostDaemon, UserNamespaceInKernel)
25
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, UserNamespaceInKernel)
26 26
 
27 27
 	s.d.StartWithBusybox(c, "--userns-remap", "default")
28 28
 
... ...
@@ -404,7 +404,7 @@ func (s *DockerSuite) TestVolumeCLIRmForceUsage(c *check.C) {
404 404
 }
405 405
 
406 406
 func (s *DockerSuite) TestVolumeCLIRmForce(c *check.C) {
407
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
407
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
408 408
 
409 409
 	name := "test"
410 410
 	out, _ := dockerCmd(c, "volume", "create", name)
... ...
@@ -574,7 +574,7 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
574 574
 
575 575
 // Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
576 576
 func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C) {
577
-	testRequires(c, SameHostDaemon, DaemonIsLinux)
577
+	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
578 578
 
579 579
 	image := "vimage"
580 580
 	buildImageSuccessfully(c, image, build.WithDockerfile(`
... ...
@@ -40,7 +40,7 @@ func newDockerHubPullSuite() *DockerHubPullSuite {
40 40
 
41 41
 // SetUpSuite starts the suite daemon.
42 42
 func (s *DockerHubPullSuite) SetUpSuite(c *check.C) {
43
-	testRequires(c, DaemonIsLinux, SameHostDaemon)
43
+	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
44 44
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
45 45
 	s.d.Start(c)
46 46
 }
... ...
@@ -76,10 +76,6 @@ func NotPpc64le() bool {
76 76
 	return ArchitectureIsNot("ppc64le")
77 77
 }
78 78
 
79
-func SameHostDaemon() bool {
80
-	return testEnv.IsLocalDaemon()
81
-}
82
-
83 79
 func UnixCli() bool {
84 80
 	return isUnixCli
85 81
 }
... ...
@@ -54,11 +54,11 @@ func swapMemorySupport() bool {
54 54
 }
55 55
 
56 56
 func memorySwappinessSupport() bool {
57
-	return SameHostDaemon() && SysInfo.MemorySwappiness
57
+	return testEnv.IsLocalDaemon() && SysInfo.MemorySwappiness
58 58
 }
59 59
 
60 60
 func blkioWeight() bool {
61
-	return SameHostDaemon() && SysInfo.BlkioWeight
61
+	return testEnv.IsLocalDaemon() && SysInfo.BlkioWeight
62 62
 }
63 63
 
64 64
 func cgroupCpuset() bool {
... ...
@@ -111,7 +111,7 @@ func overlay2Supported() bool {
111 111
 }
112 112
 
113 113
 func init() {
114
-	if SameHostDaemon() {
114
+	if testEnv.IsLocalDaemon() {
115 115
 		SysInfo = sysinfo.New(true)
116 116
 	}
117 117
 }