Re: [kvm-unit-tests RFC PATCH 4/5] scripts: Generate kvmtool standalone tests

Andrew Jones
2021-09-07T10:21:41Z

On Fri, Jul 02, 2021 at 05:31:21PM +0100, Alexandru Elisei wrote:
> Add support for the standalone target when running kvm-unit-tests under
> kvmtool.
>
> Example command line invocation:
>
> $ ./configure --target=kvmtool
> $ make clean && make standalone
>
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
> scripts/mkstandalone.sh | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
> index 16f461c06842..d84bdb7e278c 100755
> --- a/scripts/mkstandalone.sh
> +++ b/scripts/mkstandalone.sh
> @@ -44,6 +44,10 @@ generate_test ()
> config_export ARCH_NAME
> config_export PROCESSOR
>
> + if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "arm" ]; then
> + config_export TARGET
> + fi

Should export unconditionally, since we'll want TARGET set
unconditionally.

> +
> echo "echo BUILD_HEAD=$(cat build-head)"
>
> if [ ! -f $kernel ]; then
> @@ -59,7 +63,7 @@ generate_test ()
> echo 'export FIRMWARE'
> fi
>
> - if [ "$ENVIRON_DEFAULT" = "yes" ] && [ "$ERRATATXT" ]; then
> + if [ "$TARGET" != "kvmtool" ] && [ "$ENVIRON_DEFAULT" = "yes" ] && [ "$ERRATATXT" ]; then

I think it would be better to ensure that ENVIRON_DEFAULT is "no" for
TARGET=kvmtool in configure.

> temp_file ERRATATXT "$ERRATATXT"
> echo 'export ERRATATXT'
> fi
> @@ -95,12 +99,8 @@ function mkstandalone()
> echo Written $standalone.
> }
>
> -if [ "$TARGET" = "kvmtool" ]; then
> - echo "Standalone tests not supported with kvmtool"
> - exit 2
> -fi
> -
> -if [ "$ENVIRON_DEFAULT" = "yes" ] && [ "$ERRATATXT" ] && [ ! -f "$ERRATATXT" ]; then
> +if [ "$TARGET" != "kvmtool" ] && [ "$ENVIRON_DEFAULT" = "yes" ] && \
> + [ "$ERRATATXT" ] && [ ! -f "$ERRATATXT" ]; then
> echo "$ERRATATXT not found. (ERRATATXT=$ERRATATXT)" >&2
> exit 2
> fi
> --
> 2.32.0
>

Thanks,
drew