Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

ypu
Copy link
Contributor

@ypu ypu commented Aug 27, 2020

Add a test for testing different log driver in podman run

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"
Copy link
Member

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.

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"
Copy link
Member

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.


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"
Copy link
Member

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.

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2020
@@ -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
Copy link
Member

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]>
@ypu ypu force-pushed the log-driver-test branch from 911f81f to 93e9fb3 Compare August 27, 2020 15:15
@ypu
Copy link
Contributor Author

ypu commented Aug 27, 2020

Thanks @rhatdan for your comments. Update the code but found some bugs in current version. The test will failed:

  1. podman logs can not read from journald and w
  2. --log-drover json-file will not store the logs to a file

Report an issue #7476 for record the problems.

@rhatdan
Copy link
Member

rhatdan commented Aug 28, 2020

LGTM
@ypu Thanks for the test.

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@edsantiago
Copy link
Member

This is (mostly) resolved in #7758, although that one does not test --log-opt nor journald.

@rhatdan
Copy link
Member

rhatdan commented Sep 28, 2020

@ypu Still working on this PR?

@ypu
Copy link
Contributor Author

ypu commented Sep 29, 2020

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.

@ypu ypu closed this Sep 29, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants