Skip to content

Commit

Permalink
integration-cli: remove redundant "testrequires"
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thaJeztah committed Jul 19, 2019
1 parent 88f6b5e commit 7f37d99
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 17 deletions.
6 changes: 3 additions & 3 deletions integration-cli/docker_cli_daemon_plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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")

Expand Down
2 changes: 0 additions & 2 deletions integration-cli/docker_cli_daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")

Expand Down
2 changes: 0 additions & 2 deletions integration-cli/docker_cli_events_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions integration-cli/docker_cli_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion integration-cli/docker_cli_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion integration-cli/docker_cli_network_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion integration-cli/docker_cli_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions integration-cli/docker_cli_run_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_userns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 7f37d99

Please sign in to comment.