mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
66 lines
2.8 KiB
Bash
Executable File
66 lines
2.8 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.
|
|
cd "$(dirname "$0")/.." || exit 2
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
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_kernel_archive python3 tests/kernel-module-gate/test_kernel_archive.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
|
|
guest_skip() {
|
|
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
|
|
guest_skip initramfs "guest build failed"
|
|
guest_skip guest "guest build failed"
|
|
guest_skip guest_iommu "guest build failed"
|
|
elif ! step initramfs sh tools/vm/build_initramfs.sh; then
|
|
guest_skip guest "initramfs build failed"
|
|
guest_skip 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).
|
|
[ -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
|
|
grep -h "test result" "$LOGS/test.log" | awk '{p+=$4; f+=$6} END{print "tests passed",p,"failed",f}'
|
|
modinfo -F vermagic kernel-open/nvidia_rs.ko
|
|
sha256sum kernel-open/nvidia_rs.ko target/vm-module/nv_rs_edu_test.ko
|
|
exit $rc
|