blob: 06d6fa00664e0780f0d5dab2669ae4935dc2e68b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# shellcheck shell=bash disable=SC2034 # sourced by run-maint-scenarios.sh
# Scenario: coredump files beyond the forensic window are aged out.
#
# coredumpctl has no clean verb, so the remedy is a find -mtime +N -delete
# over /var/lib/systemd/coredump. Break plants one file older than the
# window and one fresh file; assert checks exactly the old one is gone.
SCENARIO_DESC="aged coredump files removed, fresh ones kept"
SCENARIO_GROUP="logs"
SCENARIO_PROFILES="any"
scenario_break() {
mexec "mkdir -p /var/lib/systemd/coredump && touch -d '30 days ago' '/var/lib/systemd/coredump/core.maintscenario-old.0.zst' && touch '/var/lib/systemd/coredump/core.maintscenario-new.0.zst'"
}
scenario_fix() {
mfix coredump_clean
}
scenario_assert() {
mexec "test ! -e '/var/lib/systemd/coredump/core.maintscenario-old.0.zst' && test -e '/var/lib/systemd/coredump/core.maintscenario-new.0.zst'"
}
|