Download this file
| 1 | //go:build unix |
| 2 | |
| 3 | package host |
| 4 | |
| 5 | import ( |
| 6 | "testing" |
| 7 | |
| 8 | "github.com/carlosframework/platform/internal/hostbox" |
| 9 | ) |
| 10 | |
| 11 | // K25, N11: a relocation target whose stage is blocked leaves moves' |
| 12 | // held-stage request, keyed by its host, and root's pass leaves an ack |
| 13 | // beside it. Another host's empty installation still initialises on the |
| 14 | // box: the relay's two directories are census-opaque, and moves' |
| 15 | // held-stage lock directory a shared tree (fix round 1, I1). |
| 16 | func TestCensusInitializesWithAHeldStageRequest(t *testing.T) { |
| 17 | t.Parallel() |
| 18 | censusWithSharedFiles(t, "moves/held-stage", map[string]string{ |
| 19 | "moves/held-stage/other.example.json": `{"account":"acct","app":"app","host":"other.example","version":"v1","op":"op-1","box":"box"}`, |
| 20 | }) |
| 21 | censusWithSharedFiles(t, "moves/held-staged", map[string]string{ |
| 22 | "moves/held-staged/other.example.json": `{"version":"v1","op":"op-1","at":"2026-10-07T00:00:00Z"}`, |
| 23 | }) |
| 24 | // The held-stage lock either side took for the publication. |
| 25 | censusWithSharedFiles(t, hostbox.CensusTree(".moves"), map[string]string{ |
| 26 | ".moves/held-other.example.lock": "", |
| 27 | }) |
| 28 | } |
| 29 | |