-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
BATS: add ping test, ps filters, multi-option #8535
Conversation
- run test : tweaks to recently-added network-conflict test: * remove "-d" in run * confirm exact warning text, and also that container runs successfully * test multiple --net options (regression containers#8057) - images, run, build, exec tests: add multiple-flag testing for various flags, confirming as appropriate whether options are overridden or accumulated. - ps test : add --filter and --sort tests - pod test: run 'ping' inside container (confirms that container gets PING capability) Signed-off-by: Ed Santiago <[email protected]>
LGTM |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -533,8 +537,15 @@ json-file | f | |||
} | |||
|
|||
@test "podman run with --net=host and --port prints warning" { | |||
run_podman run -d --rm -p 8080 --net=host $IMAGE ls > /dev/null |
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.
Quick followup on this: it turns out, >/dev/null
is not a NOP, it's worse: it causes all output from run_podman
to vanish, which is anti-helpful when this test flakes, as it did twice in #8536!
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.
The intent is to remove all non-stderr output. We only want to capture the output of STDERR for this test. I believe you told me this was the best way to accomplish that?
Regarding the flake, I'll bet is the --rm
conflicting with the test's own cleanup logic.
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.
Oh, that makes sense (the rm conflict).
Re: BATS and stdout/stderr, unfortunately, there's no way to split them within a BATS run
context (including run_podman
). It's a BATS design tradeoff that works really well for the 95% case. The way I rewrote the test in this PR, I check for both the warning and some stdout; but do not (and cannot) check that the warning truly goes to stderr.
run test : tweaks to recently-added network-conflict test:
runs successfully
images, run, build, exec tests: add multiple-flag
testing for various flags, confirming as appropriate
whether options are overridden or accumulated.
ps test : add --filter and --sort tests
pod test: run 'ping' inside container (confirms that
container gets PING capability)
Signed-off-by: Ed Santiago [email protected]