From patchwork Thu Jul 4 14:43:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 809961 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1202495wru; Thu, 4 Jul 2024 07:43:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWGMiQiuHRYg2gKgzgRPhG2zIQ8yzWcQAHiHmmsdyC2SMqE8hI707kUInAzy91thNIWNCyX2OclTyBLu6cb2l2d X-Google-Smtp-Source: AGHT+IGkRSsWzantA/wpkhrq13QaViojgi8HNiiE8a0fUo0wNSNskX0lro2XU/VYOsMZS/qfzcTx X-Received: by 2002:a19:ca13:0:b0:52e:9423:867f with SMTP id 2adb3069b0e04-52ea063a4fdmr1403171e87.36.1720104207098; Thu, 04 Jul 2024 07:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720104207; cv=none; d=google.com; s=arc-20160816; b=AW7Y0XlHMeVu9kN7SqhLMUCLd5lpcEjA51Dv/Yitk/+mDOLA5HFcxFUfJl+AkKSqlV n49tNwaAszIPRevkYGUWqIAmxnbuqdatYcbqC+dr1C65pgdzWDv2CSb4kqczCH/AK8gH wR10apLvpLwmfgc9HilbFRSpA74RANqlNqG2mTrkED2dhc56DkSpe5Z4TM+EyqVuwfRm oFdheNbZ4ZBRLyp3sufDkR+s39hkB8aPycOI7mKZ5EuEdeJfGyQb7aTjniwMl7W1RKir GlkmuqxH+35gy9u0X5C6wqG+Ni7Ae4RIPBXhHHFigD7qDJR7NqvIvybb2KVSmmLpummu 5Iqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=rMXBoBsBa5mrNSPlxlX1unK3g8soUkrm3vzpEwKw36c=; fh=/JeJsCxW6lsweE3/hONtS51yWvA9r6mBB57kx6ISPko=; b=tfwR84dCKat5+Wot5BschX6F+Li0I4kcgahIvw2kTmiJCXNUGAZzREWfWwUElYlDBJ NaUfEuqIXNswvScwaHjjT8Crg+37SANScTKujUpgcOOsb0b9VU5w4RIPSK0g5X3zhHvm aAm/oxr06M9xHlj77Y1HcgWHafkKvNvkApDVDT5Pir2/mL6tZ4dbYmg3Kf/zZYfShhBE D6sEfwRjhkG9v1Vdj+Hcic/eFx+79qhWqSXc457pUYKaRELcwp3pqow4RjyQEGjboD9y rz7smKQDEFNAVGVL6tLgmmm5nJcLe5epbgqRPCy5ccKlex8/L+96l+bsOlCWnH25ZX1W VIBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chcU44DT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a72ab0676ffsi668273366b.494.2024.07.04.07.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 07:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chcU44DT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F84888669; Thu, 4 Jul 2024 16:43:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="chcU44DT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0E95885D7; Thu, 4 Jul 2024 16:43:23 +0200 (CEST) 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 AB2AB888EC for ; Thu, 4 Jul 2024 16:43:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-52e9f863c46so725750e87.1 for ; Thu, 04 Jul 2024 07:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720104201; x=1720709001; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rMXBoBsBa5mrNSPlxlX1unK3g8soUkrm3vzpEwKw36c=; b=chcU44DTe2wSVcCspGqSlqbX5ZK95kRkwVsjaDKxCOFifCzgKjfmxfiuR31a2We0Jk trDtuAicSKf2x8RkF+AS0mUw2D+JRpB4TZbewU6Z+cg5OUpjd/75sZhPYZ+AAho6Rf+r uCRBrYV6NPkPxkqM+Cjzb6orJvfEX2dkERM/k+jchbullM+SPvEkr7Qn9UstV0vTEbbg 2WHoJ3yL/RmJCjZLnoK3JSMzMwHqUDsd4x9fCPuMKOFLpDlJxeXLaEYuXvR/eDwSZknH F4Tc4L5p/n/eBpodw6+Sj2a4fbmekNpaY4Qd5ZBF9XYQmawRXmVwFXTKsgPDNwFAXwiH q2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720104201; x=1720709001; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rMXBoBsBa5mrNSPlxlX1unK3g8soUkrm3vzpEwKw36c=; b=ipuc2IUTFvHRQ5aumoxU5r9UevHli/gbQhKOUVrs6ReytdkI3klqVzB2pqplYeaQNj BPOyxEbj0+IOFR1BQ2cZYHM1c9M922SYQa6hFVGIXY5LQsIlhfzH5TBw2ECkXZ82lqa4 bxivqxtHnComiSFoboLWh6Ra3E51fVVn2k6WSdmGfka+YCZsq/Xv/Z6mRuTO8IJNApWo PnKszHKwZkF396/qqzLXNnjmNVZ4sVGegih4bIzVdIT3FwLGfrHZsrsVfq5FSOdgLC5L FsiFaPOi5pkJSZo6qEt/wU+qGb6JqjbWOQwg2jS3K0weLdmpQ0qWZpxTwsLJeOEpls3u ALJg== X-Gm-Message-State: AOJu0YwXSGrpUjxFQPD/vyrUIAzF/Dnt54SGK8CKzAvlu4OX6PreDqx1 TTlyTo+T2ygJKkO2bx6cRCFVbJDZcNwdvu52A/jorKQfjutFmSkcCDN8C25hedM= X-Received: by 2002:a05:6512:3618:b0:52e:9d2c:1c81 with SMTP id 2adb3069b0e04-52ea06185eamr1275094e87.13.1720104199659; Thu, 04 Jul 2024 07:43:19 -0700 (PDT) Received: from hades.. (ppp046103011142.access.hol.gr. [46.103.11.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4264a1d0bd6sm27420905e9.8.2024.07.04.07.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 07:43:19 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: u-boot@lists.denx.de, Ilias Apalodimas Subject: [PATCH v2] test: test for ignore OsIndications Date: Thu, 4 Jul 2024 17:43:16 +0300 Message-ID: <20240704144316.251029-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The tests we currently have expect the firmware update to fail when OsIndications is not set properly. However, we have a Kconfig flag that explicitly ignores that variable. Adjust the tests accordingly Signed-off-by: Ilias Apalodimas --- Changes since v1: - v1 was rebased incorrectly and only sent half of the patch .../test_capsule_firmware_raw.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) -- 2.43.0 diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py index a5b5c8a3853a..f3a2dff5c2c8 100644 --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_raw.py @@ -76,7 +76,7 @@ class TestEfiCapsuleFirmwareRaw: self, u_boot_config, u_boot_console, efi_capsule_data): """ Test Case 2 Update U-Boot and U-Boot environment on SPI Flash but with OsIndications unset - No update should happen + No update should happen unless CONFIG_EFI_IGNORE_OSINDICATIONS is set 0x100000-0x150000: U-Boot binary (but dummy) 0x150000-0x200000: U-Boot environment (but dummy) """ @@ -91,16 +91,27 @@ class TestEfiCapsuleFirmwareRaw: # reboot u_boot_console.restart_uboot() + ignore_os_indications = u_boot_config.buildconfig.get( + 'config_efi_ignore_osindications') + need_reboot = True if ignore_os_indications else False + + capsule_auth = u_boot_config.buildconfig.get( + 'config_efi_capsule_authenticate') + capsule_early = u_boot_config.buildconfig.get( 'config_efi_capsule_on_disk_early') with u_boot_console.log.section('Test Case 2-b, after reboot'): if not capsule_early: - exec_manual_update(u_boot_console, disk_img, capsule_files, False) + exec_manual_update(u_boot_console, disk_img, capsule_files, need_reboot) - check_file_exist(u_boot_console, disk_img, capsule_files) + if not ignore_os_indications: + check_file_exist(u_boot_console, disk_img, capsule_files) - verify_content(u_boot_console, '100000', 'u-boot:Old') - verify_content(u_boot_console, '150000', 'u-boot-env:Old') + expected = 'u-boot:New' if (ignore_os_indications and not capsule_auth) else 'u-boot:Old' + verify_content(u_boot_console, '100000', expected) + + expected = 'u-boot-env:New' if (ignore_os_indications and not capsule_auth) else 'u-boot-env:Old' + verify_content(u_boot_console, '150000', expected) def test_efi_capsule_fw3( self, u_boot_config, u_boot_console, efi_capsule_data):