qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Robert Foley <robert.foley@linaro.org>
Cc: peter.puhov@linaro.org, philmd@redhat.com, qemu-devel@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v3 01/10] tests/vm: Add validation of target
Date: Wed, 11 Mar 2020 10:57:36 +0000	[thread overview]
Message-ID: <87sgifgnvj.fsf@linaro.org> (raw)
In-Reply-To: <20200310182536.11137-2-robert.foley@linaro.org>


Robert Foley <robert.foley@linaro.org> writes:

> This validation is now useful since some targets
> may not be valid if their dependencies are not installed.
> Instead of allowing the scripts to fail with missing dependencies
> we will fail earlier with a helpful error message.
>
> Signed-off-by: Robert Foley <robert.foley@linaro.org>
> ---
>  tests/vm/Makefile.include | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
> index 1bf9693d19..835e3f3549 100644
> --- a/tests/vm/Makefile.include
> +++ b/tests/vm/Makefile.include
> @@ -2,7 +2,7 @@
>  
>  .PHONY: vm-build-all vm-clean-all
>  
> -IMAGES := freebsd netbsd openbsd centos fedora
> +IMAGES := freebsd netbsd openbsd fedora
>  ifneq ($(GENISOIMAGE),)
>  IMAGES += ubuntu.i386 centos
>  endif
> @@ -49,9 +49,20 @@ vm-build-all: $(addprefix vm-build-, $(IMAGES))
>  vm-clean-all:
>  	rm -f $(IMAGE_FILES)
>  
> +# Validate the target since some targets will not
> +# be valid if their software dependencies are not installed.
> +define validate_target
> +	@echo $(1) | grep $(2) || \
> +	(echo "Invalid target ($(2))"; \
> +	echo "Valid Targets are: $(1)"; \
> +	echo "See make vm-help for more information."; \
> +	exit 1;)
> +endef
> +
>  $(IMAGES_DIR)/%.img:	$(SRC_PATH)/tests/vm/% \
>  			$(SRC_PATH)/tests/vm/basevm.py \
>  			$(SRC_PATH)/tests/vm/Makefile.include
> +	$(call validate_target,${IMAGES},$*)

This mechanism seems suspect to me. Surely the "make" way is to just
ensure we don't include the targets when we don't have the dependencies
like we do above for GENISOIMAGE?

Random side note: I wonder how this sort of problem is solved in a meson
world? Paolo?

-- 
Alex Bennée


  reply	other threads:[~2020-03-11 10:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 18:25 [PATCH v3 00/10] tests/vm: Add support for aarch64 VMs Robert Foley
2020-03-10 18:25 ` [PATCH v3 01/10] tests/vm: Add validation of target Robert Foley
2020-03-11 10:57   ` Alex Bennée [this message]
2020-03-10 18:25 ` [PATCH v3 02/10] tests/vm: Add configuration to basevm.py Robert Foley
2020-03-10 18:25 ` [PATCH v3 03/10] tests/vm: Added configuration file support Robert Foley
2020-03-10 18:25 ` [PATCH v3 04/10] tests/vm: add --boot-console switch Robert Foley
2020-03-10 18:25 ` [PATCH v3 05/10] tests/vm: Add ability to select QEMU from current build Robert Foley
2020-03-10 18:25 ` [PATCH v3 06/10] tests/vm: allow wait_ssh() to specify command Robert Foley
2020-03-10 18:25 ` [PATCH v3 07/10] tests/vm: Added a new script for ubuntu.aarch64 Robert Foley
2020-03-10 18:25 ` [PATCH v3 08/10] tests/vm: Added a new script for centos.aarch64 Robert Foley
2020-03-10 18:25 ` [PATCH v3 09/10] tests/vm: change scripts to use self._config Robert Foley
2020-03-10 18:25 ` [PATCH v3 10/10] tests/vm: Add workaround to consume console Robert Foley
2020-03-10 21:41 ` [PATCH v3 00/10] tests/vm: Add support for aarch64 VMs no-reply
2020-03-11 12:04 ` Alex Bennée
2020-03-11 12:51   ` Robert Foley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgifgnvj.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.puhov@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=robert.foley@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).