-
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
system test: Add --log-driver test for podman run #7467
Conversation
test/system/030-run.bats
Outdated
is "$output" ".*this container is not logging output" "can not read log when set --log-driver to none" | ||
|
||
run_podman run --log-driver json-file --rm $IMAGE sleep 1 | ||
is "$output" "" "json-file should also work" |
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.
Could you report the first test to see that this actually works.
test/system/030-run.bats
Outdated
rm -f /var/log/podmantest.log | ||
is "$output" ".*stdout.*podman log-driver test" "log should exist in log file" | ||
|
||
run_podman run --log-driver journald --rm $IMAGE echo "podman log-driver test" |
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.
Should generate random content so we are sure the new data is in the journal.
test/system/030-run.bats
Outdated
|
||
run_podman run --log-driver journald --rm $IMAGE echo "podman log-driver test" | ||
run grep "podman log-driver test" <(journalctl) | ||
is "$output" ".*podman log-driver test" "log should exist in journalctl output" |
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.
Could you also add the podman logs test here, to make sure we can read the data back from the journal via the comand.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, ypu 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 |
test/system/030-run.bats
Outdated
@@ -305,4 +305,22 @@ echo $rand | 0 | $rand | |||
run_podman wait $cid | |||
} | |||
|
|||
@test "podman run --log-driver" { | |||
run_podman run --log-driver k8s-file --log-opt path=/var/log/podmantest.log --rm $IMAGE echo "podman log-driver test" | |||
run grep "podman log-driver test" /var/log/podmantest.log |
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.
Could you use $PODMAN_TMPDIR for this tests to make sure we don't effect the system, or cause problems with multiple tests running at the same time.
Add a test for testing options for podman run --log-driver. Signed-off-by: Yiqiao Pu <[email protected]>
LGTM |
A friendly reminder that this PR had no activity for 30 days. |
This is (mostly) resolved in #7758, although that one does not test |
@ypu Still working on this PR? |
Hi @rhatdan Looks like @edsantiago already write another test for cover the --log-driver and the issue I report still not fixed yet. I'd like close this one now. And will add some check steps based on Ed's test after the issue is fixed. Thanks @rhatdan and @edsantiago for all your review and comments. |
Add a test for testing different log driver in podman run