From patchwork Wed May 12 10:20:25 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: 435480 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4689027jao; Wed, 12 May 2021 03:26:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY3Qd548Ba8Jv90KXOeffXQ3fsmDwitWSAwPF9Cxrl0PY/kzeYZD9DPCjXMXWvGw1o77VS X-Received: by 2002:a0c:e643:: with SMTP id c3mr302472qvn.18.1620815168889; Wed, 12 May 2021 03:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620815168; cv=none; d=google.com; s=arc-20160816; b=yHnzsGP0vRzzF3VQJ0TfbDAeMK2VetAcHFB+1q5XygkQZ1CEMtXMJxfsFcVFmPmdyL JUEnNXmp0j2mpd8jrWI2VoKE3BUSzuBKIMPi5tfCC3Qq2JVNLNS5Kl+KdFal4lrDlO7V Q8Zi/XqCfycro+M1zYkN5EWm8RKqjHqNz1JJ3ZnWetJNToNvMDNH4wO11fSSkm/HuAlB FdQI0udsMT8ny+s/z/HNJEA0HsxG3op9kO/nbDeOuoFs9vq15lvcrENpSRelK7vC4MOq PztshOSrSglCm08n1uR2e4GCHEmMcOuqq+jGoPBApibkQ/B95GEfjkJ6lsRBXQzRq0Vq akRg== 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=89FGk/7QSTLsW61jmi4iC132gql+p7Aet7f7N9abrBY=; b=CK8clHfsluX/7LxbdeaJrETCF2tQ3Eybg0aqsQvyy5t7OVLb2n7AT2mV5FgCdOxNL1 agM3zj3PmLf6WjbGoFPZZ2NyGzQkyv0a0N0OTiydaBVtkxRpn+eP6H/L30jRTt/nFzRk EBswkIcA8BLPOamCp0eZF7csQKdDbPudiZ1fQHODvpAp5D3DI1SEXxaZnqqINzMGgpui Sh2QVQRrgNMcsMz4z6DEZVPblGuVb8xR15r65LdU7ruCkXg6Z/KjWiwhHx5BDIr/z1O+ miyaIHTytuJEheKXjEtnWu8YoFpk7L2iX/dUKFV7vasRsFszPxoLl3VQzgFPqVs7HzX3 In7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SLxx1raC; 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 r24si7603571qve.48.2021.05.12.03.26.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 May 2021 03:26:08 -0700 (PDT) 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=SLxx1raC; 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]:46842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgm48-0000f4-58 for patch@linaro.org; Wed, 12 May 2021 06:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lglzD-0003IU-7j for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:03 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lglzB-0003ZX-EQ for qemu-devel@nongnu.org; Wed, 12 May 2021 06:21:02 -0400 Received: by mail-wr1-x432.google.com with SMTP id l14so23047789wrx.5 for ; Wed, 12 May 2021 03:21:00 -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=89FGk/7QSTLsW61jmi4iC132gql+p7Aet7f7N9abrBY=; b=SLxx1raCEuxOAhZ10P6ubKoM1pDlkluS3zc04Ord3kKEnR+Xpg0lU+lHZMDp2RBCUt xNuAK1AZoOerSv8lYbxAwflKfv78CxCqo/jVFFR40WMINDmxW9hUEAuqEaur1eF/9rvA mhfzYcGQv9jvgzz6A9/k/dPUPSRU2gYvMN57B3h0rrjSFRsfDzaDNf0Vnni2UMuf2G5c /+TgVtdVj2wSOIE/AjHPUNk0V9Z8YmcVVOsMda2AXksWb7ONCMsU5yMvhfmn+h7Bfqur rshwGu5GncD7gdGaxT8gEJxNswMvAGYcTKJk6hX5oXKTO98THNvUxQi0cy+rbKpKvId0 FXlA== 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=89FGk/7QSTLsW61jmi4iC132gql+p7Aet7f7N9abrBY=; b=Nyc3oZe3GidjYzoR9qCkciCdxC41mUw72L3h1/cyKn9xRxv/l3+vDa1zZHm+8UIig6 D8vsek8jCEahts2RbhGFMfj0uRCsl2TQTOGpk+nGLWjpLVbzkqrkf7SHJfeut0H78VUv NBUHo6OG9HO06ArN5oais4C4i0xwErndMNb/lIZtJHkhM77ZLmxAAlmvSdsifz2hMspc SV1SE7gzzNHt7aScxRTZHXgno2UJ4J1nCwC6msrIjDL8rXErSPI/Vjj45QIl9Mh4O8lu HklC9eJlGahUwzA0xkT8yrG2DbeL3xF8/iTN+Yy2neTPhrVfsej1jIHKmL+dNAnxAO4X k+/w== X-Gm-Message-State: AOAM532t3Nf3RFf5YsO9F364YL6EFF/knLYllZKvVSuG6JYlCW4xuLW2 hiLG5NyyAwf7lyJj67l1GaC4AA== X-Received: by 2002:adf:f508:: with SMTP id q8mr44711320wro.109.1620814860117; Wed, 12 May 2021 03:21:00 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h14sm34573244wrq.45.2021.05.12.03.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:20:58 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 95E4C1FF91; Wed, 12 May 2021 11:20:51 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 05/31] tests/docker: add "fetch" sub-command Date: Wed, 12 May 2021 11:20:25 +0100 Message-Id: <20210512102051.12134-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512102051.12134-1-alex.bennee@linaro.org> References: <20210512102051.12134-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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, Thomas Huth , berrange@redhat.com, f4bug@amsat.org, Wainer dos Santos Moschetta , Willian Rampazzo , 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. Reviewed-by: Willian Rampazzo Signed-off-by: Alex Bennée --- tests/docker/docker.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.20.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 7a14058801..4d9bb7c7ed 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: """