mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
Update iptable.Exists API in integration-cli
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
This commit is contained in:
@ -945,12 +945,13 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *tes
|
|||||||
|
|
||||||
sourceRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", childIP, "--sport", "80", "-d", parentIP, "-j", "ACCEPT"}
|
sourceRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", childIP, "--sport", "80", "-d", parentIP, "-j", "ACCEPT"}
|
||||||
destinationRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", parentIP, "--dport", "80", "-d", childIP, "-j", "ACCEPT"}
|
destinationRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", parentIP, "--dport", "80", "-d", childIP, "-j", "ACCEPT"}
|
||||||
if !iptables.Exists("filter", "DOCKER", sourceRule...) || !iptables.Exists("filter", "DOCKER", destinationRule...) {
|
iptable := iptables.GetIptable(iptables.IPv4)
|
||||||
|
if !iptable.Exists("filter", "DOCKER", sourceRule...) || !iptable.Exists("filter", "DOCKER", destinationRule...) {
|
||||||
c.Fatal("Iptables rules not found")
|
c.Fatal("Iptables rules not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
s.d.Cmd("rm", "--link", "parent/http")
|
s.d.Cmd("rm", "--link", "parent/http")
|
||||||
if iptables.Exists("filter", "DOCKER", sourceRule...) || iptables.Exists("filter", "DOCKER", destinationRule...) {
|
if iptable.Exists("filter", "DOCKER", sourceRule...) || iptable.Exists("filter", "DOCKER", destinationRule...) {
|
||||||
c.Fatal("Iptables rules should be removed when unlink")
|
c.Fatal("Iptables rules should be removed when unlink")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user