Pin re-register NoOp behavior (C3h: skip HTTP when already registered, preserve cert)
Summary
-
C3h pins the actual production behavior when
registeris run a second time on an already-registered tentacle: the binary exits 0 but skips the HTTP call (NoOpRegistrarfires), preserving cert identity and re-persisting config. - This contract was discovered through CI iteration. The first version of C3h asserted
stub.ReceivedRegistrations.Count == 2, which failed becauseLinuxTentacleFlavor.ResolveRegistrarreturnsNoOpRegistrarwhenTentacle:Registered=true. Rule 9 discipline: pin actual production behavior, raise gaps separately. -
Spawned production fix task (chip in your session): operator-impact gap where re-register silently no-ops their role/environment update. Adding
--forceflag is the recommended fix.
What this test pins
| # | Assertion | Why |
|---|---|---|
| 1 | Both registers exit 0 | No error on the no-op path |
| 2 | stub.ReceivedRegistrations.Count == 1 |
NoOpRegistrar skips HTTP — second call doesn't reach the stub |
| 3 | Second stdout contains "Tentacle already registered (Registered=true), skipping re-registration" | Operator-tailed diagnostic log |
| 4 | Second stdout contains "Listening mode — skipping auto-registration. Machine must be added on Server manually" | NoOpRegistrar's recovery hint |
| 5 |
show-thumbprint after both registers matches FIRST register's thumbprint |
Cert identity preserved through NoOp path |
| 6 | Config still parses as valid JSON + still contains ServerThumbprint | No append-instead-of-overwrite regression |
Why pinning the as-is matters
If/when the production fix (--force flag) lands, this test gets updated to assert the new contract. Pinning aspirational behavior here would have required first changing production. The test now reflects reality and any future change is intentional + reviewed.
Test plan
-
dotnet buildgreen (0 errors) -
CI passes C3h_RegisterWhenAlreadyRegistered_SkipsHttpCallButPreservesIdentity -
All 6 assertions verify actual production behavior — see table above -
Existing 45 Linux E2E tests still pass
Related (spawned tasks)
- Production fix: register CLI silent no-op when already registered (operator-impact gap)
- Production fix: suppress Serilog logs in show-thumbprint stdout (D1h discovery)