Skip to content

tmt: archive audit and journal logs after test execution#6850

Merged
nalind merged 1 commit into
containers:mainfrom
lsm5:tmt-audit-log
May 13, 2026
Merged

tmt: archive audit and journal logs after test execution#6850
nalind merged 1 commit into
containers:mainfrom
lsm5:tmt-audit-log

Conversation

@lsm5
Copy link
Copy Markdown
Member

@lsm5 lsm5 commented May 13, 2026

What type of PR is this?

/kind other

What this PR does / why we need it:

captures audit logs

How to verify it

audit logs visible somewhere in testing-farm job run.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

@lsm5 lsm5 added the No New Tests Allow PR to proceed without adding regression tests label May 13, 2026
@lsm5 lsm5 marked this pull request as ready for review May 13, 2026 17:39
@lsm5
Copy link
Copy Markdown
Member Author

lsm5 commented May 13, 2026

@nalind PTAL. In the failed testing-farm job, see data -> audit-logs -> audit.log . At least on my browser, it wants to download the log by default, which is annoying but at least it's there now.

cc @containers/buildah-maintainers

Related: #6800 (comment)

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 13, 2026
@Luap99
Copy link
Copy Markdown
Member

Luap99 commented May 13, 2026

audit logs are part of the journald output normally I think? On cirrus we just upload the full journal output because that may contain much more useful information there, not just audit.

@Luap99
Copy link
Copy Markdown
Member

Luap99 commented May 13, 2026

journal_script: '$GOSRC/$SCRIPT_BASE/logcollector.sh journal'

journal) showrun journalctl -b ;;

@lsm5
Copy link
Copy Markdown
Member Author

lsm5 commented May 13, 2026

audit logs are part of the journald output normally I think? On cirrus we just upload the full journal output because that may contain much more useful information there, not just audit.

sgtm, I can update PR to include that too.

@lsm5 lsm5 marked this pull request as draft May 13, 2026 17:48
@lsm5 lsm5 force-pushed the tmt-audit-log branch from 786ebd5 to d0f2dad Compare May 13, 2026 18:09
Comment thread plans/main.fmf Outdated
fi

# Capture full journal
journalctl --no-pager --all --output=short-precise > "$TMT_PLAN_DATA/logs/journal.log" 2>&1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you likely want the -b here so we only see the logs of the current boot, in case there are older journal files around already on the system, or does tmt reboot the VM before collecting the logs?

Also just use &> "$TMT_PLAN_DATA/logs/journal.log" to redirect both stdout/err which is simpler to use than defining to redirects after each other.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

you likely want the -b here so we only see the logs of the current boot, in case there are older journal files around already on the system, or does tmt reboot the VM before collecting the logs?

AFAIK, it doesn't reboot unless you issue a tmt-reboot, so we should be fine with -b.

Also just use &> "$TMT_PLAN_DATA/logs/journal.log" to redirect both stdout/err which is simpler to use than defining to redirects after each other.

Yes, thanks. Updating..

Archive both audit.log and full journal output to TMT_PLAN_DATA/logs/ for
post-test debugging and analysis.

Signed-off-by: Lokesh Mandvekar <lsm5@linux.com>
@lsm5 lsm5 force-pushed the tmt-audit-log branch from d0f2dad to 4614c0a Compare May 13, 2026 18:25
@lsm5 lsm5 marked this pull request as ready for review May 13, 2026 19:42
@lsm5 lsm5 changed the title tmt: archive audit logs after test execution tmt: archive audit and journal logs after test execution May 13, 2026
@lsm5
Copy link
Copy Markdown
Member Author

lsm5 commented May 13, 2026

@containers/buildah-maintainers good for another look. Both audit and journal logs captured in data -> logs.

Copy link
Copy Markdown
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

@nalind
Copy link
Copy Markdown
Member

nalind commented May 13, 2026

LGTM

@nalind nalind enabled auto-merge May 13, 2026 20:06
@nalind nalind merged commit 53e9348 into containers:main May 13, 2026
39 of 40 checks passed
@lsm5 lsm5 deleted the tmt-audit-log branch May 14, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No New Tests Allow PR to proceed without adding regression tests size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants