Re: [kvm-unit-tests PATCH v3 05/16] scripts: Document environment variables

Shaoqin Huang
2025-05-14T03:37:12Z

On 5/7/25 11:12 PM, Alexandru Elisei wrote:
> Document the environment variables that influence how a test is executed
> by the run_tests.sh test runner.
>
> Suggested-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>

Reviewed-by: Shaoqin Huang <shahuang@redhat.com>

> ---
> docs/unittests.txt | 5 ++++-
> run_tests.sh | 12 +++++++++---
> 2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/docs/unittests.txt b/docs/unittests.txt
> index 6eb315618dbd..ea0da959f008 100644
> --- a/docs/unittests.txt
> +++ b/docs/unittests.txt
> @@ -102,7 +102,8 @@ timeout
> -------
> timeout = <duration>
>
> -Optional timeout in seconds, after which the test will be killed and fail.
> +Optional timeout in seconds, after which the test will be killed and fail. Can
> +be overwritten with the TIMEOUT=<duration> environment variable.
>
> check
> -----
> @@ -113,3 +114,5 @@ can contain multiple files to check separated by a space, but each check
> parameter needs to be of the form <path>=<value>
>
> The path and value cannot contain space, =, or shell wildcard characters.
> +
> +Can be overwritten with the CHECK environment variable with the same syntax.
> diff --git a/run_tests.sh b/run_tests.sh
> index f30b6dbd131c..dd9d27377905 100755
> --- a/run_tests.sh
> +++ b/run_tests.sh
> @@ -27,9 +27,15 @@ Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS] [-t] [-l]
> -l, --list Only output all tests list
> --probe-maxsmp Update the maximum number of VCPUs supported by host
>
> -Set the environment variable QEMU=/path/to/qemu-system-ARCH to
> -specify the appropriate qemu binary for ARCH-run.
> -
> +The following environment variables are used:
> +
> + QEMU Path to QEMU binary for ARCH-run
> + ACCEL QEMU accelerator to use, e.g. 'kvm', 'hvf' or 'tcg'
> + ACCEL_PROPS Extra argument(s) to ACCEL
> + MACHINE QEMU machine type
> + TIMEOUT Timeout duration for the timeout(1) command
> + CHECK Overwrites the 'check' unit test parameter (see
> + docs/unittests.txt)
> EOF
> }
>

--
Shaoqin