summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Bennée2018-04-06 17:23:26 +0200
committerAlex Bennée2018-06-20 21:22:34 +0200
commit50b7273854773a20b7e889a18c8c3c5035441857 (patch)
tree062947ad068f38c2cb877db6d7e569fdf9f6bb58 /tests
parentdocker: extend "cc" command to accept compiler (diff)
downloadqemu-50b7273854773a20b7e889a18c8c3c5035441857.tar.gz
qemu-50b7273854773a20b7e889a18c8c3c5035441857.tar.xz
qemu-50b7273854773a20b7e889a18c8c3c5035441857.zip
docker: allow "cc" command to run in user context
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/docker/docker.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index db1e2537f5..b28ad87034 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -421,6 +421,8 @@ class CcCommand(SubCommand):
help="The docker image in which to run cc")
parser.add_argument("--cc", default="cc",
help="The compiler executable to call")
+ parser.add_argument("--user",
+ help="The user-id to run under")
parser.add_argument("--source-path", "-s", nargs="*", dest="paths",
help="""Extra paths to (ro) mount into container for
reading sources""")
@@ -434,6 +436,8 @@ class CcCommand(SubCommand):
if args.paths:
for p in args.paths:
cmd += ["-v", "%s:%s:ro,z" % (p, p)]
+ if args.user:
+ cmd += ["-u", args.user]
cmd += [args.image, args.cc]
cmd += argv
return Docker().command("run", cmd, args.quiet)