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.

Keep the real-systemctl controls skipped where systemctl is absent

rcourtman3e3ad9a5bd55
diff --git a/scripts/installtests/install_sh_test.go b/scripts/installtests/install_sh_test.go
index 3b4c7b231e..f6076fb582 100644
--- a/scripts/installtests/install_sh_test.go
+++ b/scripts/installtests/install_sh_test.go
@@ -4575,13 +4575,22 @@ func TestRootInstallServiceDiscoveryFailsClosedWithoutShortReads(t *testing.T) {
// the unattended updater: a skipped or deleted control would hide a refusing installer.
for _, name := range []string{
"test_fresh_host_no_matching_unit_files_is_an_empty_inventory",
- "test_real_systemctl_on_a_host_without_pulse_units_selects_the_default",
"test_partial_failed_inventory_is_not_absence",
} {
if !regexp.MustCompile(regexp.QuoteMeta(name) + ` \(.*\) \.\.\. ok`).Match(out) {
t.Fatalf("service discovery control %s did not run and pass:\n%s", name, out)
}
}
+ // The real-systemctl control needs systemctl: it must pass where systemctl exists
+ // and be skipped, not silently absent, where it does not (macOS).
+ realControl := "test_real_systemctl_on_a_host_without_pulse_units_selects_the_default"
+ outcome := `\.\.\. ok`
+ if _, lookErr := exec.LookPath("systemctl"); lookErr != nil {
+ outcome = `\.\.\. skipped`
+ }
+ if !regexp.MustCompile(regexp.QuoteMeta(realControl) + ` \(.*\) ` + outcome).Match(out) {
+ t.Fatalf("service discovery control %s did not report %q:\n%s", realControl, outcome, out)
+ }
}
func TestRootInstallStableReleaseTagRejectsPrereleaseShapes(t *testing.T) {
diff --git a/scripts/tests/test_server_service_discovery.py b/scripts/tests/test_server_service_discovery.py
index 4c880bc01d..e927d47a31 100644
--- a/scripts/tests/test_server_service_discovery.py
+++ b/scripts/tests/test_server_service_discovery.py
@@ -353,6 +353,7 @@ class ServiceDiscovery(unittest.TestCase):
self.assertEqual(e["result"].returncode, 0, e["result"].stderr)
self.assertEqual(e["result"].stdout, "SERVICE=pulse\n")
+ @unittest.skipUnless(REAL_SYSTEMCTL, "systemctl unavailable")
def test_real_systemctl_fixture_inventory_has_compatible_rows(self):
e = self.run_fixture(mode="real")
self.assertEqual(e["result"].returncode, 0, e["result"].stderr)