From patchwork Mon Jun 18 13:07:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 138933 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3936155lji; Mon, 18 Jun 2018 06:10:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKsDX8jAWNOGVVweTYEOBtZrY6AT7i+Hjs1BDSeq3XYOl9EpEA/R3nrVKQJmBta2iy7Bcwl X-Received: by 2002:a37:c9d3:: with SMTP id m80-v6mr9821713qkl.173.1529327441616; Mon, 18 Jun 2018 06:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529327441; cv=none; d=google.com; s=arc-20160816; b=H+Leu8MycESY2LrKylTAqjM7bN7BVqAKNvoRpHhpnciJ36bE1ZJUwfDo19GDp8s6Vs 2ZrNLivfLGCWUmXUQjieumoicDAtevbQJydbO0wvgXCSVO5LwanSEmFnNvmCOciuwArn x/onAxtthWslMhiRhCNnDf8Bk8qq/RthhLdbc95EicM9OQla7URBKIO/Krp+ciBgjZhm OGty+P8OnIL7w9imGpMZZe3B7gPWetlcPl1KTgGs4tt8vAwTgwvSOwafiSl+h+JogvtI MNe2uXP734usFyol2sLW1+srgDccEHqRUo9Mf/U2DkK7S6rQFvYRUWDdtZLVzgvRBRfC pcUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=RSP5eqkQNwptuq4lPD33K39JzkY2J7sMdSmKB/i3gy0=; b=rW8tA1cDSDEpk0u23opxchiCT0Cjezpl8iigZRZLx7engIB1rC75CYHSyht+Jz2guo 7E0HAsTbZ0vvRjaghGirKi2G0bno2Qr8GPUCR9UvFaYGtpf1F6ENAGaG7xeI9p1NKW8I AAPp9fk7hMvRpNxpgSLznrvUlfILDSlJADaamMz7c+DT9sQeJRZhtQFetfeCFI/MxBfs D1osx+G/Z5d4ARMUZZ+c09anXhWHgOZuXhuDOvINBIZ4TWsG4I6kJp2vC/xbrfLAEm/O wBymRgFttUS3+K8aXRkFEwNuVc/tb37IN19kzrLlny8AQBPUznEUUnIeRTIhvPmYrwNa zu6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="CPEl4JH/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x188-v6si2225201qke.369.2018.06.18.06.10.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jun 2018 06:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="CPEl4JH/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUtvd-0008VE-1P for patch@linaro.org; Mon, 18 Jun 2018 09:10:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUtsN-0005yH-At for qemu-devel@nongnu.org; Mon, 18 Jun 2018 09:07:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUtsI-0002dp-Id for qemu-devel@nongnu.org; Mon, 18 Jun 2018 09:07:19 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:40713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUtsI-0002dM-Bs for qemu-devel@nongnu.org; Mon, 18 Jun 2018 09:07:14 -0400 Received: by mail-wm0-x243.google.com with SMTP id n5-v6so15434209wmc.5 for ; Mon, 18 Jun 2018 06:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RSP5eqkQNwptuq4lPD33K39JzkY2J7sMdSmKB/i3gy0=; b=CPEl4JH/QX1/3CMZoDivBnph1aGz0yWD7ZqNS+QyCJEz0cTIj6bQbFuOgTB/YXe3Bt wNIOAXdbv1KLNu3YeRComYzbSeRFGwC58ohGwJ6xPWke2gwp82+8TeZkid1/2njJ0Sfg Udg76V2wvYoA6PaD8DBh5dKiWyWAWp0KJGKkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RSP5eqkQNwptuq4lPD33K39JzkY2J7sMdSmKB/i3gy0=; b=l5xbFXVmGedvnOAUXwAhlu3r3wfmDfn5EeXWZM+2OUPWwCMp83VwaIy/d2fKdWY4Mf RdZ0fo8X1Ee9CKhM0v5SRfEGiyOUoSQIns8nOSEiub2RmVhtGaRfulvgEpbpjYacf7eK wuMLvgHpNjWLKCczgjzKBk+DYD1+II+ohIO0rucFIchBWgZfeRJ4MaepEOmfFRFHRuef aLIIu0XGtDr9PJ6LSVv1WrRzgiDC7/btDgiP0QXIrB9vkCuCK+g/8NdH4pLEqFMyKMXH RXG97NXOAgxBdg2GroyRJr8IQhGMQCy8Wp9blQondS/Cmwte5T/NAB9hXwZTrgVrrhtp 5jag== X-Gm-Message-State: APt69E057yl1G+XDrnltgwt/EwMgU3wEHrCIJI9G7h29n8vM/b9iW/Wb 0cyZEtDewIL6w+NhhR89aO0TJw== X-Received: by 2002:a1c:3ac6:: with SMTP id h189-v6mr9424543wma.64.1529327233298; Mon, 18 Jun 2018 06:07:13 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o12-v6sm30214854wrf.30.2018.06.18.06.07.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 06:07:10 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 77B0A3E0634; Mon, 18 Jun 2018 14:07:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: famz@redhat.com, cota@braap.org, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Mon, 18 Jun 2018 14:07:04 +0100 Message-Id: <20180618130709.19730-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618130709.19730-1-alex.bennee@linaro.org> References: <20180618130709.19730-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH v1 3/8] docker: allow "cc" command to run in user context X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/docker/docker.py | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 663dfcba4b..c83fd89985 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -418,6 +418,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""") @@ -431,6 +433,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)