Files
nvdriver/tools/validate_all.sh
morebrackets 19a84a4392 fix(validation,tests,docs): live.log skip reason (#580), controls.tsv capture check (#579), Ampere/Turing parity docs (#578) (#582)
* fix(validation,tests,docs): record live.log skip reason (#580), verify controls.tsv (#579), update Ampere/Turing parity rows (#578)

* docs(parity): attribute Turing live [O] results strictly to RTX 2060 (TU106)

---------

Co-authored-by: morebrackets <19673572+morebrackets@users.noreply.github.com>
2026-12-04 23:35:52 -08:00

91 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
# The handoff's full validation list. Prints one PASS/FAIL/SKIP line per step; logs go
# to target/validate-logs/. Exit status is nonzero if any step failed.
# Pass --offline (or NV_RS_SKIP_LIVE=1) to skip the host-kernel `run_live_control.py` step.
cd "$(dirname "$0")/.." || exit 2
export PATH="$HOME/.cargo/bin:$PATH"
SKIP_LIVE=${NV_RS_SKIP_LIVE:-0}
for arg in "$@"; do
case "$arg" in
--offline) SKIP_LIVE=1 ;;
-h|--help)
echo "usage: $0 [--offline]"
exit 0
;;
*)
echo "unknown option: $arg" >&2
exit 2
;;
esac
done
LOGS=target/validate-logs; mkdir -p "$LOGS"; rc=0
step() {
local name=$1
shift
if "$@" >"$LOGS/$name.log" 2>&1; then
echo "PASS $name"
else
echo "FAIL $name (see $LOGS/$name.log)"
rc=1
return 1
fi
}
optional_step() {
local n=$1
shift
if "$@" >"$LOGS/$n.log" 2>&1; then
echo "PASS $n"
elif [ "$?" -eq 2 ]; then
echo "SKIP $n (see $LOGS/$n.log)"
else
echo "FAIL $n (see $LOGS/$n.log)"
rc=1
fi
}
step fmt cargo fmt --all -- --check
step clippy cargo clippy --workspace --all-targets -- -D warnings
step test cargo test --workspace
for t in device_software software_manager timeout_runtime pf_software dma_bridge clock_store file_cleanup gpu_arch_codegen gpu_registry pci_bridge registry_bridge rom_capture_bridge system_memory_bridge thread_state_bridge wpr_shadow_owner; do step test_$t sh tools/test_$t.sh; done
optional_step test_native_compute sh tools/test_native_compute.sh
step test_kernel_module_gate python3 tests/kernel-module-gate/test_gate_cases.py
step test_symbol_conformance python3 tests/kernel-module-gate/test_symbol_conformance.py
step test_kernel_archive python3 tests/kernel-module-gate/test_kernel_archive.py
step test_first_open_verdict python3 tests/first-open-verdict/test_runner.py
for t in gpu_firmware_owner lsf_image_owner; do step test_$t bash tools/test_$t.sh; done
step modules make modules
step audit make -C src/nvidia audit-codegen
step native_codegen python3 tools/check_native_codegen.py
optional_step gsp_620_headers python3 tools/oracle_gsp_620.py
optional_step gp106_oracles bash tools/gp106/check.sh all
skip_step() {
local name=$1 reason=$2
echo "$reason" >"$LOGS/$name.log"
echo "SKIP $name ($reason)"
}
if ! step guest_build sh tools/vm/build_guest_test.sh; then
skip_step initramfs "guest build failed"
skip_step guest "guest build failed"
skip_step guest_iommu "guest build failed"
elif ! step initramfs sh tools/vm/build_initramfs.sh; then
skip_step guest "initramfs build failed"
skip_step guest_iommu "initramfs build failed"
else
step guest python3 tools/vm/run_guest.py
step guest_iommu python3 tools/vm/run_guest.py --iommu
fi
step result_gate python3 tests/vm/test_result_gate.py
# The live step runs target/compat32-rust-driver; build it on a fresh tree (a failure shows up as FAIL live).
if [ "$SKIP_LIVE" = "1" ]; then
skip_step live "--offline / NV_RS_SKIP_LIVE=1"
else
[ -x target/compat32-rust-driver ] || python3 tools/build_compat32_probe.py --node /dev/nvidia-rsctl --out target/compat32-rust-driver >"$LOGS/compat32_build.log" 2>&1
step live sudo -n python3 tools/run_live_control.py
fi
grep -h "test result" "$LOGS/test.log" | awk '{p+=$4; f+=$6} END{print "tests passed",p,"failed",f}'
MODINFO=$(command -v modinfo 2>/dev/null || ([ -x /sbin/modinfo ] && echo /sbin/modinfo) || ([ -x /usr/sbin/modinfo ] && echo /usr/sbin/modinfo) || true)
if [ -n "$MODINFO" ]; then
"$MODINFO" -F vermagic kernel-open/nvidia_rs.ko
fi
sha256sum kernel-open/nvidia_rs.ko target/vm-module/nv_rs_edu_test.ko
exit $rc