aboutsummaryrefslogtreecommitdiff
path: root/tests/run-task/test_run_task.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: collapse describe-run-warn idiom into run_task helperCraig Jennings27 hours1-0/+172
The installer announced, ran, and warned on each operation with a hand-written two-line pair, repeated ~35 times: action="enabling rngd service" && display "task" "$action" systemctl enable rngd >> "$logfile" 2>&1 || error_warn "$action" "$?" I added a run_task "desc" cmd... helper that does this in one line, plus an enable_service wrapper for the canonical "enabling <unit> service" case. The 35 single-command sites now call run_task. The three exact-wording service enables (rngd, upower, fail2ban) use enable_service. Multi-line sites (heredocs, subshells, intervening logic) keep the explicit form. Behavior is unchanged: same descriptions, same commands, same logfile redirection, same non-fatal warning on the real exit code. tests/run-task covers the helper across Normal/Boundary/Error including exit-code propagation, and the full unit suite stays green.