Merge pull request #43031 from thaJeztah/fix_TestConntrackFlowsLeak_v1

TestConntrackFlowsLeak: use busybox "nc"
This commit is contained in:
Sebastiaan van Stijn 2021-11-19 13:39:01 +01:00 committed by GitHub
commit ea0f3dc8f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1747,12 +1747,12 @@ func (s *DockerNetworkSuite) TestConntrackFlowsLeak(c *testing.T) {
assertNwIsAvailable(c, "testbind")
// Launch the server, this will remain listening on an exposed port and reply to any request in a ping/pong fashion
cmd := "while true; do echo hello | nc -w 1 -lu 8080; done"
cli.DockerCmd(c, "run", "-d", "--name", "server", "--net", "testbind", "-p", "8080:8080/udp", "appropriate/nc", "sh", "-c", cmd)
cmd := "while true; do echo hello | nc -w 1 -l -u -p 8080; done"
cli.DockerCmd(c, "run", "-d", "--name", "server", "--net", "testbind", "-p", "8080:8080/udp", "busybox", "sh", "-c", cmd)
// Launch a container client, here the objective is to create a flow that is natted in order to expose the bug
cmd = "echo world | nc -q 1 -u 192.168.10.1 8080"
cli.DockerCmd(c, "run", "-d", "--name", "client", "--net=host", "appropriate/nc", "sh", "-c", cmd)
cmd = "echo world | nc -w 1 -u 192.168.10.1 8080"
cli.DockerCmd(c, "run", "-d", "--name", "client", "--net=host", "busybox", "sh", "-c", cmd)
// Get all the flows using netlink
flows, err := netlink.ConntrackTableList(netlink.ConntrackTable, unix.AF_INET)