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.

Preserve first service-inventory evidence with upstream fresh-host repair

pulse-triage[bot]ac4c4cebe44e
diff --cc scripts/installtests/install_sh_test.go
index 1539f7e75e,f6076fb582..16f790e7fc
--- a/scripts/installtests/install_sh_test.go
+++ b/scripts/installtests/install_sh_test.go
@@@ -4570,19 -4569,28 +4570,30 @@@ func TestRootInstallServiceDiscoveryFai
if err != nil {
t.Fatalf("installer service discovery/caller controls: %v\n%s", err, out)
}
- // systemd exits 1 and prints nothing when no named unit file exists, which is every
- // fresh host. These controls must have actually run and passed, with both the
- // confined double and real systemctl over an empty unit root, for the installer and
- // the unattended updater: a skipped or deleted control would hide a refusing installer.
+ // Do not let deleting a fresh-host or failure-retention control silently
+ // leave this all-method fixture green. Real systemctl remains optional on
+ // platforms without it; the portable production-function controls do not.
for _, name := range []string{
"test_fresh_host_no_matching_unit_files_is_an_empty_inventory",
+ "test_partial_failed_inventory_is_not_absence",
+ "test_first_inventory_failure_is_not_replaced_by_silent_absence",
+ "test_only_silent_exit_one_is_admitted_as_absence",
+ "test_blank_line_output_is_not_a_silent_failed_inventory",
} {
- if !regexp.MustCompile(regexp.QuoteMeta(name) + ` \(.*\) \.\.\. ok`).Match(out) {
- t.Fatalf("service discovery control %s did not run and pass:\n%s", name, out)
+ if !strings.Contains(string(out), name+" (__main__.ServiceDiscovery."+name+") ... ok") {
+ t.Fatalf("required service inventory control %s did not 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) {