region HA P3b T5: review fixes guard the unit fixture runtime
Refuse an existing hairpin runtime directory before the unit test exercises the failed-readback cleanup path. The fixture must never write a live state. The targeted refresh test and instancectl vet pass. Runner 7 passed at 8728d35b; this test-only precondition does not change its host binary.
Co-Authored-By: GPT-6 Astra (codex) <noreply@openai.com>
1 file changed,
+4
−0
internal/instancectl/hairpin_refresh_linux_test.go+4 −0
Intent
Attributed to this commit: 46.1 g CO₂e (5,739,018 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p3b-build, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/instancectl/hairpin_refresh_linux_test.go b/internal/instancectl/hairpin_refresh_linux_test.go| index 318b0eb7e..4d3897fab 100644 |
| --- a/internal/instancectl/hairpin_refresh_linux_test.go |
| +++ b/internal/instancectl/hairpin_refresh_linux_test.go |
| @@ -4,6 +4,7 @@ package instancectl |
| import ( |
| "context" |
| + "errors" |
| "net/netip" |
| "os" |
| "path/filepath" |
| @@ -14,6 +15,9 @@ import ( |
| ) |
| func TestHairpinDenyRefreshOnlyChanges(t *testing.T) { |
| + if _, err := os.Lstat(hairpin.RuntimeDir); !errors.Is(err, os.ErrNotExist) { |
| + t.Fatal("unit fixture refuses an existing hairpin runtime directory", err) |
| + } |
| dir := t.TempDir() |
| t.Setenv("PATH", dir) |
| c := hairpin.Config{V: 1, Region: "ie", PublicIPs: []string{"8.8.8.8", "9.9.9.9"}, PublicIPv4: "1.1.1.1", PrimaryIPv4: "172.31.7.19", PrivateCIDR: "172.31.0.0/16", BootID: "12345678-1234-1234-1234-123456789abc", Account: "123456789012", InstanceID: "i-0123456789abcdef0"} |