testsAndMisc/docs/superpowers/contracts/arch-sysctl-tests-2026-08-22.json
Krzysztof kuhy Rudnicki 7c14cfca61 Test arch_sysctl.sh and open the optimize_arch_desktop lib family
23 assertions over 8 cases covering both tweak_vm_sysctl and
tweak_network_sysctl: the skip path, the write-when-the-drop-in-is-
missing path that a naive "nothing to do" check gets wrong, the
value-differs path, an unreadable-sysctl path, and the tcp_bbr guard.

arch_desktop_harness.sh is the third family harness, supplying the
globals and apply_tweak that live in optimize_arch_desktop.sh rather
than in any lib. arch_cpu.sh and arch_hardware.sh will reuse it.

SYSCTL_DROPIN_DIR defaults to the real /etc/sysctl.d, matching the
seam ubuntu_perf_more.sh and arch_perf_fixes.sh already carry; the
suite runs un-jailed in ci_mirror.sh and CI, so a bind mount would
protect nothing. Both real drop-ins keep their Mar 2 mtimes.

_t_run lands in lib_test_core.sh because `out="$(func)"` forks a
subshell and kcov never registers a lib whose first execution happens
inside one -- measured as 0 lines via $( ) against 54 lines via a
direct call.

arch_sysctl.sh STAYS on the coverage allowlist: it still reports "kcov
instrumented no lines" through the jail, while ubuntu_perf_more.sh
measures 32/32 in the same worktree and the same invocation. The tests
are real and green; the coverage number is not yet obtainable, and the
exemption may only come off once it is.

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

20 lines
1.9 KiB
JSON

{
"title": "Test arch_sysctl.sh and open the optimize_arch_desktop lib family",
"objective": "Give arch_sysctl.sh a real test suite covering both of its sysctl-tuning functions, and add the third family harness so arch_cpu.sh and arch_hardware.sh can reuse it, as the first of the eight untested fixes/lib libraries.",
"acceptance_criteria": [
"test_arch_sysctl.sh exercises both tweak_vm_sysctl and tweak_network_sysctl across every branch: already-tuned-with-drop-in (skip), already-tuned-without-drop-in (write), value-differs (write and reload), sysctl-read-failure, and the tcp_bbr modprobe guard.",
"The whole suite stays green: run_all.sh reports every test file passing, including the 20 that predate this change.",
"shellcheck reports nothing on the new and modified files, with zero suppressions added anywhere.",
"No write reaches /etc: the two real sysctl drop-ins keep their pre-existing mtimes after the suite runs.",
"arch_sysctl.sh's production behaviour is unchanged -- SYSCTL_DROPIN_DIR defaults to the real /etc/sysctl.d.",
"arch_sysctl.sh stays on meta/shell-coverage-allowlist.txt, because it is not yet measurable through run_all.sh; the allowlist line may only be removed once the jail reports a real percentage."
],
"out_of_scope": [
"Removing arch_sysctl.sh from the coverage allowlist while its measurement still fails.",
"Changing the coverage instrument (meta/scripts/lib/shell_coverage_lines.py), which is scheduled after the eight libs.",
"Refactoring pacman_hook_stall_harness.sh onto lib_test_core.sh.",
"Touching arch_cpu.sh or arch_hardware.sh, which reuse this harness in later commits."
],
"verifier": "bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh (all test files pass, arch_sysctl reports 23 passed / 0 failed), plus shellcheck on the four touched shell files, plus stat on /etc/sysctl.d/9[01]-*.conf showing unchanged mtimes."
}