Files
Pulse/scripts/installtests/qnap_autorun_update_test.go
pulse-triage[bot] 89969b6418 Preserve unrelated QNAP startup jobs during agent upgrades
Replace substring and unterminated-range boot deletion with exact owned-entry admission and staged same-filesystem replacement. Preserve ambiguous content and failed staging for recovery, and check append plus flash unmount before claiming persistence. Exercise production writer/caller failures and keep the existing NAS removal fixtures composed. Native QNAP acceptance remains separate.

Change-source: pulse-maintainer
2026-10-27 01:15:55 +00:00

28 lines
858 B
Go

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