Remove/replace integration-cli tests that use iptables directly

In preparation for testing with an nftables backend.

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray
2025-04-09 19:18:18 +01:00
parent cb38cc0fdd
commit 37259540e9
4 changed files with 57 additions and 449 deletions

View File

@@ -2018,22 +2018,6 @@ func (s *DockerCLIRunSuite) TestRunWithInvalidMacAddress(c *testing.T) {
}
}
func (s *DockerCLIRunSuite) TestRunDeallocatePortOnMissingIptablesRule(c *testing.T) {
// TODO Windows. Network settings are not propagated back to inspect.
testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
out := cli.DockerCmd(c, "run", "-d", "-p", "23:23", "busybox", "top").Combined()
id := strings.TrimSpace(out)
ip := inspectField(c, id, "NetworkSettings.Networks.bridge.IPAddress")
icmd.RunCommand("iptables", "-D", "DOCKER", "-d", fmt.Sprintf("%s/32", ip),
"!", "-i", "docker0", "-o", "docker0", "-p", "tcp", "-m", "tcp", "--dport", "23", "-j", "ACCEPT").Assert(c, icmd.Success)
cli.DockerCmd(c, "rm", "-fv", id)
cli.DockerCmd(c, "run", "-d", "-p", "23:23", "busybox", "top")
}
func (s *DockerCLIRunSuite) TestRunPortInUse(c *testing.T) {
// TODO Windows. The duplicate NAT message returned by Windows will be
// changing as is currently completely undecipherable. Does need modifying