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.

Make the agent token test platform-aware

rcourtman685a671c61df
diff --git a/cmd/pulse-agent/main_test.go b/cmd/pulse-agent/main_test.go
index 3f186937aa..83d6cec6e6 100644
--- a/cmd/pulse-agent/main_test.go
+++ b/cmd/pulse-agent/main_test.go
@@ -794,7 +794,7 @@ func TestResolveEnableCommands(t *testing.T) {
func TestResolveToken(t *testing.T) {
fakeReadFile := func(path string) ([]byte, error) {
- if path == "/var/lib/pulse-agent/token" {
+ if path == defaultTokenFilePath() {
return []byte("default-token"), nil
}
if path == "valid-file" {
@@ -814,7 +814,6 @@ func TestResolveToken(t *testing.T) {
{"file priority", "", "valid-file", "env-token", "file-token"},
{"env priority", "", "", "env-token", "env-token"},
{"default file priority", "", "", "", "default-token"},
- {"missing returns empty", "", "", "", "default-token"}, // Wait, default-token will be returned if nothing else is provided
}
// Update the test cases to avoid the default file if we want to test empty