-
Notifications
You must be signed in to change notification settings - Fork 18.9k
TestConntrackFlowsLeak: use busybox "nc" #43031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestConntrackFlowsLeak: use busybox "nc" #43031
Conversation
|
cpuguy83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely better than the previous image, however I'd be happier if we had a cached image for this.
|
alpine3.14 already contains, busybox's nc, wouldn't it do the trick? |
You mean, as a "frozen image", or pushing it somewhere to docker hub? Installing the package is also very fast; That said, we could run into outages of the alpine package repo (happens occasionally)
According to the PR that added it (discussion on that), that didn't work; #32505 (comment)
|
| }).Assert(c, icmd.Success) | ||
|
|
||
| // 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we switch to the (already in our "frozen images") busybox image, I've had success with the following returning data correctly:
| cmd := "while true; do echo hello | nc -w 1 -lu 8080; done" | |
| 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", imgName, "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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cmd = "echo world | nc -q 1 -u 192.168.10.1 8080" | |
| cmd = "echo world | nc -w 1 -u 192.168.10.1 8080" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I ran these exact commands in two containers and both worked "correctly" although the server container having a constant repeated 1 second timeout is kind of cute)
Edit: I guess worst case we add timeout 2 in front of this nc too? (if we see issues with it and need it to be killed more actively)
| // Replaces the image built from https://github.com/appropriate/docker-nc/tree/master/latest | ||
| imgName := "moby/nc" | ||
| icmd.RunCmd(icmd.Cmd{ | ||
| Command: []string{dockerBinary, "build", "-t", imgName, "-"}, | ||
| Stdin: strings.NewReader("FROM alpine:3.14\nRUN apk add --no-cache netcat-openbsd\n"), | ||
| }).Assert(c, icmd.Success) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Replaces the image built from https://github.com/appropriate/docker-nc/tree/master/latest | |
| imgName := "moby/nc" | |
| icmd.RunCmd(icmd.Cmd{ | |
| Command: []string{dockerBinary, "build", "-t", imgName, "-"}, | |
| Stdin: strings.NewReader("FROM alpine:3.14\nRUN apk add --no-cache netcat-openbsd\n"), | |
| }).Assert(c, icmd.Success) | |
| imgName := "busybox:latest" |
The appropriate/nc image was last built over 6 years ago, and uses the deprecated v2 schema 1 format. https://github.com/appropriate/docker-nc/tree/master/latest The image is just a plain "apk install" of netbsd-netcat, but was added in 1c4286b, because at the time the busybox nc had some bugs. These appear to be resolved, so we can use the busybox nc, from the frozen images. Signed-off-by: Sebastiaan van Stijn <[email protected]>
6cb1cf0 to
6d92d2c
Compare
|
Thanks @tianon ❤️. I applied your changes; let's see if it passes 🤞 |
|
|
|
And.. another flaky (already tracked in #39352) |
extracted from #42300
this is another attempt at #34832
replaces / closes #34832
to address:
The appropriate/nc image was last built over 6 years ago, and uses the deprecated v2 schema 1 format; https://github.com/appropriate/docker-nc/tree/master/latest
The image is just a plain "apk install" of netbsd-netcat, but was added in 1c4286b (#32505), because at the time the busybox nc had some bugs.
These appear to be resolved, so we can use the busybox nc, from the frozen images.