Files
podman/plans/system.fmf
Jan Rodák aa2e532f64 tmt: archive audit and journal logs after test execution
Archive both audit.log and full journal output to TMT_PLAN_DATA/logs/ for
post-test debugging and analysis.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-05-19 15:34:31 +02:00

75 lines
1.9 KiB
Plaintext

discover:
how: fmf
execute:
how: tmt
prepare:
- how: shell
script: modprobe null_blk nr_devices=1
order: 5
- when: distro == centos-stream or distro == rhel
how: shell
script: |
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm --eval '%{?rhel}').noarch.rpm
dnf -y config-manager --set-enabled epel
order: 10
- when: initiator == packit
how: shell
script: bash $TMT_TREE/contrib/packit-tmt/update-deps.sh
order: 20
adjust+:
- enabled: false
when: revdeps == yes
provision:
how: artemis
hardware:
memory: ">= 16 GB"
cpu:
cores: ">= 4"
threads: ">=8"
disk:
- size: ">= 512 GB"
finish:
how: shell
script: |
# Archive logs to TMT_PLAN_DATA for post-test analysis
mkdir -p "$TMT_PLAN_DATA/logs"
# Copy audit logs (SELinux denials, audit events)
if [ -f /var/log/audit/audit.log ]; then
cp /var/log/audit/audit.log "$TMT_PLAN_DATA/logs/"
echo "Audit logs copied to $TMT_PLAN_DATA/logs/audit.log"
else
echo "No audit log found at /var/log/audit/audit.log"
fi
# Capture full journal (current boot only)
journalctl -b --no-pager --all --output=short-precise &> "$TMT_PLAN_DATA/logs/journal.log"
echo "Journal output saved to $TMT_PLAN_DATA/logs/journal.log"
echo "All logs archived to $TMT_PLAN_DATA/logs/"
/local-root:
summary: Local rootful tests
discover+:
filter: 'tag:local & tag:root'
/local-rootless:
summary: Local rootless tests
discover+:
filter: 'tag:local & tag:rootless'
/remote-root:
summary: Remote rootful tests
discover+:
filter: 'tag:remote & tag:root'
/remote-rootless:
summary: Remote rootless tests
discover+:
filter: 'tag:remote & tag:rootless'