Phase 12.L.E.3 — LinuxServiceFixture + smoke tests (foundation for full lifecycle)
Summary
Linux fixture foundation for the upcoming full-lifecycle tests (J.L.E.4+). Mirrors WindowsServiceFixture's role on the Linux side — install + start + stop + uninstall a real systemd service so subsequent upgrade-flow tests can drive the .sh's systemctl restart Phase B swap mechanics against an actual running unit.
Tier
New artifacts
| Artifact | Purpose |
|---|---|
tests/Squid.LinuxTentacleE2E.TestService/squid-linux-test-service.sh |
Minimal systemd-compatible bash service. On start: read version.txt, write marker. On SIGTERM: trap deletes marker, exits 0 |
LinuxServiceFixture |
systemctl install/start/stop/uninstall via passwordless sudo. Type=simple unit, KillMode=mixed for clean SIGTERM trap firing |
LinuxServiceFixture.IsAvailable |
Dual probe: OS check + sudo -n true (passwordless sudo). Skip-guards for macOS/Windows + Linux-without-sudo dev hosts |
Fixture_FullLifecycle_InstallStartMarkerStopUninstall |
Install + start → verify active + marker → stop → verify marker absent (proves trap ran, not SIGKILL) → dispose |
Fixture_RepeatedInstall_DoesNotFailDueToStaleService |
Pins idempotent re-install: round-1 dispose reaps enough that round-2 install succeeds with new fixture instance |
Why bash (not a binary)
- systemd-compatible by design
- Universal on every supported Linux distro (no .NET runtime needed for the test service itself)
- Easier to reason about: one file, no cross-compile concerns
- Same observable contract as Windows test service (marker file with version content)
Local verification (macOS)
5/5 pass. The 3 cross-platform script tests run; the 2 fixture smoke tests skip-guard via IsAvailable=false on macOS (no systemd).
Workflow update
tentacle-linux-e2e.yml default filter extended to include the new category.
Next phase (J.L.E.4)
-
LinuxLifecycleContext(IDisposable wrapper around fixture + LocalReleaseMirror + state-dir override + cleanup) - First full Linux lifecycle test (E1.h-Linux analog): drive .sh end-to-end → SUCCESS in last-upgrade.json + service swapped to v2
- Surface any production .sh bugs that the J.L.E.1 placeholder + parse pin couldn't catch (systemd-run --scope re-exec, apt/yum/tarball method probing, sudo handling)