From patchwork Thu Dec 22 10:30:32 2022 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: 1718864 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=85.214.62.61; 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=bry2UXiO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4NdCKb4ygLz1ydb for ; Fri, 23 Dec 2022 01:26:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7491E8547B; Thu, 22 Dec 2022 15:24:54 +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="bry2UXiO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D774852B0; Thu, 22 Dec 2022 11:30:58 +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 E035F852AA for ; Thu, 22 Dec 2022 11:30:55 +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=1671705054; 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=nDJn2Y+t0Ps2fUkwy3zSsCSgEXmLVaQYfzkmYV7H11I=; b=bry2UXiOWinZJGF1tOimLN0APi2O5hcFgCWVpJFFEk9YVjcNBKw3P0oS0AwZjMw92Xop8k 1Tk7HiyPQl9683CuxPAh53JiU5m401xleQNmAdaYuU0c28cYn5KuitLIdmIqyb3uWNyXYG g8+v3vi3zu2hoD6NQvhMfcn8BX4RBGo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-551-rqcspPTbNmSq-5aNVhrUJA-1; Thu, 22 Dec 2022 05:30:53 -0500 X-MC-Unique: rqcspPTbNmSq-5aNVhrUJA-1 Received: by mail-wm1-f71.google.com with SMTP id v188-20020a1cacc5000000b003cf76c4ae66so2161768wme.7 for ; Thu, 22 Dec 2022 02:30: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=nDJn2Y+t0Ps2fUkwy3zSsCSgEXmLVaQYfzkmYV7H11I=; b=Crtly7h+xBbTLSvZUlGPr9CXhC5eYLPkoUxNmApQx5XmAybMS5o4lDkuTNaetsdARf Nqw0YZ6JuR/VWLQdUaJVEWsOY9soifxU4QKB49sdwuFR2dBRbOJduQjNMu4g5y3rXlOZ rriMbtzUDG+5TkCL3vAxeXxYAINM4fjv/YhIwSX9ksw/3mLbIf0ffR1s77YmkHAbr6eW uTIjO0YP5zZbeNMjAFIJfvus77tHPIb00ohHGzslpk0JQ/L0Kiy2ctvj+rk9Uubxy3Ya d51rnbAExxhHTXgptzQnc3QMocBKlNEcTG4AhOCoDCHvUW+pvMJWSejZvqL6MOhhjQUw pxiA== X-Gm-Message-State: AFqh2koZPDMgU5BX3WFWWrt+iGjQYJLVDSGO753+assdNBSqx2FFgBPw 2YTWvLba6MYxrysX9TgwryCmaGg8Xc82N4+ZxvW0U5mSu1rbufxXwhBu3SEegJcM1Kq3+CZIRdm ddRMjzxIzIy13+Jz4fy/qQPbeSlZcZh/T4WKr7sUHM8TRGcLaXa+ZeYnZthuR6xDPQg== X-Received: by 2002:a05:600c:4998:b0:3cf:68d3:3047 with SMTP id h24-20020a05600c499800b003cf68d33047mr3782401wmp.41.1671705051775; Thu, 22 Dec 2022 02:30:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXsEDyRDa9EZ8eJHraC+jEvGXhU4Kfkma+le7kucrNiHRibA/DLN7ataTPwacCBUCCTmqC5O7w== X-Received: by 2002:a05:600c:4998:b0:3cf:68d3:3047 with SMTP id h24-20020a05600c499800b003cf68d33047mr3782380wmp.41.1671705051527; Thu, 22 Dec 2022 02:30:51 -0800 (PST) Received: from localhost.localdomain ([109.167.21.147]) by smtp.gmail.com with ESMTPSA id q2-20020a1cf302000000b003d1cc0464a2sm581037wmq.8.2022.12.22.02.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 02:30:51 -0800 (PST) From: Enric Balletbo i Serra X-Google-Original-From: Enric Balletbo i Serra To: u-boot@lists.denx.de Cc: trini@konsulko.com, xypron.glpk@gmx.de, Enric Balletbo i Serra , Philippe Reynes , Simon Glass Subject: [PATCH v2 4/4] test/py: gpt: add test for the gpt partition type GUID identifier Date: Thu, 22 Dec 2022 11:30:32 +0100 Message-Id: <20221222103032.149098-5-eballetbo@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222103032.149098-1-eballetbo@redhat.com> References: <20221222103032.149098-1-eballetbo@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Mailman-Approved-At: Thu, 22 Dec 2022 15:24:36 +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')