mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
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
28 lines
860 B
Go
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)
|
|
}
|
|
}
|