On 07/13/2018 09:17 AM, Alex Bennée wrote:
> When a check fails we currently just report why we failed. This is not
> totally helpful to people who want to boot-strap a new image. Add a
> --hint option which we can pass down to give a bit more information.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> tests/docker/Makefile.include | 3 ++-
> tests/docker/docker.py | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index ec23620153..c9e412f9d0 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -73,7 +73,8 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
> $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \
> "BUILD","binfmt debian-$* (debootstrapped)"), \
> $(call quiet-command, \
> - $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $<, \
> + $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $< \
> + --hint "you will need to build $(EXECUTABLE)", \
> "CHECK", "debian-$* exists"))
>
> endif
> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
> index 2f81c6b13b..523f4b95a2 100755
> --- a/tests/docker/docker.py
> +++ b/tests/docker/docker.py
> @@ -475,6 +475,7 @@ class CheckCommand(SubCommand):
> default="checksum", help="check type")
> parser.add_argument("--olderthan", default=60, type=int,
> help="number of minutes")
> + parser.add_argument("--hint", default="", help="hint to user")
>
> def run(self, args, argv):
> tag = args.tag
> @@ -487,7 +488,7 @@ class CheckCommand(SubCommand):
>
> info = dkr.inspect_tag(tag)
> if info is None:
> - print("Image does not exist")
> + print("Image does not exist %s" % (args.hint))
> return 1
>
> if args.checktype == "checksum":
>