testsAndMisc/docs/superpowers/evidence/ubuntu-perf-more-coverage-2026-08-22.json
Krzysztof kuhy Rudnicki 99a9804d75 Test ubuntu_perf_more.sh to 100%: allowlist 93 -> 92
Seventh of the 16 untested fixes/lib libs and the first of the ubuntu-perf
pair, which gets its own harness here. 24 assertions; 32/32 = 100.00%
through run_all.sh on the first measurement, confirmed at --min 100 (exit 0),
then cleared with the real gate and no exemption.

Two absolute paths had to move behind env overrides, defaulting to the real
ones: fix_journal writes /etc/systemd/journald.conf.d/size-limit.conf and
run_undo globs /root for undo scripts. Binding those in the jail was rejected
for the same reason as bt_pairing.sh's udev rule -- run_all.sh runs UN-jailed
in ci_mirror.sh and in CI, so a bind mount protects the coverage run and
nothing else. JOURNALD_CONF_DIR and UNDO_DIR follow the UDEV_RULES_DIR
precedent.

Proof the suite is safe where it runs un-jailed: after a bare run_all.sh the
real /etc/systemd/journald.conf.d/size-limit.conf still carries its 2026-03-02
mtime, a genuine artifact of a past production run, and no
undo_ubuntu_performance_*.sh exists in /root.

Worth noting for the rest of the family: run_undo ends in `exit`, so its cases
run inside an explicit subshell. A command substitution already provides one,
so the exit ends only that subshell rather than the whole test file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 19:25:21 +02:00

52 lines
4.8 KiB
JSON

{
"intent": "Test linux_configuration/scripts/single_use/fixes/lib/ubuntu_perf_more.sh to 100% line coverage and take it off the shell-coverage allowlist, seventh of the 16 untested fixes/lib libs and the first of the ubuntu-performance pair.",
"scope": [
"linux_configuration/scripts/single_use/fixes/lib/ubuntu_perf_more.sh (two env overrides for its absolute write/read targets)",
"linux_configuration/scripts/single_use/fixes/lib/tests/ubuntu_perf_harness.sh (new family harness)",
"linux_configuration/scripts/single_use/fixes/lib/tests/test_ubuntu_perf_more.sh (new, 24 assertions)",
"meta/shell-coverage-allowlist.txt (one line removed)",
"Non-goal: ubuntu_perf_fixes.sh, the 215-line other half of this family"
],
"changes": [
"Added JOURNALD_CONF_DIR and UNDO_DIR overrides to ubuntu_perf_more.sh, defaulting to /etc/systemd/journald.conf.d and /root respectively. fix_journal writes a journald drop-in and run_undo globs /root for undo scripts; both are absolute, and lib/tests/run_all.sh runs UN-jailed in ci_mirror.sh and in CI, so a bind mount would have protected only the coverage run. Same env-override seam bt_pairing.sh uses for UDEV_RULES_DIR.",
"Added ubuntu_perf_harness.sh: sources lib_test_core.sh and the real scripts/lib/common.sh, points UNDO_SCRIPT at the tmpdir, and redefines add_undo verbatim from fix_ubuntu_performance.sh, which owns it rather than any lib.",
"Added test_ubuntu_perf_more.sh covering fix_journal (first run writing the cap, an already-configured drop-in that must be skipped, and a drop-in capping a DIFFERENT size that must be rewritten), fix_snap_startup (timer enabled and already disabled), and run_undo (no script present, a script that runs, and several scripts where the most recent must win).",
"run_undo ends in `exit`, so each of its cases runs inside an explicit subshell: a command substitution already provides one, so the exit ends only that subshell rather than the whole test file."
],
"verification": [
{
"command": "bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh",
"result": "pass",
"evidence": "ubuntu_perf_more: 24 passed, 0 failed. All fixes lib test files passed, so the six libs cleared so far and the eight pacman_hook_stall suites stay green."
},
{
"command": "bash meta/scripts/shell_coverage_jail.sh --subject linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh --measure ubuntu_perf_more.sh --min 1 --fail-on-case-error -- \"\"",
"result": "pass",
"evidence": "ubuntu_perf_more.sh: 32/32 lines = 100.00% on the first measurement. No 'outside kcov's line set' lines reported."
},
{
"command": "bash meta/scripts/shell_coverage_jail.sh --subject linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh --measure ubuntu_perf_more.sh --min 100 --fail-on-case-error -- \"\"",
"result": "pass",
"evidence": "ubuntu_perf_more.sh: 32/32 lines = 100.00%, exit code 0. Second matching run at the --min 100 bar."
},
{
"command": "bash meta/scripts/check_shell_coverage.sh linux_configuration/scripts/single_use/fixes/lib/ubuntu_perf_more.sh",
"result": "pass",
"evidence": "'check_shell_coverage.sh: every checked shell library meets the coverage bar', exit 0, with the allowlist line already removed so the lib had no exemption."
},
{
"command": "ls -la /etc/systemd/journald.conf.d/ after a bare (un-jailed) run of run_all.sh",
"result": "pass",
"evidence": "size-limit.conf still dated 2026-03-02, i.e. a genuine artifact of a past production run, untouched by the suite. No undo_ubuntu_performance_*.sh exists in /root. This is the check that proves the suite is safe where it actually runs un-jailed; the jail cannot give it."
}
],
"risks": [
"fix_journal restarts systemd-journald and run_undo executes an arbitrary shell script. Both are exercised only through stubs and a tmpdir: systemctl is stubbed by the harness, and the undo script the test runs is one the test wrote into UNDO_DIR. Nothing in this suite can restart a real service or run a real /root script.",
"The two new overrides mean a future caller could redirect a production journald drop-in by exporting JOURNALD_CONF_DIR. That matches the existing UDEV_RULES_DIR precedent in bt_pairing.sh, and the defaults are unchanged, so the entry script's behaviour is identical."
],
"rollback": [
"git revert the commit; that restores the ubuntu_perf_more.sh allowlist line, removes the two overrides and deletes the harness and test file together.",
"After rollback, run bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh and confirm the remaining suites pass, then bash meta/scripts/check_shell_coverage.sh to confirm the gate is green with ubuntu_perf_more.sh exempt again."
]
}