From patchwork Tue May 18 09:06:55 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: 1480104 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=UAzAkxue; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FkqxZ5Mh2z9sVt for ; Tue, 18 May 2021 19:11:30 +1000 (AEST) Received: from localhost ([::1]:40504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1livlA-00051P-NU for incoming@patchwork.ozlabs.org; Tue, 18 May 2021 05:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1livhL-0007tG-NJ for qemu-devel@nongnu.org; Tue, 18 May 2021 05:07:31 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:46674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1livhJ-0005Rx-KC for qemu-devel@nongnu.org; Tue, 18 May 2021 05:07:31 -0400 Received: by mail-wr1-x434.google.com with SMTP id y14so7241191wrm.13 for ; Tue, 18 May 2021 02:07:29 -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=iLkCUVtUulJ2g8D+2QnEZXZOurs4a/57hc6xJ37hdkM=; b=UAzAkxueHkNZvp4be7rfU4M1J81KAF0ullEP49AAgibsoS4tbdC6yPmtQcaVoVANx3 fHV1cT8hecGsYwo64Y75itJjzQT/FOfF5Xvw3vX1kzyty4rrw/vDGeHSEd7AVpoUFuQK 3+8gtWUlaJfEGX8JynPcsADr96ApeV8YZTtyiXpJcIzHqWI97YrE6L+mQvG3yhqGAwdo bmpVRbagl7Ec1DGna1SFq55O+fOr9wb2MuAOzQRZYnoyicRiI+aA7zskpWbmASrT5SpF vlodJFwz6vaAe3SErODqy0LJHgS6vpL28VAxDzU7FoA5WbggEuasrpl2Ud4Fp0MELBUZ ORPA== 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=iLkCUVtUulJ2g8D+2QnEZXZOurs4a/57hc6xJ37hdkM=; b=Fye74MptOhrRbLbcnTfyfJFnNZFRrjyjox7hrS7c42VbOXHQcZxypD31GEWcsTV5jm YZpiAG8LGyfsULzwyAPksz7SyFnd4QebtHJ2dqGgtu/bYTXiZkdJk2vSQI9nD/8HPZDT 5jRCe3jUBa8qKpGgsKcnFWpZxm9Fm00nYrz8CIjp43v24luWHhYMtQgXDNGjfWv6eLhT RgM2uU6qrgqPK9On0EBz1m5b5JqgdsHhCpCk+7kggK1YNLwthCuc1qPkOhjGDWKY1pc8 tWMm70J6esvCMH/yMp4IH7is/kBXHuQD/uOIBvr29Fi53OKnQ7PvJdesPxdjwGvWlAxM jdCQ== X-Gm-Message-State: AOAM533e7csE3WRVvDr3HJake2bUwfyVUDUf/02wGfDjUImyKLaia7bh L2yjt9llQRKO8oNMvPpP5S6lig== X-Google-Smtp-Source: ABdhPJyfvoul09JAMghtRiMbs3hD49PZoOMfEmu/SzpVXE+SslKfNsEBfyBWR5Tbht+E2snxGrCpog== X-Received: by 2002:adf:ee0c:: with SMTP id y12mr5526772wrn.335.1621328848122; Tue, 18 May 2021 02:07:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x16sm20442417wrp.6.2021.05.18.02.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 02:07:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5070C1FF90; Tue, 18 May 2021 10:07:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 04/29] tests/docker: add "fetch" sub-command Date: Tue, 18 May 2021 10:06:55 +0100 Message-Id: <20210518090720.21915-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210518090720.21915-1-alex.bennee@linaro.org> References: <20210518090720.21915-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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 Message-Id: <20210512102051.12134-6-alex.bennee@linaro.org> 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: """