[PATCH v8 3/4] Acceptance tests: add make targets to download images

Cleber Rosa posted 4 patches 6 years, 1 month ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PATCH v8 3/4] Acceptance tests: add make targets to download images
Posted by Cleber Rosa 6 years, 1 month ago
The newly introduced "boot linux" tests make use of Linux images that
are larger than usual, and fall into what Avocado calls "vmimages",
and can be referred to by name, version and architecture.

The images can be downloaded automatically during the test. But, to
make for more reliable test results, this introduces a target that
will download the vmimages for the architectures that have been
configured and are available for the currently used distro (Fedora
31).

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/Makefile.include | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index b381387048..78a6f089ff 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -1177,7 +1177,20 @@ $(TESTS_RESULTS_DIR):
 
 check-venv: $(TESTS_VENV_DIR)
 
-check-acceptance: check-venv $(TESTS_RESULTS_DIR)
+FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
+FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
+FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
+
+# download one specific Fedora 31 image
+get-vmimage-fedora-31-%: $(check-venv)
+	$(call quiet-command, \
+             $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
+             --distro=fedora --distro-version=31 --arch=$*)
+
+# download all vm images, according to defined targets
+get-vmimage: $(patsubst %,get-vmimage-fedora-31-%, $(FEDORA_31_DOWNLOAD))
+
+check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vmimage
 	$(call quiet-command, \
             $(TESTS_VENV_DIR)/bin/python -m avocado \
             --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
@@ -1188,7 +1201,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
 
 # Consolidated targets
 
-.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
+.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vmimage
 check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 check-block: $(patsubst %,check-%, $(check-block-y))
-- 
2.21.0


Re: [PATCH v8 3/4] Acceptance tests: add make targets to download images
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
On 12/19/19 12:24 AM, Cleber Rosa wrote:
> The newly introduced "boot linux" tests make use of Linux images that
> are larger than usual, and fall into what Avocado calls "vmimages",
> and can be referred to by name, version and architecture.
> 
> The images can be downloaded automatically during the test. But, to
> make for more reliable test results, this introduces a target that
> will download the vmimages for the architectures that have been
> configured and are available for the currently used distro (Fedora
> 31).
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/Makefile.include | 17 +++++++++++++++--
>   1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index b381387048..78a6f089ff 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -1177,7 +1177,20 @@ $(TESTS_RESULTS_DIR):
>   
>   check-venv: $(TESTS_VENV_DIR)
>   
> -check-acceptance: check-venv $(TESTS_RESULTS_DIR)
> +FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
> +FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
> +FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
> +
> +# download one specific Fedora 31 image
> +get-vmimage-fedora-31-%: $(check-venv)
> +	$(call quiet-command, \
> +             $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
> +             --distro=fedora --distro-version=31 --arch=$*)
> +
> +# download all vm images, according to defined targets
> +get-vmimage: $(patsubst %,get-vmimage-fedora-31-%, $(FEDORA_31_DOWNLOAD))
> +
> +check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vmimage
>   	$(call quiet-command, \
>               $(TESTS_VENV_DIR)/bin/python -m avocado \
>               --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
> @@ -1188,7 +1201,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
>   
>   # Consolidated targets
>   
> -.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
> +.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vmimage
>   check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
>   check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
>   check-block: $(patsubst %,check-%, $(check-block-y))
> 

We have both 'make vm-help' and 'make check-help'. The check-acceptance 
target is in check-help. We get vm image... confusing.

Anyway, can you list this new target, with a hint about the storage size 
required?
Can you add an entry in the 'make


Re: [PATCH v8 3/4] Acceptance tests: add make targets to download images
Posted by Cleber Rosa 6 years, 1 month ago
On Thu, Dec 19, 2019 at 01:16:12AM +0100, Philippe Mathieu-Daudé wrote:
> On 12/19/19 12:24 AM, Cleber Rosa wrote:
> > The newly introduced "boot linux" tests make use of Linux images that
> > are larger than usual, and fall into what Avocado calls "vmimages",
> > and can be referred to by name, version and architecture.
> > 
> > The images can be downloaded automatically during the test. But, to
> > make for more reliable test results, this introduces a target that
> > will download the vmimages for the architectures that have been
> > configured and are available for the currently used distro (Fedora
> > 31).
> > 
> > Signed-off-by: Cleber Rosa <crosa@redhat.com>
> > ---
> >   tests/Makefile.include | 17 +++++++++++++++--
> >   1 file changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/Makefile.include b/tests/Makefile.include
> > index b381387048..78a6f089ff 100644
> > --- a/tests/Makefile.include
> > +++ b/tests/Makefile.include
> > @@ -1177,7 +1177,20 @@ $(TESTS_RESULTS_DIR):
> >   check-venv: $(TESTS_VENV_DIR)
> > -check-acceptance: check-venv $(TESTS_RESULTS_DIR)
> > +FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
> > +FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
> > +FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
> > +
> > +# download one specific Fedora 31 image
> > +get-vmimage-fedora-31-%: $(check-venv)
> > +	$(call quiet-command, \
> > +             $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
> > +             --distro=fedora --distro-version=31 --arch=$*)
> > +
> > +# download all vm images, according to defined targets
> > +get-vmimage: $(patsubst %,get-vmimage-fedora-31-%, $(FEDORA_31_DOWNLOAD))
> > +
> > +check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vmimage
> >   	$(call quiet-command, \
> >               $(TESTS_VENV_DIR)/bin/python -m avocado \
> >               --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
> > @@ -1188,7 +1201,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
> >   # Consolidated targets
> > -.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
> > +.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vmimage
> >   check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
> >   check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
> >   check-block: $(patsubst %,check-%, $(check-block-y))
> > 
> 
> We have both 'make vm-help' and 'make check-help'. The check-acceptance
> target is in check-help. We get vm image... confusing.
>

I know... I had a hard time coming up with a name, and I'm aware it's not
a very good one.

> Anyway, can you list this new target, with a hint about the storage size
> required?

Sure thing, good point.

> Can you add an entry in the 'make
> 

I suspect you mean adding an entry in the 'make check-help' output, right?

- Cleber.
Re: [PATCH v8 3/4] Acceptance tests: add make targets to download images
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
On 12/19/19 1:41 AM, Cleber Rosa wrote:
> On Thu, Dec 19, 2019 at 01:16:12AM +0100, Philippe Mathieu-Daudé wrote:
>> On 12/19/19 12:24 AM, Cleber Rosa wrote:
>>> The newly introduced "boot linux" tests make use of Linux images that
>>> are larger than usual, and fall into what Avocado calls "vmimages",
>>> and can be referred to by name, version and architecture.
>>>
>>> The images can be downloaded automatically during the test. But, to
>>> make for more reliable test results, this introduces a target that
>>> will download the vmimages for the architectures that have been
>>> configured and are available for the currently used distro (Fedora
>>> 31).
>>>
>>> Signed-off-by: Cleber Rosa <crosa@redhat.com>
>>> ---
>>>    tests/Makefile.include | 17 +++++++++++++++--
>>>    1 file changed, 15 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>>> index b381387048..78a6f089ff 100644
>>> --- a/tests/Makefile.include
>>> +++ b/tests/Makefile.include
>>> @@ -1177,7 +1177,20 @@ $(TESTS_RESULTS_DIR):
>>>    check-venv: $(TESTS_VENV_DIR)
>>> -check-acceptance: check-venv $(TESTS_RESULTS_DIR)
>>> +FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
>>> +FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
>>> +FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
>>> +
>>> +# download one specific Fedora 31 image
>>> +get-vmimage-fedora-31-%: $(check-venv)
>>> +	$(call quiet-command, \
>>> +             $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
>>> +             --distro=fedora --distro-version=31 --arch=$*)

Another thing we can do here is check the host has sufficient storage.

>>> +
>>> +# download all vm images, according to defined targets
>>> +get-vmimage: $(patsubst %,get-vmimage-fedora-31-%, $(FEDORA_31_DOWNLOAD))
>>> +
>>> +check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vmimage
>>>    	$(call quiet-command, \
>>>                $(TESTS_VENV_DIR)/bin/python -m avocado \
>>>                --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
>>> @@ -1188,7 +1201,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
>>>    # Consolidated targets
>>> -.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
>>> +.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean get-vmimage
>>>    check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
>>>    check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
>>>    check-block: $(patsubst %,check-%, $(check-block-y))
>>>
>>
>> We have both 'make vm-help' and 'make check-help'. The check-acceptance
>> target is in check-help. We get vm image... confusing.
>>
> 
> I know... I had a hard time coming up with a name, and I'm aware it's not
> a very good one.
> 
>> Anyway, can you list this new target, with a hint about the storage size
>> required?
> 
> Sure thing, good point.
> 
>> Can you add an entry in the 'make
>>
> 
> I suspect you mean adding an entry in the 'make check-help' output, right?

Hehe I'm not sure what happened here. I probably fell asleep on the 
keyboard. Since 'check-acceptance' is listed in 'check-help', this seems 
the best place.

Thanks,

Phil.