Files
Pulse/scripts/installtests/unraid_go_update_test.go
pulse-triage[bot] f56b7e2b38 Preserve operator boot jobs during Unraid agent upgrades
Replace only exact top-level generated launches, retaining ambiguous boot content and recovery on failure. Stage and validate replacement before rename, preserve unrelated jobs and existing modes without assuming FAT supports chmod, and stop installation before claiming unconfirmed boot persistence. Cover compound commands, launch-like data, write faults, FAT permission limits and caller failure in the normal installer inventory.

Change-source: pulse-maintainer
2026-10-27 02:25:03 +00:00

28 lines
860 B
Go

package installtests
import (
"context"
"os/exec"
"runtime"
"strings"
"testing"
"time"
)
func TestInstallSHUnraidBootReplacementPreservesUnrelatedJobs(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Unix shell/filesystem fixture; native Unraid acceptance remains separate")
}
ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second)
defer cancel()
command := exec.CommandContext(ctx, "python3", repoFile("scripts", "installtests", "unraid_go_update.py"), "-v")
output, err := command.CombinedOutput()
if err != nil {
t.Fatalf("Unraid boot replacement controls: %v\n%s", err, output)
}
if !strings.Contains(string(output), "Ran 20 tests in ") ||
!strings.Contains(string(output), "\nOK\n") || strings.Contains(string(output), "skipped") {
t.Fatalf("incomplete Unraid boot replacement controls:\n%s", output)
}
}