Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Answer the negotiated API-key login in the lifetime fixture

pulse-triage[bot]7107e38e83e6
diff --git a/internal/truenas/client_test.go b/internal/truenas/client_test.go
index 724796cd04..bc412df94d 100644
--- a/internal/truenas/client_test.go
+++ b/internal/truenas/client_test.go
@@ -2560,10 +2560,14 @@ func TestClientFixtureOwnsRPCSessionLifetime(t *testing.T) {
})
t.Run("fixture lifetime", func(t *testing.T) {
fixture := newProtocolFixture(t, func(_ int, request trueNASRPCRequest) protocolFixtureReply {
- if request.Method == "auth.login_ex" {
+ switch request.Method {
+ case "auth.login_ex":
return protocolFixtureReply{result: map[string]any{"response_type": "SUCCESS"}}
+ case "auth.login_with_api_key":
+ return protocolFixtureReply{result: true}
+ default:
+ return protocolFixtureReply{result: []any{}}
}
- return protocolFixtureReply{result: []any{}}
}, nil)
client = mustClientForServer(t, fixture.server.URL, ClientConfig{APIKey: "fixture-key", InsecureSkipVerify: true})
if _, err := client.GetPools(context.Background()); err != nil {