From patchwork Wed Mar 10 19:23:28 2021 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: 396776 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp602474ejz; Wed, 10 Mar 2021 11:27:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsAzzoBbP4w/qvhZ2Kri20Zrr0ghB0WfPm2QM1XWgta8q/HJ6zj32ROroLCwzskisyYO9Z X-Received: by 2002:a37:4d86:: with SMTP id a128mr4192612qkb.115.1615404447389; Wed, 10 Mar 2021 11:27:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615404447; cv=none; d=google.com; s=arc-20160816; b=Cb80TW1mI2eOa59PXNdysFyiykQa2m2UbEXrfVBYRafKwlFwwMCNpF7V0+Eom9pVHC FGWK55JiCAhDDqg9HcgvNLQWaS/ifNunbqqmiEmsxwAgOsyKRzMIrUDkZ2X9ZxF6sB5P oJj9PxOBlgQECwugkUziTuRCxAo7YpcX6kG2YR+FlveX9RLTTUuGx0j2Y5V5chYlvhNk xC/EeEg2w+oOT65ApUwtGQ+80bduSY6ZwVhHsAvkk7h9EHP/0KGY2iJX1tgGTm84T1WZ ugkoH2aQiXOz2p4ipPFxasdztrZJhV7UW+7tPHuQazI81iqnoe/OK3ZjuXGgMLcg91SV xccw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KGrYzIufJSpHy5l9wMOv7nypCu9GhpL0NWYqpZ6BI7Q=; b=HiBR3wHMEM+6emZDlKjyNKSMAoujq4RhsOVNEIUfu2SAL7Iq5UCgZNJpQbtbsY2V1M ZkLxon8LS8WwgK+0jL7OJTed6XL77xvgmSXSC+gVPPVzbM84VgM1JQRxVLR4uq7Xyw6B knwFJc86t4KlNWqf7NL8NsuKZ5G2K3dbyvaTzWev/uMq1m8Bc3naiAMZfv+owmXYuIB2 OZMx/WkPbykNNwTTjwmqlIzAi9usxh9fmG2SyAa6YuVLj60E2KbZkgi1r7+sJ0wlmYfn j0PdFabwKucX5XvYx5sJFy/4fbQPR5J3GVwCxXWRDD7tNVaYE+xp+Q4wvYOqwqLs5JlU 8CQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WhfDZF7p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id o6si240662qtl.62.2021.03.10.11.27.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Mar 2021 11:27:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WhfDZF7p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:46194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK4UQ-0006Kc-MY for patch@linaro.org; Wed, 10 Mar 2021 14:27:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK4Qq-00065H-2j for qemu-devel@nongnu.org; Wed, 10 Mar 2021 14:23:44 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:33597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lK4Qm-0002kC-Bb for qemu-devel@nongnu.org; Wed, 10 Mar 2021 14:23:43 -0500 Received: by mail-ej1-x62c.google.com with SMTP id jt13so41079163ejb.0 for ; Wed, 10 Mar 2021 11:23:39 -0800 (PST) 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=KGrYzIufJSpHy5l9wMOv7nypCu9GhpL0NWYqpZ6BI7Q=; b=WhfDZF7poRcYiWTUNS4HZa2X96XW+LlxhDi1zgIDRryQt+i6M45oOXoVMayUKdv3AA gv1/ed1n0EfzuW7QeXq8qm1dF1TOVuNYNNuyxbh01GHNHiFEkr9BtvRjh2z8FaGQJpFo Eh6szjbI+thgGUgTDXqBh4FQnZlVaamhRibDN54dm+jaUBbQEhJEKevFPdOv8g7lft7j 9GTwfJJZPe9rj2EOq7TZbZgTLEPHHzSDoO5VOi9RiL5xdZaZAFxE/7XMCe3S3l0Zz3jT 3nusQRmBeQz6n/s+IKLUpCCJMonXrfZA/lhmQ/rAzCKRreLl5nrqCPb1pmlhHUwpo6EO F8zg== 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=KGrYzIufJSpHy5l9wMOv7nypCu9GhpL0NWYqpZ6BI7Q=; b=JBdkNOjg/iGr1PpeDt2bAaBQFCn2k42YUojWlJh5TZhEvEUGRXfN1yzqMvvZs5tczB Yo5jXaupcWUvSfE0M/4z8MdwHXhhyAit2nnoOmBhgCJVQetQB78WPe+90PPNo51GWwVE yRCNA+sdCJ07hAuMQlWBrgXZ9el0L29FWLTf0mOXOgm4u3K669jnJ7/nW2xlKhAcLYYG 5Y9cObx0Nd91DDkxlaAllgsRIOHqWUbQbLJFDc7gkWZo3YL01M+Nru0+vjrtMVYslyCH R8KcCd6jRHzQaeoDQ1mNxHq72aWtGRuQOkSTl9oqPE351i452XXL0kCaUyBoh5G1KZFo om4Q== X-Gm-Message-State: AOAM532MhbiXK4QP+tpxulfbPRmsT3FM0PHVJty7uD8h0WHDiwO6b4y1 DL96kH1zKDe31Try9qYzjKubjXRW24n2uQ== X-Received: by 2002:a17:906:18aa:: with SMTP id c10mr25632ejf.248.1615404219070; Wed, 10 Mar 2021 11:23:39 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e22sm95477edu.61.2021.03.10.11.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 11:23:36 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3FA6E1FF90; Wed, 10 Mar 2021 19:23:32 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 4/7] tests/docker: add "fetch" sub-command Date: Wed, 10 Mar 2021 19:23:28 +0000 Message-Id: <20210310192331.29284-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310192331.29284-1-alex.bennee@linaro.org> References: <20210310192331.29284-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This simply wraps up fetching a build from the registry and tagging it as the local build. Signed-off-by: Alex Bennée --- tests/docker/docker.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 86d31a5fe6..f6f461bbc9 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -515,6 +515,23 @@ def run(self, args, argv): return 0 +class FetchCommand(SubCommand): + """ Fetch a docker image from the registry. Args: """ + name = "fetch" + + def args(self, parser): + parser.add_argument("tag", + help="Local tag for image") + parser.add_argument("registry", + help="Docker registry") + + def run(self, args, argv): + dkr = Docker() + dkr.command(cmd="pull", quiet=args.quiet, + argv=["%s/%s" % (args.registry, args.tag)]) + dkr.command(cmd="tag", quiet=args.quiet, + argv=["%s/%s" % (args.registry, args.tag), args.tag]) + class UpdateCommand(SubCommand): """ Update a docker image. Args: """