Browse code

Handle IPv6 enabling correctly in the tests

Signed-off-by: Santhosh Manohar <santhosh@docker.com>

Santhosh Manohar authored on 2017/01/10 04:40:27
Showing 2 changed files
... ...
@@ -381,8 +381,9 @@ func (s *DockerDaemonSuite) TestDaemonIPv6Enabled(c *check.C) {
381 381
 func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *check.C) {
382 382
 	// IPv6 setup is messing with local bridge address.
383 383
 	testRequires(c, SameHostDaemon)
384
-	setupV6(c)
385
-	defer teardownV6(c)
384
+	// Delete the docker0 bridge if its left around from previous daemon. It has to be recreated with
385
+	// ipv6 enabled
386
+	deleteInterface(c, "docker0")
386 387
 
387 388
 	s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:2::/64", "--default-gateway-v6=2001:db8:2::100")
388 389
 
... ...
@@ -408,8 +409,9 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *check.C) {
408 408
 func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *check.C) {
409 409
 	// IPv6 setup is messing with local bridge address.
410 410
 	testRequires(c, SameHostDaemon)
411
-	setupV6(c)
412
-	defer teardownV6(c)
411
+	// Delete the docker0 bridge if its left around from previous daemon. It has to be recreated with
412
+	// ipv6 enabled
413
+	deleteInterface(c, "docker0")
413 414
 
414 415
 	s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:1::/64")
415 416
 
... ...
@@ -1412,7 +1412,7 @@ func verifyIPAddresses(c *check.C, cName, nwname, ipv4, ipv6 string) {
1412 1412
 
1413 1413
 func (s *DockerNetworkSuite) TestDockerNetworkConnectLinkLocalIP(c *check.C) {
1414 1414
 	// create one test network
1415
-	dockerCmd(c, "network", "create", "n0")
1415
+	dockerCmd(c, "network", "create", "--ipv6", "--subnet=2001:db8:1234::/64", "n0")
1416 1416
 	assertNwIsAvailable(c, "n0")
1417 1417
 
1418 1418
 	// run a container with incorrect link-local address