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.

Clean runtime fixtures before qualification teardown

rcourtman089ce2379ddd
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index b928b83097..05cb25d54d 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -7344,6 +7344,9 @@ cannot erase a passing result before the wrapper retains it.
Recovery qualification must wait for the complete stable telemetry digest,
including stats and secondary inventory, rather than accepting an earlier
semantic-only report and racing the evidence assertion.
+Cleanup removes the exact fixture containers through both still-live runtime
+APIs before stopping their services or deleting storage, so Podman namespace
+and shared-memory mounts cannot outlive the state they protect.
The wrapper must compile every Go artifact with mandatory VCS stamping so a
missing revision or unavailable clean-worktree proof fails before live evidence
can be emitted; the receipt and validator retain the exact artifact hashes and
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index bac5d2f9af..c2bb27fb94 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -267,6 +267,11 @@ output boundary; receipts are written there instead of volatile `/run` state so
systemd user-manager cleanup cannot erase completed qualification evidence.
Direct recovery is complete only after the full stable telemetry digest is
observed; the first semantic-only report cannot satisfy the qualification wait.
+Final cleanup removes the exact rootless and rootful fixture containers while
+both runtime APIs are live, then stops the services and removes runtime state.
+The outer wrapper forgets a tracked container only after strict labeled removal
+succeeds, preventing already-removed hosts from producing false manual-cleanup
+warnings when a later runtime fails.
Rootless Docker uses its supported `slirp4netns` driver inside the outer
`--network none` container only; an unsupported `host` RootlessKit driver or
an outer default route invalidates the proof. The disposable host uses a
diff --git a/scripts/installtests/secure_runtime_rootless_qualification_test.go b/scripts/installtests/secure_runtime_rootless_qualification_test.go
index 4003d7e9bd..69a9ded230 100644
--- a/scripts/installtests/secure_runtime_rootless_qualification_test.go
+++ b/scripts/installtests/secure_runtime_rootless_qualification_test.go
@@ -426,6 +426,7 @@ func TestSecureRuntimeRootlessQualification(t *testing.T) {
if registered, revoked, uninstalls := fixture.collectorLifecycleSnapshot(); registered || !revoked || uninstalls != 2 {
t.Fatalf("final collector uninstall was not durably modeled: registered=%t revoked=%t uninstalls=%d", registered, revoked, uninstalls)
}
+ rootlessQualRemoveFixtures(t, daemon)
rootlessQualStopUnit(t, daemon.rootlessUnit)
rootlessQualStopUnit(t, daemon.rootfulUnit)
rootlessQualStopUserManager(t, daemon)
@@ -1179,6 +1180,29 @@ func rootlessQualRemoveRuntimeState(t *testing.T, d rootlessQualDaemon) {
}
}
+func rootlessQualRemoveFixtures(t *testing.T, d rootlessQualDaemon) {
+ t.Helper()
+ rootlessQualRemoveFixtureSet(t, rootlessQualCLI(d, true))
+ rootlessQualRemoveFixtureSet(t, rootlessQualCLI(d, false))
+}
+
+func rootlessQualRemoveFixtureSet(t *testing.T, cli []string) {
+ t.Helper()
+ if len(cli) == 0 {
+ t.Fatal("empty runtime CLI for fixture cleanup")
+ }
+ if out, err := rootlessQualCommandError(30*time.Second, cli[0], append(cli[1:], "rm", "-f", rootlessQualRunningName, rootlessQualExitedName)...); err != nil {
+ t.Fatalf("remove runtime fixtures: %v\n%s", err, out)
+ }
+ remaining := rootlessQualCommand(t, 30*time.Second, cli[0], append(cli[1:], "ps", "-a", "--format", "{{.Names}}")...)
+ for _, name := range strings.Fields(remaining) {
+ name = strings.TrimPrefix(name, "/")
+ if name == rootlessQualRunningName || name == rootlessQualExitedName {
+ t.Fatalf("runtime fixture %s remains after removal", name)
+ }
+ }
+}
+
func rootlessQualStopUserManager(t *testing.T, d rootlessQualDaemon) {
t.Helper()
rootlessQualCommand(t, 10*time.Second, "loginctl", "disable-linger", "pulse-agent")
@@ -1462,6 +1486,34 @@ func TestRootlessQualificationStableDirectMatchWaitsForFullTelemetry(t *testing.
}
}
+func TestRootlessQualificationFixtureRemovalPrecedesStateDeletion(t *testing.T) {
+ temporary := t.TempDir()
+ logPath := filepath.Join(temporary, "runtime.log")
+ runtimePath := filepath.Join(temporary, "runtime")
+ script := `#!/bin/sh
+printf '%s\n' "$*" >>"$ROOTLESS_QUAL_RUNTIME_LOG"
+for arg in "$@"; do
+ case "$arg" in
+ rm|ps) exit 0 ;;
+ esac
+done
+exit 2
+`
+ if err := os.WriteFile(runtimePath, []byte(script), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ t.Setenv("ROOTLESS_QUAL_RUNTIME_LOG", logPath)
+ rootlessQualRemoveFixtureSet(t, []string{runtimePath, "--url", "unix:///run/test.sock"})
+ commands := strings.Split(strings.TrimSpace(string(rootlessQualReadFile(t, logPath))), "\n")
+ want := []string{
+ "--url unix:///run/test.sock rm -f " + rootlessQualRunningName + " " + rootlessQualExitedName,
+ "--url unix:///run/test.sock ps -a --format {{.Names}}",
+ }
+ if !slices.Equal(commands, want) {
+ t.Fatalf("fixture cleanup command order = %q, want %q", commands, want)
+ }
+}
+
func TestRootlessQualificationStopAcceptsCollectedTransientUnit(t *testing.T) {
tempDir := t.TempDir()
logPath := filepath.Join(tempDir, "systemctl.log")
diff --git a/scripts/run-secure-runtime-rootless-qualification.sh b/scripts/run-secure-runtime-rootless-qualification.sh
index d51f555b36..565287c591 100755
--- a/scripts/run-secure-runtime-rootless-qualification.sh
+++ b/scripts/run-secure-runtime-rootless-qualification.sh
@@ -78,6 +78,18 @@ remove_qualification_container_strict() {
fi
}
+forget_qualification_container() {
+ local removed_id="$1"
+ local candidate
+ local retained=()
+ for candidate in "${CONTAINER_IDS[@]}"; do
+ if [[ "${candidate}" != "${removed_id}" ]]; then
+ retained+=("${candidate}")
+ fi
+ done
+ CONTAINER_IDS=("${retained[@]}")
+}
+
remove_qualification_container_best_effort() {
local container_id="$1"
local observed_nonce
@@ -277,6 +289,7 @@ run_runtime() {
capture_qualification_container_diagnostics "${runtime_name}" "${container_id}"
chmod 0600 "${local_receipt}" "${OUTPUT_DIR}/${runtime_name}-test.log"
remove_qualification_container_strict "${container_id}"
+ forget_qualification_container "${container_id}"
}
run_runtime docker