From 250056cb56c93056ff290d99aba2471a76af51bb Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 7 Jul 2026 12:24:57 -0400 Subject: [PATCH] test(e2e): run harness under SPAXEL_MIGRATION_WINDOW_HOURS=0 (bf-qzrmq) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Isolate the window-independence harness change in TestHarness.Start: set SPAXEL_MIGRATION_WINDOW_HOURS=0 (the strict window, not the open 24h default) so the e2e no-reject path actually proves token-based admission regardless of the migration window, instead of silently passing on the implicit/explicit 24h crutch. A comment documents the bf-4mle6 / bf-qzrmq policy and why spaxel-sim nodes connect on real HMAC tokens rather than the window. This is the commit-hygiene half of bf-qzrmq: it stages ONLY the env-var + comment (concern A). The unrelated IO-6 hard-gate test code (TestIO6HardGate_WalkerProducesTrackedBlob, CaptureIO6Diagnostics, GetNodeRecords, GetStatus, io6RunMaxima + the "strings" import — concern B, belonging to bf-4q5w) is deliberately left uncommitted in the working tree. Co-Authored-By: Claude --- mothership/tests/e2e/e2e_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mothership/tests/e2e/e2e_test.go b/mothership/tests/e2e/e2e_test.go index 7d6f73e..6810ee3 100644 --- a/mothership/tests/e2e/e2e_test.go +++ b/mothership/tests/e2e/e2e_test.go @@ -82,6 +82,23 @@ func (h *TestHarness) Start(ctx context.Context) error { "SPAXEL_DATA_DIR="+tmpDir, "SPAXEL_LOG_LEVEL=info", "TZ=UTC", + // Window-independent auth policy (bf-4mle6 / bf-qzrmq): run the harness + // under the STRICT window (SPAXEL_MIGRATION_WINDOW_HOURS=0) — NOT the open + // 24h default — so the no-reject e2e path actually PROVES token-based + // admission regardless of window, instead of silently passing on the + // implicit/explicit 24h crutch. + // + // This works because spaxel-sim (child bf-ekr9c) defaults to --provision: + // resolveTokens() mints a REAL per-node HMAC-SHA256(installSecret, mac) + // token from the mothership /api/provision endpoint and presents it as the + // X-Spaxel-Token header on each node's WS dial. The ingestion server + // (bf-1o7qi) bridges that header into hello.Token, and the always-wired + // validator (main.go SetTokenValidator) accepts a valid token REGARDLESS of + // the migration window — server.go only falls through to the window branch + // for an empty/invalid token, and =0 leaves the deadline zero (past), so a + // tokenless node WOULD be rejected. The sim nodes therefore connect purely + // on the strength of their real tokens, not the window. + "SPAXEL_MIGRATION_WINDOW_HOURS=0", ) h.MothershipCmd.Stdout = io.Discard h.stderrBuf = &bytes.Buffer{}