carlos / platform Public

egress: the interrupted-revoke witness rewrites the parent allow after the grant's nudge, the last unit-level write (#328, final review F1 witness)

Run 20261025T201647-ba380e: the grant's nudge came after the parent rewrite
and recompiled the unit, clearing the freeze, so the interrupted revoke's
slice write alone closed the address. Now: parent allow, grant (nudged,
reachable), parent rewrite while the unit runs, then the interrupted revoke,
as TestRootEgressRevokeWhileRunning's parent-rewritten cases do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 6ca6f98d577c5c3ac68208c09dcebb01cc67e53a parent dddb49c
1 file changed, +18 −9
  • internal/host/egress_interrupt_rootrunner_linux_test.go +18 −9
diff --git a/internal/host/egress_interrupt_rootrunner_linux_test.go b/internal/host/egress_interrupt_rootrunner_linux_test.go
index ba5b229b0..5ccdc1b90 100644
--- a/internal/host/egress_interrupt_rootrunner_linux_test.go
+++ b/internal/host/egress_interrupt_rootrunner_linux_test.go
@@ -74,12 +74,16 @@ func egressInterruptedAssert(host string) int {
// real systemd and the production asserter. It first makes the state in
// which a change of the host slice's allow does not reach a running unit
// on its own (run 20261025T173953-8a3366): the run unit starts with no
-// policy, carlos-instances.slice's allow is rewritten while it runs (as
-// RunProbe's allowResolvers does every five minutes), and only then is
-// 10.0.5.20 granted, through POST /egress, whose nudge (a write on the
-// unit's own list) makes it reachable. The column is then cleared, and a
-// control service process asserts the host and exits after the slice's
-// allow is written and before the run unit is nudged.
+// policy under a carlos-instances.slice allow, 10.0.5.20 is granted
+// through POST /egress, whose nudge (a write on the unit's own list) makes
+// it reachable, and only AFTER that last unit-level write is
+// carlos-instances.slice's allow rewritten while the unit runs (as
+// RunProbe's allowResolvers does every five minutes); a unit-level write
+// after the rewrite would recompile the unit and clear the freeze. This is
+// TestRootEgressRevokeWhileRunning's "parent allow rewritten while
+// running" state. The column is then cleared, and a control service
+// process asserts the host and exits after the slice's allow is written
+// and before the run unit is nudged.
//
// Then: the slice reads back empty, EgressDueDir holds the revoke, and the
// running unit STILL reaches 10.0.5.20 (the freeze: without the record,
@@ -98,11 +102,10 @@ func TestRootEgressInterruptedRevoke(t *testing.T) {
if egressReach(t, c, target) {
t.Fatal("start: the tenant reaches 10.0.5.20 with no policy")
}
- // The parent's allow, rewritten while the run unit runs.
+ // The parent's allow (the resolver allow's stand-in).
egressParentAllow(t, "fd00:5::20/128")
- egressRewriteParent(t, "fd00:5::20/128")
- // The grant, after the rewrite: applied by POST /egress's nudge.
+ // The grant: applied by POST /egress's nudge, the last unit-level write.
if err := b.reg.SetPolicy(b.host, "10.0.5.20", "", egressExpiry()); err != nil {
t.Fatal(err)
}
@@ -115,6 +118,12 @@ func TestRootEgressInterruptedRevoke(t *testing.T) {
}
b.wantAllowed(t, "grant")
+ // Then the parent's allow, rewritten while the run unit runs.
+ egressRewriteParent(t, "fd00:5::20/128")
+ if !egressReach(t, c, target) {
+ t.Fatal("after the parent rewrite: the tenant cannot reach 10.0.5.20")
+ }
+
// The revoke, and the control service that dies doing it.
if err := b.reg.SetPolicy(b.host, "", "", ""); err != nil {
t.Fatal(err)