tests/docker: add a docker-exec-copy-test

This provides test machinery for checking the QEMU copying logic works
properly. It takes considerably less time to run than starting a
debootstrap only for it to fail later. I considered adding a remove
command to docker.py but figured that might be gold plating given the
relative size of the containers compared to the ones with actual stuff
in them.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210202134001.25738-7-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée
2021-02-02 13:39:51 +00:00
parent 6147c2495d
commit ddd5ed8331
3 changed files with 33 additions and 2 deletions

View File

@ -438,6 +438,9 @@ class BuildCommand(SubCommand):
help="""Specify a binary that will be copied to the
container together with all its dependent
libraries""")
parser.add_argument("--skip-binfmt",
action="store_true",
help="""Skip binfmt entry check (used for testing)""")
parser.add_argument("--extra-files", nargs='*',
help="""Specify files that will be copied in the
Docker image, fulfilling the ADD directive from the
@ -466,7 +469,9 @@ class BuildCommand(SubCommand):
docker_dir = tempfile.mkdtemp(prefix="docker_build")
# Validate binfmt_misc will work
if args.include_executable:
if args.skip_binfmt:
qpath = args.include_executable
elif args.include_executable:
qpath, enabled = _check_binfmt_misc(args.include_executable)
if not enabled:
return 1