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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
test: Add tests for hostAgentSearchCandidates parameter variants
rcourtmanad646e392303
diff --git a/internal/api/router_test.go b/internal/api/router_test.goindex 513a1c47a0..bb20934e9a 100644--- a/internal/api/router_test.go+++ b/internal/api/router_test.go@@ -804,3 +804,43 @@ func TestCapturePublicURLFromRequest_NilInputs(t *testing.T) {r.capturePublicURLFromRequest(req)})}++func TestHostAgentSearchCandidates(t *testing.T) {+ t.Parallel()++ tests := []struct {+ name string+ platform string+ arch string+ wantLen int // expected number of search paths+ }{+ {+ name: "strict mode with both params",+ platform: "linux",+ arch: "amd64",+ wantLen: 3, // 3 paths with platform-arch suffix+ },+ {+ name: "platform only, no arch",+ platform: "linux",+ arch: "",+ wantLen: 3, // 3 paths with platform suffix only+ },+ {+ name: "no params returns generic paths",+ platform: "",+ arch: "",+ wantLen: 3, // 3 generic paths+ },+ }++ for _, tt := range tests {+ t.Run(tt.name, func(t *testing.T) {+ paths := hostAgentSearchCandidates(tt.platform, tt.arch)+ if len(paths) != tt.wantLen {+ t.Errorf("hostAgentSearchCandidates(%q, %q) returned %d paths, want %d",+ tt.platform, tt.arch, len(paths), tt.wantLen)+ }+ })+ }+}