mavend: centralize action validation boundary (slice 4)

This commit is contained in:
2026-09-06 12:53:54 +04:00
parent 6a402bf556
commit 356766bce1
32 changed files with 2061 additions and 178 deletions
+5 -5
View File
@@ -59,7 +59,7 @@ func TestHexisDiscovery401IsDeniedNotDown(t *testing.T) {
h := hexisGapHandler(t, nexus.URL, hexis.URL)
hexis.SetFault(401)
reply := h.handleHexisAct(ctx, actDec("muzick indexer"))
reply := h.handleHexisAct(ctx, actDec("muzick indexer"), routeCandidate("restart"))
if !denied(serviceHexis, reply) {
t.Fatalf("401 from hexis discovery: got %q, want the denied line naming Hexis", reply)
}
@@ -75,7 +75,7 @@ func TestHexisDiscoveryOutageIsDownNotDenied(t *testing.T) {
nexus := newFakeNexus(t, fixtureNexusResolved("ent_muzick", muzickIndexer, "service"))
h := hexisGapHandler(t, nexus.URL, unreachableURL)
reply := h.handleHexisAct(ctx, actDec("muzick indexer"))
reply := h.handleHexisAct(ctx, actDec("muzick indexer"), routeCandidate("restart"))
if !down(serviceHexis, reply) {
t.Fatalf("connection refused from hexis: got %q, want the outage line naming Hexis", reply)
}
@@ -96,7 +96,7 @@ func TestHexisExecute401IsDeniedNotCommandFailure(t *testing.T) {
// Discovery stays healthy; only the execute endpoint refuses. A blanket
// fault would never reach the site under test.
hexis.SetRouteFault("/api/v1/execute", 401)
reply := h.handleHexisAct(ctx, actDec("muzick indexer"))
reply := h.handleHexisAct(ctx, actDec("muzick indexer"), routeCandidate("restart"))
if !denied(serviceHexis, reply) {
t.Fatalf("401 from hexis execute: got %q, want the denied line naming Hexis", reply)
}
@@ -129,7 +129,7 @@ func TestHexisExecuteOutageIsDown(t *testing.T) {
t.Cleanup(hexis.Close)
h := hexisGapHandler(t, nexus.URL, hexis.URL)
reply := h.handleHexisAct(ctx, actDec("muzick indexer"))
reply := h.handleHexisAct(ctx, actDec("muzick indexer"), routeCandidate("restart"))
if !down(serviceHexis, reply) {
t.Fatalf("dropped connection on hexis execute: got %q, want the outage line", reply)
}
@@ -149,7 +149,7 @@ func TestHexisExecutionFailedStaysCommandFailure(t *testing.T) {
hexis := newFakeHexis(t, caps, fixtureHexisExecutionFailed("exec_1", "unit refused to start"))
h := hexisGapHandler(t, nexus.URL, hexis.URL)
reply := h.handleHexisAct(ctx, actDec("muzick indexer"))
reply := h.handleHexisAct(ctx, actDec("muzick indexer"), routeCandidate("restart"))
if down(serviceHexis, reply) || denied(serviceHexis, reply) {
t.Fatalf("a failed execution must not be reported as an ecosystem gap, got %q", reply)
}