Browse code

integration-cli: remove redundant "testrequires"

The `DockerDaemonSuite.SetUpTest` already checks for Linux and a local daemon;

```
func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
}
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7f37d99ef50b4046284ecb3c3b290319acf11405)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/07/19 17:53:42
Showing 9 changed files
... ...
@@ -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, testEnv.IsLocalDaemon)
124
+	testRequires(c, IsAmd64, Network)
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, testEnv.IsLocalDaemon)
162
+	testRequires(c, IsAmd64, Network)
163 163
 
164 164
 	s.d.Start(c)
165 165
 	if out, err := s.d.Cmd("plugin", "install", "--grant-all-permissions", pName); err != nil {
... ...
@@ -232,7 +232,7 @@ func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) {
232 232
 }
233 233
 
234 234
 func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *check.C) {
235
-	testRequires(c, DaemonIsLinux, Network, IsAmd64)
235
+	testRequires(c, IsAmd64, Network)
236 236
 
237 237
 	s.d.Start(c, "--live-restore=true")
238 238
 
... ...
@@ -825,7 +825,6 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4ExplicitOutsideContainer
825 825
 }
826 826
 
827 827
 func (s *DockerDaemonSuite) TestDaemonDefaultNetworkInvalidClusterConfig(c *check.C) {
828
-	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
829 828
 
830 829
 	// Start daemon without docker0 bridge
831 830
 	defaultNetworkBridge := "docker0"
... ...
@@ -966,7 +965,6 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *che
966 966
 }
967 967
 
968 968
 func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *check.C) {
969
-	testRequires(c, DaemonIsLinux)
970 969
 
971 970
 	s.d.StartWithBusybox(c, "--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024")
972 971
 
... ...
@@ -388,7 +388,6 @@ func (s *DockerSuite) TestEventsFilterNetworkID(c *check.C) {
388 388
 }
389 389
 
390 390
 func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
391
-	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
392 391
 
393 392
 	// daemon config file
394 393
 	configFilePath := "test.json"
... ...
@@ -457,7 +456,6 @@ func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
457 457
 }
458 458
 
459 459
 func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *check.C) {
460
-	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
461 460
 
462 461
 	// daemon config file
463 462
 	configFilePath := "test.json"
... ...
@@ -79,8 +79,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
79 79
 }
80 80
 
81 81
 func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
82
-	// TODO Windows CI: Requires a little work to get this ported.
83
-	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
82
+	// TODO Windows CI: DockerDaemonSuite doesn't run on Windows, and requires a little work to get this ported.
84 83
 	s.d.StartWithBusybox(c)
85 84
 
86 85
 	out, err := s.d.Cmd("run", "-d", "--name", "top", "-p", "80", "busybox:latest", "top")
... ...
@@ -211,7 +211,6 @@ func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
211 211
 }
212 212
 
213 213
 func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) {
214
-	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
215 214
 
216 215
 	registryMirror1 := "https://192.168.1.2"
217 216
 	registryMirror2 := "http://registry.mirror.com:5000"
... ...
@@ -1664,7 +1664,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkCreateDeleteSpecialCharacters(c *c
1664 1664
 }
1665 1665
 
1666 1666
 func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *check.C) {
1667
-	testRequires(t, DaemonIsLinux)
1668 1667
 	s.d.StartWithBusybox(t, "--live-restore")
1669 1668
 	defer s.d.Stop(t)
1670 1669
 	oldCon := "old"
... ...
@@ -21,7 +21,6 @@ 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, testEnv.IsLocalDaemon)
25 24
 	// get the IP to use to connect since we can't use localhost
26 25
 	addrs, err := net.InterfaceAddrs()
27 26
 	assert.NilError(c, err)
... ...
@@ -1442,7 +1442,7 @@ func (s *DockerSuite) TestRunUserDeviceAllowed(c *check.C) {
1442 1442
 }
1443 1443
 
1444 1444
 func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
1445
-	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1445
+	testRequires(c, seccompEnabled)
1446 1446
 
1447 1447
 	s.d.StartWithBusybox(c)
1448 1448
 
... ...
@@ -1467,7 +1467,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
1467 1467
 }
1468 1468
 
1469 1469
 func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
1470
-	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1470
+	testRequires(c, seccompEnabled)
1471 1471
 
1472 1472
 	s.d.StartWithBusybox(c)
1473 1473
 
... ...
@@ -1493,7 +1493,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
1493 1493
 }
1494 1494
 
1495 1495
 func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
1496
-	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1496
+	testRequires(c, seccompEnabled)
1497 1497
 
1498 1498
 	s.d.StartWithBusybox(c)
1499 1499
 
... ...
@@ -1530,7 +1530,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
1530 1530
 }
1531 1531
 
1532 1532
 func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *check.C) {
1533
-	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
1533
+	testRequires(c, seccompEnabled)
1534 1534
 
1535 1535
 	s.d.StartWithBusybox(c)
1536 1536
 
... ...
@@ -23,7 +23,7 @@ import (
23 23
 // 1. validate uid/gid maps are set properly
24 24
 // 2. verify that files created are owned by remapped root
25 25
 func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
26
-	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, UserNamespaceInKernel)
26
+	testRequires(c, UserNamespaceInKernel)
27 27
 
28 28
 	s.d.StartWithBusybox(c, "--userns-remap", "default")
29 29