From 7f37d99ef50b4046284ecb3c3b290319acf11405 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 19 Jul 2019 10:53:42 +0200 Subject: [PATCH] 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 --- integration-cli/docker_cli_daemon_plugins_test.go | 6 +++--- integration-cli/docker_cli_daemon_test.go | 2 -- integration-cli/docker_cli_events_unix_test.go | 2 -- integration-cli/docker_cli_exec_test.go | 3 +-- integration-cli/docker_cli_info_test.go | 1 - integration-cli/docker_cli_network_unix_test.go | 1 - integration-cli/docker_cli_proxy_test.go | 1 - integration-cli/docker_cli_run_unix_test.go | 8 ++++---- integration-cli/docker_cli_userns_test.go | 2 +- 9 files changed, 9 insertions(+), 17 deletions(-) diff --git a/integration-cli/docker_cli_daemon_plugins_test.go b/integration-cli/docker_cli_daemon_plugins_test.go index 355313f013..033db85d70 100644 --- a/integration-cli/docker_cli_daemon_plugins_test.go +++ b/integration-cli/docker_cli_daemon_plugins_test.go @@ -121,7 +121,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C) // TestDaemonShutdownWithPlugins shuts down running plugins. func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) { - testRequires(c, IsAmd64, Network, testEnv.IsLocalDaemon) + testRequires(c, IsAmd64, Network) s.d.Start(c) 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) { // TestDaemonKillWithPlugins leaves plugins running. func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) { - testRequires(c, IsAmd64, Network, testEnv.IsLocalDaemon) + testRequires(c, IsAmd64, Network) s.d.Start(c) 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) { } func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *check.C) { - testRequires(c, DaemonIsLinux, Network, IsAmd64) + testRequires(c, IsAmd64, Network) s.d.Start(c, "--live-restore=true") diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index ab26c2e77b..1b9ad8fe3c 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -825,7 +825,6 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4ExplicitOutsideContainer } func (s *DockerDaemonSuite) TestDaemonDefaultNetworkInvalidClusterConfig(c *check.C) { - testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon) // Start daemon without docker0 bridge defaultNetworkBridge := "docker0" @@ -966,7 +965,6 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *che } func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *check.C) { - testRequires(c, DaemonIsLinux) s.d.StartWithBusybox(c, "--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024") diff --git a/integration-cli/docker_cli_events_unix_test.go b/integration-cli/docker_cli_events_unix_test.go index 05cd54fd4a..060142f527 100644 --- a/integration-cli/docker_cli_events_unix_test.go +++ b/integration-cli/docker_cli_events_unix_test.go @@ -388,7 +388,6 @@ func (s *DockerSuite) TestEventsFilterNetworkID(c *check.C) { } func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux) // daemon config file configFilePath := "test.json" @@ -457,7 +456,6 @@ func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) { } func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux) // daemon config file configFilePath := "test.json" diff --git a/integration-cli/docker_cli_exec_test.go b/integration-cli/docker_cli_exec_test.go index fcffeefe38..72fa092824 100644 --- a/integration-cli/docker_cli_exec_test.go +++ b/integration-cli/docker_cli_exec_test.go @@ -79,8 +79,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) { } func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) { - // TODO Windows CI: Requires a little work to get this ported. - testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon) + // TODO Windows CI: DockerDaemonSuite doesn't run on Windows, and requires a little work to get this ported. s.d.StartWithBusybox(c) out, err := s.d.Cmd("run", "-d", "--name", "top", "-p", "80", "busybox:latest", "top") diff --git a/integration-cli/docker_cli_info_test.go b/integration-cli/docker_cli_info_test.go index 24d9c61a3c..c569a0d1df 100644 --- a/integration-cli/docker_cli_info_test.go +++ b/integration-cli/docker_cli_info_test.go @@ -211,7 +211,6 @@ func (s *DockerSuite) TestInsecureRegistries(c *check.C) { } func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux) registryMirror1 := "https://192.168.1.2" registryMirror2 := "http://registry.mirror.com:5000" diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index a071edd3f6..cbc953e581 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -1664,7 +1664,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkCreateDeleteSpecialCharacters(c *c } func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *check.C) { - testRequires(t, DaemonIsLinux) s.d.StartWithBusybox(t, "--live-restore") defer s.d.Stop(t) oldCon := "old" diff --git a/integration-cli/docker_cli_proxy_test.go b/integration-cli/docker_cli_proxy_test.go index d7bb1c8fbe..c444b611b5 100644 --- a/integration-cli/docker_cli_proxy_test.go +++ b/integration-cli/docker_cli_proxy_test.go @@ -21,7 +21,6 @@ func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) { // Can't use localhost here since go has a special case to not use proxy if connecting to localhost // See https://golang.org/pkg/net/http/#ProxyFromEnvironment func (s *DockerDaemonSuite) TestCLIProxyProxyTCPSock(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon) // get the IP to use to connect since we can't use localhost addrs, err := net.InterfaceAddrs() assert.NilError(c, err) diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 67d6a9a992..68cc666177 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -1442,7 +1442,7 @@ func (s *DockerSuite) TestRunUserDeviceAllowed(c *check.C) { } func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) + testRequires(c, seccompEnabled) s.d.StartWithBusybox(c) @@ -1467,7 +1467,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) { } func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) + testRequires(c, seccompEnabled) s.d.StartWithBusybox(c) @@ -1493,7 +1493,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) { } func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) + testRequires(c, seccompEnabled) s.d.StartWithBusybox(c) @@ -1530,7 +1530,7 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) { } func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *check.C) { - testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) + testRequires(c, seccompEnabled) s.d.StartWithBusybox(c) diff --git a/integration-cli/docker_cli_userns_test.go b/integration-cli/docker_cli_userns_test.go index 1cbf367fe4..c423f5cd43 100644 --- a/integration-cli/docker_cli_userns_test.go +++ b/integration-cli/docker_cli_userns_test.go @@ -23,7 +23,7 @@ import ( // 1. validate uid/gid maps are set properly // 2. verify that files created are owned by remapped root func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) { - testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, UserNamespaceInKernel) + testRequires(c, UserNamespaceInKernel) s.d.StartWithBusybox(c, "--userns-remap", "default")