Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Supply GNU cp to macOS Linux installer fixtures

pulse-triage[bot]1e2cc90ac255
diff --git a/.github/workflows/unified-agent-native.yml b/.github/workflows/unified-agent-native.yml
index 85038315b6..bb574fdeae 100644
--- a/.github/workflows/unified-agent-native.yml
+++ b/.github/workflows/unified-agent-native.yml
@@ -209,7 +209,7 @@ jobs:
coreutils_bin="$(brew --prefix coreutils)/bin"
fixture_bin="$(mktemp -d "$RUNNER_TEMP/pulse-installer-fixture-tools.XXXXXX")"
ln -s "$linux_bash" "$fixture_bin/bash"
- for tool in stat chmod chown mv ln readlink; do
+ for tool in stat chmod chown cp mv ln readlink; do
executable="$coreutils_bin/g$tool"
test -x "$executable"
"$executable" --version | grep -q 'GNU coreutils'
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index bf33acde6c..43455c7285 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -9344,6 +9344,19 @@ tool/partition and frontend-preparation controls still require the complete
Unix inventory. This fixes check admission, not a macOS verdict, published-key
installation, LXC restoration or the cause of a customer's stopped update.
+The macOS Linux-server fixture tool directory also supplies verified GNU `cp`.
+The server's script-bundle publisher uses `cp --remove-destination` so replacing
+a staged symlink cannot overwrite its unrelated target; native BSD `cp` cannot
+execute that call. Keep this dependency local to both installer-test phases,
+not on the native agent/runtime path. Missing or non-GNU copies must fail tool
+preparation before exporting the fixture path. The registered
+`TestNativeInstallerFixtureToolsAreRealAndStepLocal` executes both phase shells
+with an unusable native `cp`, checks the selected executable, and exercises the
+actual replacement flag with file bytes and an unchanged symlink target. The
+signature-sidecar fixture also supplies the publisher's error logger, so a
+failed copy reports its real diagnostic rather than a missing shell function.
+This supplies Linux fixture semantics, not a macOS or installed-upgrade verdict.
+
### Bounded Docker module-proxy recovery (7 October 2026)
The Docker backend builder uses `scripts/go-mod-download.sh` with the same
diff --git a/scripts/installtests/native_installer_fixture_tools_test.go b/scripts/installtests/native_installer_fixture_tools_test.go
index aab8677700..7844633a15 100644
--- a/scripts/installtests/native_installer_fixture_tools_test.go
+++ b/scripts/installtests/native_installer_fixture_tools_test.go
@@ -160,7 +160,7 @@ func TestNativeInstallerPhasesKeepNASBeforeFrontendAndAllChecksGating(t *testing
func TestNativeInstallerFixtureToolsAreRealAndStepLocal(t *testing.T) {
supply, preflight, installer := nativeInstallerFixtureSteps(t)
- for _, scenario := range []string{"real tools", "symlinked fixture root", "install failure", "missing bash", "legacy bash", "missing stat", "non-GNU chmod", "missing mv", "non-GNU mv", "missing ln", "non-GNU ln", "missing readlink", "non-GNU readlink", "missing tar", "non-GNU tar", "missing awk", "non-GNU awk"} {
+ for _, scenario := range []string{"real tools", "symlinked fixture root", "install failure", "missing bash", "legacy bash", "missing stat", "non-GNU chmod", "missing cp", "non-GNU cp", "missing mv", "non-GNU mv", "missing ln", "non-GNU ln", "missing readlink", "non-GNU readlink", "missing tar", "non-GNU tar", "missing awk", "non-GNU awk"} {
t.Run(scenario, func(t *testing.T) {
root := t.TempDir()
if scenario == "symlinked fixture root" {
@@ -191,7 +191,7 @@ esac
if err := os.WriteFile(filepath.Join(bin, "brew"), []byte(brew), 0700); err != nil {
t.Fatal(err)
}
- tools := []string{"bash", "stat", "chmod", "chown", "mv", "ln", "readlink", "tar", "awk"}
+ tools := []string{"bash", "stat", "chmod", "chown", "cp", "mv", "ln", "readlink", "tar", "awk"}
installed := make(map[string]string)
for _, name := range tools {
leaf, toolPrefix := name, prefix
@@ -231,7 +231,7 @@ esac
// Native macOS defaults must not be the fallback for Linux-only
// archive extraction, canonicalization or atomic replacement. Real
// GNU tools must win even when the native names are unsuitable.
- for _, name := range []string{"mv", "readlink", "tar", "awk"} {
+ for _, name := range []string{"cp", "mv", "readlink", "tar", "awk"} {
if err := os.WriteFile(filepath.Join(bin, name), []byte("#!/bin/sh\nprintf 'native BSD utility reached\\n' >&2\nexit 64\n"), 0700); err != nil {
t.Fatal(err)
}
@@ -278,7 +278,7 @@ esac
}
entries, err := os.ReadDir(fixtureBin)
if err != nil || len(entries) != len(tools) {
- t.Fatal("fixture supply must select only Bash/stat/chmod/chown/mv/ln/readlink/tar/awk")
+ t.Fatal("fixture supply must select only Bash/stat/chmod/chown/cp/mv/ln/readlink/tar/awk")
}
for _, name := range tools {
if target, err := os.Readlink(filepath.Join(fixtureBin, name)); err != nil || target != installed[name] {
@@ -294,7 +294,7 @@ esac
set -eu
test "$*" = "scripts/installtests/run_unix_contracts.py --phase $EXPECTED_PHASE" || exit 91
test "$(command -v bash)" = "$PULSE_INSTALLER_FIXTURE_BIN/bash" || exit 92
-for tool in stat chmod chown mv ln readlink tar awk; do
+for tool in stat chmod chown cp mv ln readlink tar awk; do
test "$(command -v "$tool")" = "$PULSE_INSTALLER_FIXTURE_BIN/$tool" || exit 93
done
# The expected readlink result must use a physical root too. A temporary
@@ -308,7 +308,14 @@ tar -czf "$PROBE_ROOT/source.tgz" -C "$PROBE_ROOT" source
mkdir -p "$PROBE_ROOT/extracted"
tar --no-same-owner --no-overwrite-dir -xzf "$PROBE_ROOT/source.tgz" -C "$PROBE_ROOT/extracted"
cmp "$PROBE_ROOT/source" "$PROBE_ROOT/extracted/source"
-cp "$PROBE_ROOT/extracted/source" "$PROBE_ROOT/staged"
+# The server's bundle publisher replaces a staged symlink without changing
+# its target. BSD cp cannot execute this production flag. Verify bytes and
+# link identity too, not just that the selected tool reports GNU provenance.
+printf 'unrelated target\n' > "$PROBE_ROOT/copy-target"
+ln -s -- "$PROBE_ROOT/copy-target" "$PROBE_ROOT/staged"
+cp --remove-destination -- "$PROBE_ROOT/extracted/source" "$PROBE_ROOT/staged"
+test ! -L "$PROBE_ROOT/staged"
+test "$(cat "$PROBE_ROOT/copy-target")" = 'unrelated target'
mv -T "$PROBE_ROOT/staged" "$PROBE_ROOT/published"
cmp "$PROBE_ROOT/source" "$PROBE_ROOT/published"
test ! -e "$PROBE_ROOT/staged"
diff --git a/scripts/installtests/root_install_sh_test.go b/scripts/installtests/root_install_sh_test.go
index 82a4280ca9..113546dbe6 100644
--- a/scripts/installtests/root_install_sh_test.go
+++ b/scripts/installtests/root_install_sh_test.go
@@ -1489,6 +1489,7 @@ func TestRootInstallDeployAgentScriptsDeploysSignatureSidecars(t *testing.T) {
set -euo pipefail
print_warn() { :; }
print_success() { :; }
+ print_error() { printf '%s\n' "$*" >&2; }
chown() { :; }
INSTALL_DIR="` + installDir + `"
` + extractRootInstallShellFunction(t, "deploy_agent_scripts") + `