TestKillUserSessionsScopeLocal: a peer (scope=local) call kills only locally and must NOT fan out again (recursion guard).
(t *testing.T)
| 62 | // TestKillUserSessionsScopeLocal: a peer (scope=local) call kills only locally |
| 63 | // and must NOT fan out again (recursion guard). |
| 64 | func TestKillUserSessionsScopeLocal(t *testing.T) { |
| 65 | local := &fakeLiveInfo{killedPerUser: 4} |
| 66 | fetcher := &fakePeerFetcher{} |
| 67 | r := killSwitchRouter(local, fetcher, nil) |
| 68 | |
| 69 | code, body := doPost(t, r, "/api/v1/orgs/acme/users/bob/kill?scope=local") |
| 70 | if code != http.StatusOK { |
| 71 | t.Fatalf("expected 200, got %d", code) |
| 72 | } |
| 73 | if got := body["killed"]; got != float64(4) { |
| 74 | t.Fatalf("killed = %v, want 4 (local only)", got) |
| 75 | } |
| 76 | if fetcher.postCallCount() != 0 { |
| 77 | t.Fatalf("scope=local must not fan out, but PostPeers ran %d times", fetcher.postCallCount()) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | // TestDisableUserPersistsReloadsKillsAndFansOut: the disable endpoint persists |
| 82 | // the flag, reloads the snapshot, kills locally, and fans out to peers. |
nothing calls this directly
no test coverage detected