#!/bin/sh
set -e

# some test to verify that everything gets installed correctly, and is linked.

# nvidia-container-toolkit-base
nvidia-ctk --help
nvidia-ctk --version
# nvidia-container-runtime is a thin wrapper around the low-level OCI runtime
# (runc/crun); even --version constructs the runtime, so use --version rather
# than --help (which would be forwarded to runc).
nvidia-container-runtime --version
nvidia-cdi-hook --help

# nvidia-container-toolkit
nvidia-container-runtime-hook --help 2>&1
nvidia-ctk-installer --help 2>&1

# nvidia-container-toolkit-operator-extensions
nvidia-container-runtime.cdi --version
nvidia-container-runtime.legacy --version

# A few representative sub-commands respond to --help.
nvidia-ctk cdi --help
nvidia-ctk config --help
nvidia-ctk runtime --help
nvidia-ctk system --help
nvidia-ctk info --help
