Files
OpenShell/tasks/scripts/test-install-sh.sh
Evan LezarandDrew Newberry d220d89468 feat(compute): negotiate gateway callback listeners (#2492)
* feat(compute): query gateway listener requirements

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* feat(compute): add Podman listener requirements

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* test(docker): use default gateway bind address

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(gateway): avoid wildcard primary listener

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): validate callback listener discovery

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(server): support split dual-stack listeners

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): support legacy rootless listener discovery

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* test(e2e): accept loopback plaintext rejection

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* docs(agent): add callback listener diagnostics

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(server): restrict compute callback listeners

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): validate local callback port

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* test(server): clarify callback listener contract

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(podman): require pasta for local callbacks

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* docs(gateway): document RPM listener default

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* refactor(server): keep listener provenance diagnostic-only

Signed-off-by: Evan Lezar <elezar@nvidia.com>

* fix(compute): preserve callback listener isolation

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* test(e2e): remove Podman callback relay

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(packaging): preserve Podman callback loopback

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* ci(e2e): run VM smoke on nested-virt runner

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* ci(e2e): gate VM smoke on usable KVM

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* ci(e2e): probe KVM through VM driver

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* ci(e2e): tolerate hosted KVM denial

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* test(server): close traced futures before assertions

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* revert: remove tracing test stabilization

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

---------

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Co-authored-by: Drew Newberry <anewberry@nvidia.com>
2026-07-31 16:41:06 +00:00

114 lines
3.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
out="${tmpdir}/out"
err="${tmpdir}/err"
export OPENSHELL_INSTALL_SH_TEST=1
# shellcheck source=../../install.sh
. "${ROOT}/install.sh"
assert_glibc_preflight_passes() {
local name=$1
local ldd_output=$2
if ! (export OPENSHELL_TEST_GETCONF_UNAVAILABLE=1 OPENSHELL_TEST_LDD_OUTPUT="$ldd_output"; require_linux_package_glibc) >"$out" 2>"$err"; then
echo "FAIL: ${name}" >&2
cat "$err" >&2 || true
exit 1
fi
}
assert_glibc_preflight_fails() {
local name=$1
local expected=$2
local setup=$3
if ("$setup"; require_linux_package_glibc) >"$out" 2>"$err"; then
echo "FAIL: ${name}: expected failure" >&2
exit 1
fi
if ! grep -Fq "$expected" "$err"; then
echo "FAIL: ${name}: missing expected message" >&2
echo "Expected: ${expected}" >&2
echo "Actual:" >&2
cat "$err" >&2 || true
exit 1
fi
}
setup_glibc_227() {
export OPENSHELL_TEST_GETCONF_UNAVAILABLE=1
export OPENSHELL_TEST_LDD_OUTPUT="ldd (GNU libc) 2.27"
}
setup_missing_glibc() {
export OPENSHELL_TEST_GETCONF_UNAVAILABLE=1
export OPENSHELL_TEST_LDD_UNAVAILABLE=1
}
setup_getconf_musl() {
export OPENSHELL_TEST_LDD_UNAVAILABLE=1
export OPENSHELL_TEST_GETCONF_OUTPUT="musl libc"
}
setup_ldd_musl() {
export OPENSHELL_TEST_GETCONF_UNAVAILABLE=1
export OPENSHELL_TEST_LDD_OUTPUT="musl libc (x86_64)"
}
assert_glibc_preflight_passes "glibc 2.28 passes" "glibc 2.28"
assert_glibc_preflight_passes "glibc 2.31 passes" "glibc 2.31"
assert_glibc_preflight_passes "glibc 2.35 passes" "ldd (GNU libc) 2.35"
if ! (export OPENSHELL_TEST_LDD_UNAVAILABLE=1 OPENSHELL_TEST_GETCONF_OUTPUT="glibc 2.35"; require_linux_package_glibc) >"$out" 2>"$err"; then
echo "FAIL: getconf glibc fallback passes" >&2
cat "$err" >&2 || true
exit 1
fi
if ! (export OPENSHELL_TEST_LDD_OUTPUT="not ldd" OPENSHELL_TEST_GETCONF_OUTPUT="glibc 2.35"; require_linux_package_glibc) >"$out" 2>"$err"; then
echo "FAIL: unparseable ldd output falls back to getconf" >&2
cat "$err" >&2 || true
exit 1
fi
assert_glibc_preflight_fails \
"glibc 2.27 fails" \
"OpenShell Linux packages require glibc >= 2.28; detected glibc 2.27." \
setup_glibc_227
assert_glibc_preflight_fails \
"missing glibc detection fails" \
"OpenShell Linux packages require glibc >= 2.28; could not detect glibc." \
setup_missing_glibc
assert_glibc_preflight_fails \
"musl detection fails" \
"OpenShell Linux packages require glibc >= 2.28; detected musl or unsupported libc." \
setup_getconf_musl
assert_glibc_preflight_fails \
"ldd musl fallback fails" \
"OpenShell Linux packages require glibc >= 2.28; detected musl or unsupported libc." \
setup_ldd_musl
if [ "$(PLATFORM=darwin local_gateway_endpoint)" != "https://[::1]:17670" ]; then
echo "FAIL: macOS local gateway endpoint must use IPv6 loopback" >&2
exit 1
fi
if [ "$(PLATFORM=linux local_gateway_endpoint)" != "https://127.0.0.1:17670" ]; then
echo "FAIL: Linux local gateway endpoint must use IPv4 loopback" >&2
exit 1
fi
echo "install.sh focused tests passed"