From patchwork Mon May 17 16:09:57 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: 440150 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1234710jac; Mon, 17 May 2021 09:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3vLK26a9T2BUwWqdZvGjOjXyE+Cab4oeiruFc3KlaOdRw5S5/pTbcQXZchOdcd8RLmXgM X-Received: by 2002:a05:6e02:ed2:: with SMTP id i18mr443028ilk.22.1621268357495; Mon, 17 May 2021 09:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621268357; cv=none; d=google.com; s=arc-20160816; b=KFgq95uNL5UqiLVrmrrb3l8NVjkJ4Cgn8jvwpipDhf3c9VuFfxsaQ/XevrHM2lYAkm I58Ng8u03VmLH5V6fdLQgARPszSuRfAmLJXXP/14lHPHxZAH6/RQnRAsewtEF3/bsT0F buulFuni80KfVvE1K+qmbIUzt32AR/2mH7rd59E4PmU1I68Tr6nZAdRyzBseSvRAIjES A63HU/jyzT+R5kxxrN/NExnLQ8sBIJ2DkuWrZHMzg2QYlzJ7bsWJlo9V9QeSRllu3riT RCFlH6S6Ngt/YY+6boodcI2WgbB9oz4lr5ctI9ozIcGUV4GQ4nJ3DlgoXzAIeU/ZK5+b pYQw== 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=uUMKiPKMAS7O1QKMD26oNu3/VNnJ7Kibrl6YvpCZrWU=; b=khck66OHF6iRAXz4xOlA6DD2a0OpiZCWj/8RXPzMO7QYMphOkKtTFOO7ia3BbmKbvB oXqZwQyc7ErVGW+xOVmr9kVQhWj+HWQevB14rDBAF2nLQHyx4OidwnkVlC391vuw13I7 SGy81ILddMGlxIB6hxZzf4FwY8nVUz8DFpSxuebawc0SFKWbD8Gm/sefnakjzRj45PCm UjYhyn6LhT/v/4mQIq6y9E8tyHrVhoHO+bka8oEj2gKmRFtQJ2fH//ErAXkw4PTYxB1M 76yl3n0hYuXnOVN+bwEs/39gAGoyi3JQ9O5fmDGFKruknm1pRwkEiSLYliAIlDuZioLB KCXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JAx6hmmR; 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 b12si5063344iob.37.2021.05.17.09.19.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 09:19:17 -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=JAx6hmmR; 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]:55024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lifxc-0006Yt-TR for patch@linaro.org; Mon, 17 May 2021 12:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lifpB-0007NQ-NY for qemu-devel@nongnu.org; Mon, 17 May 2021 12:10:34 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:45770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lifp9-0005yE-If for qemu-devel@nongnu.org; Mon, 17 May 2021 12:10:33 -0400 Received: by mail-wr1-x42a.google.com with SMTP id h4so6982606wrt.12 for ; Mon, 17 May 2021 09:10:31 -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=uUMKiPKMAS7O1QKMD26oNu3/VNnJ7Kibrl6YvpCZrWU=; b=JAx6hmmRmYi4Gg34VzXPFAKHVTHLMKGhQaB8C7EbsSTOrVqrwXzBe1zQsCT8gyIhH4 boWYo020crllYJPBfyIFejhnjUCgVRxukKE/AiRba+yam+VaQLwhrEb8bFxlGtmDLtrR RbgNRrgfZcc8uDHoLAxzdq910O5kwYqMaUcMSwtpYVPdC7prW4cIRAiKy6YoTroxjRDI 3WB6Vaw0LcRpdU1qzr+6Ag/xLx5rcssnYGVna94W32rFTVcblSqO58ExaQjrlXILpIqe jU1eZILtcPBY1MRaRiCD+pefm2TuJjeGN5V4xL9ZPSCCjeVDppyCmeFkPcq0zaSeCdbv veJg== 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=uUMKiPKMAS7O1QKMD26oNu3/VNnJ7Kibrl6YvpCZrWU=; b=CSlmSzPiInSh9XzPR2xh3Z7z7Q6NqyHZFWydIMpQwIbd+ToDWmYxxUI3MPYXto5Rz0 xLOAaFyGxLleknVvB38Fz4cSmh09aP6WxwfsJmoKFEGlEwhKEvVd2xTNjCL6ur1tZsLm O4GieY6FOJPbjzE4n+ke+4Hb5c/KVMPc75qno3VTa+pPBOEdFpuhYqBIyE6vIwJnrKTD FX11kcJDa3yYG8iofUcfr5wx2vc8KqUvjqYq9qsQYXDgoRqFyQW9lqH6Oi1922jO5c06 Katu60eOF0muZ5Apa3vJAvLw7luF/cSsjiaD/0z3v4RgMs921zcG5NGpECH5fbt4zQrw viVA== X-Gm-Message-State: AOAM5306WEO1HafE/8ASzmyGs20sjriuUiYPf0HEZoYrSzOg81XJYk6l 7gDJFgDNxlkUmv1sTLnm/mPFVw== X-Received: by 2002:a5d:64e5:: with SMTP id g5mr557215wri.30.1621267830225; Mon, 17 May 2021 09:10:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f7sm14896092wmq.30.2021.05.17.09.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 09:10:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 65E1C1FF90; Mon, 17 May 2021 17:10:23 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/29] tests/docker: add "fetch" sub-command Date: Mon, 17 May 2021 17:09:57 +0100 Message-Id: <20210517161022.13984-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210517161022.13984-1-alex.bennee@linaro.org> References: <20210517161022.13984-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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: Thomas Huth , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= 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 Reviewed-by: Willian Rampazzo Message-Id: <20210512102051.12134-6-alex.bennee@linaro.org> -- 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: """