1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Small cleanups on integration cli

- Join a few tests in one when it makes sense (reduce the number of
  container run and thus the overall time of the suites)
- Remove some duplication on several tests
- Remove some unused methods

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester
2017-01-02 23:42:45 +01:00
parent bf71db7a12
commit 9af5d7c340
10 changed files with 61 additions and 311 deletions

View File

@ -2347,35 +2347,17 @@ func (s *DockerDaemonSuite) TestBuildOnDisabledBridgeNetworkDaemon(c *check.C) {
}
// Test case for #21976
func (s *DockerDaemonSuite) TestDaemonDNSInHostMode(c *check.C) {
func (s *DockerDaemonSuite) TestDaemonDNSFlagsInHostMode(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
s.d.StartWithBusybox(c, "--dns", "1.2.3.4")
s.d.StartWithBusybox(c, "--dns", "1.2.3.4", "--dns-search", "example.com", "--dns-opt", "timeout:3")
expectedOutput := "nameserver 1.2.3.4"
out, _ := s.d.Cmd("run", "--net=host", "busybox", "cat", "/etc/resolv.conf")
c.Assert(out, checker.Contains, expectedOutput, check.Commentf("Expected '%s', but got %q", expectedOutput, out))
}
// Test case for #21976
func (s *DockerDaemonSuite) TestDaemonDNSSearchInHostMode(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
s.d.StartWithBusybox(c, "--dns-search", "example.com")
expectedOutput := "search example.com"
out, _ := s.d.Cmd("run", "--net=host", "busybox", "cat", "/etc/resolv.conf")
expectedOutput = "search example.com"
c.Assert(out, checker.Contains, expectedOutput, check.Commentf("Expected '%s', but got %q", expectedOutput, out))
}
// Test case for #21976
func (s *DockerDaemonSuite) TestDaemonDNSOptionsInHostMode(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
s.d.StartWithBusybox(c, "--dns-opt", "timeout:3")
expectedOutput := "options timeout:3"
out, _ := s.d.Cmd("run", "--net=host", "busybox", "cat", "/etc/resolv.conf")
expectedOutput = "options timeout:3"
c.Assert(out, checker.Contains, expectedOutput, check.Commentf("Expected '%s', but got %q", expectedOutput, out))
}