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
Make native agent tests Windows-safe
rcourtman1894d2e66597
diff --git a/cmd/pulse-agent/main_test.go b/cmd/pulse-agent/main_test.goindex dc6686ece6..2fc38fc65a 100644--- a/cmd/pulse-agent/main_test.go+++ b/cmd/pulse-agent/main_test.go@@ -11,6 +11,7 @@ import ("os""path/filepath""reflect"+ "runtime""strings""sync/atomic""testing"@@ -2083,7 +2084,7 @@ func TestAgentIDFilePersistence(t *testing.T) {if err != nil {t.Fatalf("stat: %v", err)}- if mode := info.Mode().Perm(); mode != 0o600 {+ if mode := info.Mode().Perm(); runtime.GOOS != "windows" && mode != 0o600 {t.Errorf("file permissions = %v, want 0600", mode)}})diff --git a/internal/agentupdate/coverage_test.go b/internal/agentupdate/coverage_test.goindex 1215785ded..b8fb253ce2 100644--- a/internal/agentupdate/coverage_test.go+++ b/internal/agentupdate/coverage_test.go@@ -1179,7 +1179,10 @@ func TestPerformUpdateErrors(t *testing.T) {closeFileFn = origCloserestartProcessFn = origRestart})- closeFileFn = func(*os.File) error { return errors.New("close fail") }+ closeFileFn = func(file *os.File) error {+ _ = file.Close()+ return errors.New("close fail")+ }restartProcessFn = func(string) error { return nil }u.client = &http.Client{diff --git a/internal/agentupdate/update.go b/internal/agentupdate/update.goindex 24feb934ff..f49ba2e230 100644--- a/internal/agentupdate/update.go+++ b/internal/agentupdate/update.go@@ -14,6 +14,7 @@ import ("net/http""os""os/exec"+ "path""path/filepath""runtime""strings"@@ -710,7 +711,7 @@ func qnapPersistentPath(stateDir, agentName string) string {if stateDir == "" {return ""}- return filepath.Join(stateDir, name)+ return path.Join(stateDir, name)}func normalizeAgentName(agentName string) (string, error) {diff --git a/internal/dockeragent/agent_http_test.go b/internal/dockeragent/agent_http_test.goindex aef7b3655e..5338b4c2c2 100644--- a/internal/dockeragent/agent_http_test.go+++ b/internal/dockeragent/agent_http_test.go@@ -11,6 +11,7 @@ import ("net/http/httptest""os""path/filepath"+ "runtime""strings""testing""time"@@ -630,6 +631,9 @@ func TestHandleCommand(t *testing.T) {}func TestHandleStopCommand(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("systemd stop-command behavior is not available on Windows")+ }t.Run("disable error sends failure ack", func(t *testing.T) {writeSystemctl(t, "echo 'access denied' >&2\nexit 1")diff --git a/internal/dockeragent/self_update_test.go b/internal/dockeragent/self_update_test.goindex c37ab7b7bf..e072d7241d 100644--- a/internal/dockeragent/self_update_test.go+++ b/internal/dockeragent/self_update_test.go@@ -772,7 +772,8 @@ func TestSelfUpdate(t *testing.T) {swap(t, &osExecutableFn, func() (string, error) {return execPath, nil})- swap(t, &closeFileFn, func(*os.File) error {+ swap(t, &closeFileFn, func(file *os.File) error {+ _ = file.Close()return errors.New("close failed")})diff --git a/internal/dockeragent/systemd_test.go b/internal/dockeragent/systemd_test.goindex 48369d8618..7d0673882f 100644--- a/internal/dockeragent/systemd_test.go+++ b/internal/dockeragent/systemd_test.go@@ -4,6 +4,7 @@ import ("context""os""path/filepath"+ "runtime""strings""testing")@@ -30,6 +31,9 @@ func writeSystemctl(t *testing.T, script string) string {}func TestDisableSystemdService(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("systemd is not available on Windows")+ }t.Run("no systemctl", func(t *testing.T) {prev := os.Getenv("PATH")_ = os.Setenv("PATH", "")@@ -73,6 +77,9 @@ func TestDisableSystemdService(t *testing.T) {}func TestStopSystemdService(t *testing.T) {+ if runtime.GOOS == "windows" {+ t.Skip("systemd is not available on Windows")+ }t.Run("no systemctl", func(t *testing.T) {prev := os.Getenv("PATH")_ = os.Setenv("PATH", "")