diff mbox series

[v4,10/49] docker: allow "cc" command to run in user context

Message ID 20180517174718.10107-11-alex.bennee@linaro.org
State Superseded
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée May 17, 2018, 5:46 p.m. UTC
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>

---
 tests/docker/docker.py | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.0
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 59bce9f19a..37bfa98005 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -417,6 +417,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""")
@@ -430,6 +432,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)