mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-16 13:39:36 +00:00
Current main's required rest shards take 843 and 959 seconds. Four remaining serial recovery validators own private files, child environments or closed service-manager state. Admit them through Go's existing parallel limit before their unchanged deadlines; preserve the live NAS inventory preflight, every scenario and native platform requirement. Contract-Neutral: Test-only scheduling of isolated lifecycle fixtures; installer behaviour, coverage, safety assertions and deadlines are unchanged. Change-source: pulse-maintainer
42 lines
1.6 KiB
Go
42 lines
1.6 KiB
Go
package installtests
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestNativeAgentRemovalSystemdRecipeRuntime(t *testing.T) {
|
|
// The controls use private directories and a closed service-manager model,
|
|
// not live machine inventory. Start the unchanged deadline after admission.
|
|
t.Parallel()
|
|
if runtime.GOOS != "linux" {
|
|
t.Skip("Linux-only native systemd lab; Windows lifecycle remains independently required")
|
|
}
|
|
ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
|
|
defer cancel()
|
|
command := exec.CommandContext(ctx, "python3", repoFile("scripts", "tests", "test_agent_removal_systemd.py"), "-v")
|
|
output, err := command.CombinedOutput()
|
|
if err != nil {
|
|
t.Fatalf("native systemd lab controls: %v\n%s", err, output)
|
|
}
|
|
for _, name := range []string{
|
|
"test_definition_selection_preserves_each_actual_function_and_refuses_drift",
|
|
"test_admission_excludes_worker_self_hosted_nonroot_existing_hosts_and_unbound_source",
|
|
"test_recipe_owns_exact_clean_source_mandatory_linux_execution_and_bounded_retention",
|
|
"test_all_nine_phase_verdicts_and_owned_cleanup_with_closed_manager_model",
|
|
"test_lab_rejects_removal_that_discards_final_batch_readback",
|
|
"test_preexisting_unit_is_never_stopped_or_removed",
|
|
"test_failed_cleanup_stays_failed_and_keeps_ownership_for_reconciliation",
|
|
} {
|
|
if !strings.Contains(string(output), name+" (") {
|
|
t.Fatalf("native systemd lab control %s did not execute:\n%s", name, output)
|
|
}
|
|
}
|
|
if !strings.Contains(string(output), "\nOK\n") || strings.Contains(string(output), "skipped") {
|
|
t.Fatalf("native systemd lab controls incomplete:\n%s", output)
|
|
}
|
|
}
|