testsAndMisc/linux_configuration/scripts/single_use/features/lib
Krzysztof kuhy Rudnicki 0e843c2a5f Cover rpi_nc_install.sh and fix two latent bugs in the nc_php suite
rpi_nc_install.sh is one 200-line function that apt-installs 24
packages, seeds MariaDB, rm -rf's /var/www/nextcloud, rewrites Apache
and PHP config and installs a www-data crontab. 29 assertions, run for
real inside the jail. The destructive step is the point: a bug in
`rm -rf /var/www/nextcloud` is invisible to any check that does not
actually run it.

Two latent bugs in the ALREADY-COMMITTED nc_php suite, both found by
finally reading its assertion results instead of only its coverage
percentage. It was failing 2 of 29 in isolation:

- the cron entry arrives on crontab's STDIN, not in argv, so asserting
  on the call log could never have passed for the right reason. The
  stub now records stdin.
- configure_mariadb's stdout is eaten by `db_password=$(...)`, so the
  phase-order marker now goes to stderr and the capture reads both.

Suites now: 28 + 30 + 29 = 87 assertions, 0 failures.

KNOWN AND UNEXPLAINED: kcov mis-measures rpi_nc_install.sh at 10/88 =
11.36%, recording lines 13-54 and nothing after -- yet the code past
line 54 provably runs, since /root/.nextcloud_db_password and
/etc/apache2/sites-available/nextcloud.conf both exist afterwards. The
three obvious culprits were each tested against a minimal reproduction
and DISPROVEN: kcov traces fine past a heredoc, into a $( ) command
substitution, and past a heredoc-fed stub reading stdin via $(cat).
The file stays on the allowlist and the suite is kept for its
assertions, not its percentage. Do not 'fix' the number by weakening a
test.

dot_resolver_install.sh 39/39 = 100.00%; nc_php.sh 84/85 = 98.82%.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbD4nco3EgL1UFoZKmKsLE
2026-08-22 11:49:47 +02:00
..
tests Cover rpi_nc_install.sh and fix two latent bugs in the nc_php suite 2026-08-22 11:49:47 +02:00
aw_autostart.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00
aw_install.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00
aw_service.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00
dns_dhcp.sh Split setup_dns_blocker.sh, a live systemd unit target 2026-08-16 21:31:03 +02:00
dns_firewall.sh Split setup_dns_blocker.sh, a live systemd unit target 2026-08-16 21:31:03 +02:00
dns_units.sh Split setup_dns_blocker.sh, a live systemd unit target 2026-08-16 21:31:03 +02:00
dot_resolver_install.sh Split seven more linux_configuration scripts 2026-08-16 18:56:05 +02:00
dwm_config.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
gitea_network.sh Split three near-miss linux_configuration scripts 2026-08-16 18:38:43 +02:00
kcd2_autorebuild.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
kcd2_expose.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
kcd2_serve.sh Split three large linux_configuration scripts, defer a fourth 2026-08-16 19:06:16 +02:00
local_llm_model.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
mobile_service.sh Split two more linux_configuration scripts; revert a third 2026-08-16 18:44:18 +02:00
nc_discover.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_flash.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_image.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_packages.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_php.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_remote_flash.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_remote.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
nc_services.sh Split setup_nextcloud_raspberry.sh 1383 -> 231 2026-08-16 19:37:07 +02:00
pi_flash_exec.sh Split the Pi flasher and the boot-repair test harness 2026-08-16 20:21:44 +02:00
pi_flash_image.sh Split the Pi flasher and the boot-repair test harness 2026-08-16 20:21:44 +02:00
pi_flash_remote.sh Split the Pi flasher and the boot-repair test harness 2026-08-16 20:21:44 +02:00
rpi_nc_ca.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_deps.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_fixes.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_install.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_ssl_remote.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_ssl.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
rpi_nc_system.sh Split three more linux_configuration giants 2026-08-16 19:43:55 +02:00
searxng_expose.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
searxng_limiter.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
searxng_settings.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
searxng_stack.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
searxng_start.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
searxng_status.sh Split setup_searxng.sh 912 -> 184 2026-08-16 19:11:40 +02:00
syncyomi_expose.sh Split three more linux_configuration feature and fix scripts 2026-08-16 18:48:01 +02:00
syncyomi_stack.sh Split three more linux_configuration feature and fix scripts 2026-08-16 18:48:01 +02:00
unreal_mcp_repo.sh Split five more linux_configuration single_use scripts 2026-08-16 18:51:28 +02:00
website_build.sh Split three more linux_configuration feature and fix scripts 2026-08-16 18:48:01 +02:00
wg_firewall.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00
wg_keys.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00
wg_sshd.sh Split three more scripts; make the verifier catch heredoc cuts 2026-08-16 20:16:08 +02:00