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

Tools: journalctl added #54

Closed
wants to merge 1 commit into from
Closed

Conversation

patriki01
Copy link
Contributor

@patriki01 patriki01 commented Oct 23, 2023

I added command for journalctl. I included only what I thought are most commonly used parameters. Feel free to suggest change.

@danlavu
Copy link

danlavu commented Oct 25, 2023

It'd be nice to add a doc entry for this and provide the following examples,

  1. Typical usage, getting output from journalctl
  2. Assertion usage, how to use it and search for a string in the journal for a test case

assert client.utils.tools.journalctl(grep="search string").rc == 0
assert client.utils.tools.journal(grep="bad string").rc not 0

@patriki01
Copy link
Contributor Author

I added example usage as you proposed.

ikerexxe
ikerexxe previously approved these changes Oct 27, 2023
Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add the --system and --user options, I think I'm using them quite often.

However, this is only an optional improvement so I'm approving this PR.

@patriki01
Copy link
Contributor Author

I added those options @ikerexxe

Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ikerexxe
Copy link
Contributor

ikerexxe commented Nov 3, 2023

@danlavu, @pbrezina do you mind reviewing this PR?

@pbrezina
Copy link
Member

pbrezina commented Nov 6, 2023

Hi, @danlavu can you prepare a list for most common tasks that are used by QE? I'm thinking that it would be good to convert this to standalone class that would provide generic cli call but also methods to handle the most common tasks.

Also it should be possible to work only with messages generated by the test run (either by vacuuming journal during setup or by some other means) and dump journal into a file when a test is finished so we can download it as artifact.

It'll be also good to move this to pytest-mh, since it is not strictly related to sssd/idm.

@danlavu
Copy link

danlavu commented Nov 6, 2023

@pbrezina ack

@patriki01 I suppose we can take the comment about the assertions out then.

@patriki01
Copy link
Contributor Author

Okay, I move it there: next-actions/pytest-mh#23

@patriki01 patriki01 closed this Nov 9, 2023
@patriki01 patriki01 deleted the journalctl branch November 9, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants