Skip to content

feat(LinuxTentacleE2E): Phase 12.M.L.A.2 — install-tentacle.sh happy path E2E

Placeholder ppxd requested to merge phase12.M.L.A.2-install-script-happy-path into main

Summary

Mirrors the production operator one-liner:

curl -fsSL .../install-tentacle.sh | sudo bash -s -- --version 1.6.0

→ binary lands at INSTALL_DIR, symlink chain on PATH, post-install dirs (config, state, workspace) created, "Verified: squid-tentacle executable" printed.

Why critical

Install is THE prerequisite for every downstream operation. Regression here breaks every new agent provision and re-install. Until this test, zero Linux E2E coverage on the install happy path.

Test mechanism

  1. Build a single-entry tar.gz with a placeholder Squid.Tentacle binary (the test service script, which now handles help + version subcommands and would block on systemd start otherwise)
  2. Stage on LocalReleaseMirror
  3. Run install-tentacle.sh via sudo bash with --version (matches operator one-liner shape exactly)
  4. Assert exit 0 + binary file + symlink chain (INSTALL_DIR/squid-tentacle + /usr/local/bin/squid-tentacle) + post-install dirs + verification message

Why placeholder binary needs to handle help

install-tentacle.sh line 510-516 verification runs squid-tentacle help. Without a help fast-path, the placeholder's main loop is sleep-forever and the install .sh would hang.

Added help fast-path to squid-linux-test-service.sh mirroring the existing version fast-path pattern.

Assertions

Assertion What it pins
exitCode == 0 Whole installation chain succeeded
stdout contains "Installation Complete" Operator-visible banner
stdout contains "Verified: squid-tentacle executable" help subcommand round-tripped through the entire symlink chain
INSTALL_DIR/Squid.Tentacle exists Tar extraction worked
INSTALL_DIR/squid-tentacle symlink exists Well-known-name layer
/usr/local/bin/squid-tentacle symlink exists PATH layer
/etc/squid-tentacle exists CONFIG_DIR for register/run
/var/lib/squid-tentacle exists STATE_DIR for upgrade flow

Recommended overrides (set by fixture)

  • INSTALL_DIR=test-private (avoids /opt collision)
  • DOWNLOAD_BASE=mirror (offline + deterministic)
  • NO_PKG_INSTALL=1 (skip APT/RPM probe)
  • CREATE_USER=no (skip useradd; sudoers block also skipped because SERVICE_USER doesn't exist)
  • SQUID_BASE_URL=http://localhost:1 (defensive — APT repo persistence block's curl fails fast)

Infrastructure additions

LinuxInstallScriptContext:

  • BuildInstallTarGz(version) — single-entry tar.gz with placeholder binary
  • TestServiceScript property + locator
  • Hand-rolled tar+gzip helpers (mirror LinuxLifecycleContext's pattern)

Fidelity tier

🟢 High (Rule 12.4): real production .sh + real bash + real curl + real LocalReleaseMirror serving real tar.gz + real sudo orchestration. No mocks at OS-resource layer.

Test class is in LinuxTentacleHostStateCollection so it serializes against upgrade-lifecycle + service-fixture tests (avoids shared-host-state races; pinned in J.M.L.A.1).

Expected runtime: ~10-15s.

Test plan

  • Linux E2E workflow runs (manual workflow_dispatch after merge)
  • A1h_HappyPath_InstallsBinaryAndCreatesSymlinkChain passes within ~20s
  • No regression on existing 21 Linux E2E tests

🤖 Generated with Claude Code

Merge request reports

Loading