Skip to content

Add install/update test harness; fix bugs surfaced by it#11

Merged
d4rken merged 2 commits into
devfrom
harden-install-update
Apr 29, 2026
Merged

Add install/update test harness; fix bugs surfaced by it#11
d4rken merged 2 commits into
devfrom
harden-install-update

Conversation

@d4rken

@d4rken d4rken commented Apr 29, 2026

Copy link
Copy Markdown
Member

Adds bats coverage and a Docker-based installer smoke matrix for install.sh and update.sh — the standalone curl | bash path, the getGIT wget fallback, and an end-to-end update against a fake feed.airplanes.live HTTP endpoint. To make this practical, install.sh and update.sh now share scripts/lib/install-update-common.sh (with inline fallbacks preserved so the standalone path keeps working). CI gates on shellcheck (warning), bash -n, and the bats suite; .shellcheckrc disables SC1090/SC2034 for the dynamic-source and library-globals patterns intentional throughout the codebase.

Writing the tests surfaced — and this PR also fixes — a handful of latent bugs:

  • The update.sh migration from beast_reduce_out to beast_reduce_plus_out (the _plus_ variant transmits the feeder UUID on connect, so the server can attribute the feed to a specific receiver) was a no-op — sed source and replacement were byte-identical — and ran after the service had already restarted with the stale value. Existing feeders kept connecting anonymously and never picked up the new value.
  • Package installer used apt instead of apt-get (Debian documents apt as unstable for scripting).
  • source "$FEED_ENV" was unguarded; a missing config aborted under set -e instead of triggering the setup re-run path.
  • configure.sh accepted any string for latitude/longitude, allowing numeric-prefix garbage to land in a sourced env file.

d4rken added 2 commits April 29, 2026 09:25
Keep AIRPLANES_ROOT out of feed.env, accept a leading + on lat/lon, broaden the beast_reduce_plus_out migration to any TARGET line, skip self-update during update.sh test mode, and require exactly one entry in the getGIT archive fallback. Reorder dnf before yum in auto-detect, add wget/unzip/newt/gawk to RPM lists, and pull whiptail/mawk into the apt update set so the update-to-setup path works on minimal images. Prevent PR-ref expression injection in installer-smoke, pin it to the checked-out SHA via file://, and split it into a bundled/standalone matrix. Add bats coverage for configure.sh and an inline-fallback drift check between install.sh / update.sh and the shared lib.
@d4rken d4rken merged commit 3ee0ef9 into dev Apr 29, 2026
6 checks passed
@d4rken d4rken deleted the harden-install-update branch April 29, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant