From patchwork Tue Jan 10 16:19:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 1724182 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SKNngl3H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nrx3j1yBpz23gB for ; Wed, 11 Jan 2023 03:24:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDF31856AD; Tue, 10 Jan 2023 17:21:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="SKNngl3H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B96308551C; Tue, 10 Jan 2023 17:20:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3184F85568 for ; Tue, 10 Jan 2023 17:19:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eballetb@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673367594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2g8FgAIFx9/3j72zCgOmOeXUKWTrcmP36EOph5VN+GE=; b=SKNngl3H9D3gssqN/4uYcFd7p/WaE6fZiuCPkJ1Wmm46YMIWrHhZ07uvVPMm6YpZ5Z+9Gf Prz1Z+tFPq1NOD6pIgtdjnj3ifipNqfiYIeEeB4oT7IWn4FclN6qXedtZ5BbXF6jyzBKw4 TpfJKkQpeAF4jeKAZwq6R3ItuopQKag= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-57-Jd1tDFC5MvaC_pq_VxEezA-1; Tue, 10 Jan 2023 11:19:53 -0500 X-MC-Unique: Jd1tDFC5MvaC_pq_VxEezA-1 Received: by mail-wr1-f69.google.com with SMTP id q3-20020adfab03000000b002b32e25058dso2140610wrc.5 for ; Tue, 10 Jan 2023 08:19:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2g8FgAIFx9/3j72zCgOmOeXUKWTrcmP36EOph5VN+GE=; b=O9LJjdRf9tNhmb/kWK1m81ntCc3qR2PnlgdOqj5CaIYA/+Fh7QTwajIcHVFoRJf7dr ozrIw2CaB7d22Hg6YI1kIZWeg1/JbVUpsfvJoDaxIKejYLNRrNBojL8sACI9EsgJUkhN 7P3cUYbSUPAPmEMUQ91rjhtiWe30W/PB6ozXhcHFSx136RMM9W686JKTVHjG6CYfXdgd jykEpuKyLXD6PAlLBdvmsEa5iLbl38eLw0jCn79+hhQ+RT85/VCTM1Q5RDWrEEIIHIaN Q8Z/m3sax6SnY3fdltlmXSBDYxqzLuIEzrckjcixbFAPTcvxtAMRlPZMNLMLhZcbzmf3 hzkg== X-Gm-Message-State: AFqh2krnMmIlkQ82cHSL66BgVW80ZKbLWGwlLFef5XGDv/86gEnloKJN Ni5nOTjO+VQuTJ9VZuorcg5PzZz5OhFuzKBSFPXCVth3BBcMQpN+wT1ZDi2YEJ5ht2BuT7EShIx jHe+yieeenZT+CeDlhj589frGLVUzCqEqFlnPsF8GewJ1O2wIwC35/OHnvZG7AEAIRA== X-Received: by 2002:adf:fc85:0:b0:27f:effe:977 with SMTP id g5-20020adffc85000000b0027feffe0977mr32254490wrr.38.1673367591870; Tue, 10 Jan 2023 08:19:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXv6ep/rEuQUhSn4UwCf2rTD4XHD/MwEH1PXU2bIHwJjQ0oOSPTVaB6TwndEZn0uX7YrmVERyw== X-Received: by 2002:adf:fc85:0:b0:27f:effe:977 with SMTP id g5-20020adffc85000000b0027feffe0977mr32254472wrr.38.1673367591635; Tue, 10 Jan 2023 08:19:51 -0800 (PST) Received: from fedora.. (215.red-79-157-73.dynamicip.rima-tde.net. [79.157.73.215]) by smtp.gmail.com with ESMTPSA id m1-20020a5d6241000000b002bbdaf21744sm8669803wrv.113.2023.01.10.08.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:51 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: xypron.glpk@gmx.de, trini@konsulko.com, Enric Balletbo i Serra , Philippe Reynes , Simon Glass Subject: [PATCH v3 4/4] test/py: gpt: add test for the gpt partition type GUID identifier Date: Tue, 10 Jan 2023 17:19:35 +0100 Message-Id: <20230110161936.526455-5-eballetbo@redhat.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110161936.526455-1-eballetbo@redhat.com> References: <20230110161936.526455-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Tue, 10 Jan 2023 17:21:21 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add sandbox test for the gpt partition type command, the test uses the persistent data test_gpt_disk_image.bin to check that the first partition type GUID that identifies the type of the partition has the "Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ). Signed-off-by: Enric Balletbo i Serra --- (no changes since v1) test/py/tests/test_gpt.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py index cb44e1d789..73bfbf77a2 100644 --- a/test/py/tests/test_gpt.py +++ b/test/py/tests/test_gpt.py @@ -134,6 +134,29 @@ def test_gpt_save_guid(state_disk_image, u_boot_console): output = u_boot_console.run_command('printenv newguid') assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpt') +@pytest.mark.requiredtool('sgdisk') +def test_gpt_part_type_uuid(state_disk_image, u_boot_console): + """Test the gpt partittion type UUID command.""" + + u_boot_console.run_command('host bind 0 ' + state_disk_image.path) + output = u_boot_console.run_command('part type host 0:1') + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpt') +@pytest.mark.requiredtool('sgdisk') +def test_gpt_part_type_save_uuid(state_disk_image, u_boot_console): + """Test the gpt partittion type to save UUID into a string.""" + + if u_boot_console.config.buildconfig.get('config_cmd_gpt', 'n') != 'y': + pytest.skip('gpt command not supported') + u_boot_console.run_command('host bind 0 ' + state_disk_image.path) + output = u_boot_console.run_command('part type host 0:1 newguid') + output = u_boot_console.run_command('printenv newguid') + assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output + @pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec('cmd_gpt') @pytest.mark.buildconfigspec('cmd_gpt_rename')