mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Copy the verified download into an exclusive, checksum-bound destination-directory leaf while the original service is still intact. Inherit destination ACLs and track only the created stage for cleanup, then use that prepared leaf for the existing replacement path. Register native PowerShell 5.1 real-file, refusal, state, ACL and cleanup controls alongside portable wiring checks. Late publication and service startup remain separate failure boundaries. Contract-Neutral: Implementation-only destination preparation preserves the existing installer trust, service-removal, saved-state and completion contracts; no API, rendered surface or release orchestration change. Change-source: pulse-maintainer
24 lines
834 B
Go
24 lines
834 B
Go
package installtests
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestInstallPS1PreparedBinaryRuntime(t *testing.T) {
|
|
powerShell := nativeInstallerPowerShell(t)
|
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
|
|
defer cancel()
|
|
cmd := exec.CommandContext(ctx, powerShell, "-NoLogo", "-NoProfile", "-NonInteractive", "-File",
|
|
repoFile("scripts", "installtests", "windows_binary_preparation_controls.ps1"),
|
|
"-InstallerPath", repoFile("scripts", "install.ps1"), "-TempDir", t.TempDir())
|
|
output, err := cmd.CombinedOutput()
|
|
if err != nil || !strings.Contains(string(output), "PASS all 9 Windows binary preparation controls and inherited-ACL/unique-stage controls") {
|
|
t.Fatalf("production Windows binary preparation controls failed: %v\n%s", err, output)
|
|
}
|
|
t.Logf("%s", output)
|
|
}
|