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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix(ci): drain native prerequisite version output
rcourtman988ee9fef00c
diff --git a/.github/workflows/unified-agent-native.yml b/.github/workflows/unified-agent-native.ymlindex dbba198781..c5fc099229 100644--- a/.github/workflows/unified-agent-native.yml+++ b/.github/workflows/unified-agent-native.yml@@ -180,9 +180,10 @@ jobs:run: |set -euo pipefailbrew install coreutils+ # Drain version output so pipefail cannot turn early grep closure into SIGPIPE.gnu_timeout="$(brew --prefix coreutils)/bin/gtimeout"test -x "$gnu_timeout"- "$gnu_timeout" --version | grep -q 'GNU coreutils'+ "$gnu_timeout" --version | grep -F 'GNU coreutils' > /dev/nulltimeout_bin="$(mktemp -d "$RUNNER_TEMP/pulse-guidance-tools.XXXXXX")"ln -s "$gnu_timeout" "$timeout_bin/timeout"printf '%s\n' "$timeout_bin" >> "$GITHUB_PATH"@@ -192,7 +193,7 @@ jobs:shell: bashrun: |set -euo pipefail- timeout --version | grep -q 'GNU coreutils'+ timeout --version | grep -F 'GNU coreutils' > /dev/null# Server/LXC fixtures execute Linux-only scripts, not a macOS installer.# Keep their Bash/GNU metadata, archive, checksum and rename semantics local to that step;@@ -212,19 +213,19 @@ jobs:for tool in stat chmod chown cp mv ln readlink sha256sum; doexecutable="$coreutils_bin/g$tool"test -x "$executable"- "$executable" --version | grep -q 'GNU coreutils'+ "$executable" --version | grep -F 'GNU coreutils' > /dev/nullln -s "$executable" "$fixture_bin/$tool"donegnu_tar="$(brew --prefix gnu-tar)/bin/gtar"test -x "$gnu_tar"- "$gnu_tar" --version | grep -q 'GNU tar'+ "$gnu_tar" --version | grep -F 'GNU tar' > /dev/nullln -s "$gnu_tar" "$fixture_bin/tar"# The NAS boot filter rejects embedded NUL/control bytes with octal# ranges. Use the same binary-aware awk semantics as its Linux jobs,# not the native macOS parser, only within these server fixtures.gnu_awk="$(brew --prefix gawk)/bin/gawk"test -x "$gnu_awk"- "$gnu_awk" --version | grep -q 'GNU Awk'+ "$gnu_awk" --version | grep -F 'GNU Awk' > /dev/nullln -s "$gnu_awk" "$fixture_bin/awk"printf 'PULSE_INSTALLER_FIXTURE_BIN=%s\n' "$fixture_bin" >> "$GITHUB_ENV"diff --git a/scripts/installtests/native_guidance_tools_test.go b/scripts/installtests/native_guidance_tools_test.goindex 12da62b079..2415f08d8b 100644--- a/scripts/installtests/native_guidance_tools_test.go+++ b/scripts/installtests/native_guidance_tools_test.go@@ -63,7 +63,7 @@ func TestNativeGuidanceToolsSupplyAndVerifyRealGNUTimeout(t *testing.T) {if err != nil {t.Fatal("native Unix verification requires the real GNU timeout prerequisite")}- for _, scenario := range []string{"real GNU tool", "install failure", "missing tool", "non-GNU tool"} {+ for _, scenario := range []string{"real GNU tool", "streamed version output", "failed version producer", "install failure", "missing tool", "non-GNU tool"} {t.Run(scenario, func(t *testing.T) {root := t.TempDir()bin, prefix := filepath.Join(root, "bin"), filepath.Join(root, "coreutils with spaces")@@ -92,6 +92,10 @@ esacif err := os.Symlink(realTimeout, tool); err != nil {t.Fatal(err)}+ case "streamed version output":+ nativeVersionStreamTool(t, tool, realTimeout, 0)+ case "failed version producer":+ nativeVersionStreamTool(t, tool, realTimeout, 23)case "non-GNU tool":if err := os.WriteFile(tool, []byte("#!/bin/sh\nprintf 'BSD timeout\\n'\n"), 0700); err != nil {t.Fatal(err)@@ -112,9 +116,9 @@ esacif ctx.Err() != nil {t.Fatalf("prerequisite observation did not finish: %v", ctx.Err())}- if scenario != "real GNU tool" {+ if scenario != "real GNU tool" && scenario != "streamed version output" {wantExit := 1- if scenario == "install failure" {+ if scenario == "install failure" || scenario == "failed version producer" {wantExit = 23}exit, ok := runErr.(*exec.ExitError)diff --git a/scripts/installtests/native_installer_fixture_tools_test.go b/scripts/installtests/native_installer_fixture_tools_test.goindex c706840d85..7ae4bd4cfa 100644--- a/scripts/installtests/native_installer_fixture_tools_test.go+++ b/scripts/installtests/native_installer_fixture_tools_test.go@@ -158,9 +158,35 @@ func TestNativeInstallerPhasesKeepNASBeforeFrontendAndAllChecksGating(t *testing}}+// nativeVersionStreamTool preserves real tool behavior while making its version+// producer outlive an early matching grep. A matched but failed producer must+// still fail the prerequisite under pipefail.+func nativeVersionStreamTool(t *testing.T, path, realTool string, exitCode int) {+ t.Helper()+ python, err := exec.LookPath("python3")+ if err != nil {+ t.Fatal(err)+ }+ quote := func(value string) string {+ return "'" + strings.ReplaceAll(value, "'", "'\"'\"'") + "'"+ }+ script := fmt.Sprintf(`#!/bin/sh+set -e+if [ "${1:-}" = --version ]; then+ %s "$@"+ %s -c 'import os, signal; signal.signal(signal.SIGPIPE, signal.SIG_DFL); data = b"version continuation\n" * 256; [os.write(1, data) for _ in range(64)]'+ exit %d+fi+exec %s "$@"+`, quote(realTool), quote(python), exitCode, quote(realTool))+ if err := os.WriteFile(path, []byte(script), 0700); err != nil {+ t.Fatal(err)+ }+}+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 cp", "non-GNU cp", "missing mv", "non-GNU mv", "missing ln", "non-GNU ln", "missing readlink", "non-GNU readlink", "missing sha256sum", "non-GNU sha256sum", "missing tar", "non-GNU tar", "missing awk", "non-GNU awk"} {+ for _, scenario := range []string{"real tools", "symlinked fixture root", "streamed version output", "failed version producer", "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 sha256sum", "non-GNU sha256sum", "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" {@@ -223,7 +249,11 @@ esacif err != nil {t.Fatal(err)}- if err := os.Symlink(realTool, path); err != nil {+ if scenario == "streamed version output" && name != "bash" {+ nativeVersionStreamTool(t, path, realTool, 0)+ } else if scenario == "failed version producer" && name == "stat" {+ nativeVersionStreamTool(t, path, realTool, 23)+ } else if err := os.Symlink(realTool, path); err != nil {t.Fatal(err)}}@@ -251,9 +281,9 @@ esacif ctx.Err() != nil {t.Fatalf("fixture prerequisite deadline: %v", ctx.Err())}- if scenario != "real tools" && scenario != "symlinked fixture root" {+ if scenario != "real tools" && scenario != "symlinked fixture root" && scenario != "streamed version output" {want := 1- if scenario == "install failure" {+ if scenario == "install failure" || scenario == "failed version producer" {want = 23}exit, ok := runErr.(*exec.ExitError)