Fam Zheng <f...@redhat.com> writes:

> Image building targets are dependencies of test running targets, so when
> a docker image doesn't exist, it means it's skipped (due to dependency
> checks in pre script). Therefore, skip the test too.
>
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
>  tests/docker/Makefile.include | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index c5546ee..2bb8a51 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -105,7 +105,9 @@ docker-run-%: docker-qemu-src
>       fi
>       $(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
>               $(call quiet-command,\
> -                     $(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
> +                     if sudo docker images --format={{.Repository}}:{{.Tag}} 
> | \
> +                                     grep -qx qemu:$(IMAGE); then \
> +                             $(SRC_PATH)/tests/docker/docker.py run
> $(if $V,,--rm) \

The sudo belongs in the docker.py script

>                               -t \
>                               $(if $(DEBUG),-i,--net=none) \
>                               -e TARGET_LIST=$(TARGET_LIST) \
> @@ -117,6 +119,7 @@ docker-run-%: docker-qemu-src
>                               qemu:$(IMAGE) \
>                               /var/tmp/qemu/run \
>                               $(CMD); \
> +                     fi \
>                       , "  RUN $(CMD) in $(IMAGE)")))
>
>  docker-clean:


--
Alex Bennée

Reply via email to