* [PATCH] efi: test/py: repair authenticated capsules tests
@ 2022-06-27 10:23 Vincent Stehlé
2022-06-27 10:46 ` Heinrich Schuchardt
0 siblings, 1 reply; 4+ messages in thread
From: Vincent Stehlé @ 2022-06-27 10:23 UTC (permalink / raw)
To: u-boot; +Cc: Vincent Stehlé, Heinrich Schuchardt
The UEFI console initialisation has been modified by commit 68edbed454b8
("efi_loader: initialize console size late"). A corresponding workaround is
now necessary for the automated tests, as added to some of the tests
already by commit e05bd68ed5fc ("test: work around for EFI terminal size
probing").
Add the same workaround to the UEFI authenticated capsules tests to repair
them.
This can be tested with sandbox_defconfig, sandbox64_defconfig or
sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../tests/test_efi_capsule/test_capsule_firmware_signed_fit.py | 3 +++
.../tests/test_efi_capsule/test_capsule_firmware_signed_raw.py | 2 ++
2 files changed, 5 insertions(+)
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
index 4400b8f1368..d6ca9b16745 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
@@ -40,6 +40,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
with u_boot_console.log.section('Test Case 1-a, before reboot'):
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
+ 'printenv -e PlatformLangCodes', # workaround for terminal size determination
'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
'efidebug boot order 1',
'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
@@ -115,6 +116,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
with u_boot_console.log.section('Test Case 2-a, before reboot'):
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
+ 'printenv -e PlatformLangCodes', # workaround for terminal size determination
'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
'efidebug boot order 1',
'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
@@ -192,6 +194,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
with u_boot_console.log.section('Test Case 3-a, before reboot'):
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
+ 'printenv -e PlatformLangCodes', # workaround for terminal size determination
'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
'efidebug boot order 1',
'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
index 1b5a1bb42eb..2bbaa9cc55f 100644
--- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
+++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
@@ -112,6 +112,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
with u_boot_console.log.section('Test Case 2-a, before reboot'):
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
+ 'printenv -e PlatformLangCodes', # workaround for terminal size determination
'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
'efidebug boot order 1',
'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
@@ -189,6 +190,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
with u_boot_console.log.section('Test Case 3-a, before reboot'):
output = u_boot_console.run_command_list([
'host bind 0 %s' % disk_img,
+ 'printenv -e PlatformLangCodes', # workaround for terminal size determination
'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
'efidebug boot order 1',
'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] efi: test/py: repair authenticated capsules tests
2022-06-27 10:23 [PATCH] efi: test/py: repair authenticated capsules tests Vincent Stehlé
@ 2022-06-27 10:46 ` Heinrich Schuchardt
2022-06-28 5:14 ` AKASHI Takahiro
0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2022-06-27 10:46 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: u-boot, Simon Glass
On 6/27/22 12:23, Vincent Stehlé wrote:
> The UEFI console initialisation has been modified by commit 68edbed454b8
> ("efi_loader: initialize console size late"). A corresponding workaround is
> now necessary for the automated tests, as added to some of the tests
> already by commit e05bd68ed5fc ("test: work around for EFI terminal size
> probing").
>
> Add the same workaround to the UEFI authenticated capsules tests to repair
> them.
>
> This can be tested with sandbox_defconfig, sandbox64_defconfig or
> sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.
>
> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Why are these tests not run in Gitlab?
Can't we permanently adjust one of said defconfigs for this purpose?
Or do we need a new defconfig for testing?
Best regards
Heinrich
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> .../tests/test_efi_capsule/test_capsule_firmware_signed_fit.py | 3 +++
> .../tests/test_efi_capsule/test_capsule_firmware_signed_raw.py | 2 ++
> 2 files changed, 5 insertions(+)
>
> diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> index 4400b8f1368..d6ca9b16745 100644
> --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> @@ -40,6 +40,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> with u_boot_console.log.section('Test Case 1-a, before reboot'):
> output = u_boot_console.run_command_list([
> 'host bind 0 %s' % disk_img,
> + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> 'efidebug boot order 1',
> 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> @@ -115,6 +116,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> with u_boot_console.log.section('Test Case 2-a, before reboot'):
> output = u_boot_console.run_command_list([
> 'host bind 0 %s' % disk_img,
> + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> 'efidebug boot order 1',
> 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> @@ -192,6 +194,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> with u_boot_console.log.section('Test Case 3-a, before reboot'):
> output = u_boot_console.run_command_list([
> 'host bind 0 %s' % disk_img,
> + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> 'efidebug boot order 1',
> 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> index 1b5a1bb42eb..2bbaa9cc55f 100644
> --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> @@ -112,6 +112,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
> with u_boot_console.log.section('Test Case 2-a, before reboot'):
> output = u_boot_console.run_command_list([
> 'host bind 0 %s' % disk_img,
> + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> 'efidebug boot order 1',
> 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> @@ -189,6 +190,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
> with u_boot_console.log.section('Test Case 3-a, before reboot'):
> output = u_boot_console.run_command_list([
> 'host bind 0 %s' % disk_img,
> + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> 'efidebug boot order 1',
> 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efi: test/py: repair authenticated capsules tests
2022-06-27 10:46 ` Heinrich Schuchardt
@ 2022-06-28 5:14 ` AKASHI Takahiro
2022-07-18 15:12 ` Heinrich Schuchardt
0 siblings, 1 reply; 4+ messages in thread
From: AKASHI Takahiro @ 2022-06-28 5:14 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: Vincent Stehl??, u-boot, Simon Glass
Heinrich,
On Mon, Jun 27, 2022 at 12:46:07PM +0200, Heinrich Schuchardt wrote:
> On 6/27/22 12:23, Vincent Stehlé wrote:
> > The UEFI console initialisation has been modified by commit 68edbed454b8
> > ("efi_loader: initialize console size late"). A corresponding workaround is
> > now necessary for the automated tests, as added to some of the tests
> > already by commit e05bd68ed5fc ("test: work around for EFI terminal size
> > probing").
> >
> > Add the same workaround to the UEFI authenticated capsules tests to repair
> > them.
> >
> > This can be tested with sandbox_defconfig, sandbox64_defconfig or
> > sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.
> >
> > Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
>
> Why are these tests not run in Gitlab?
> Can't we permanently adjust one of said defconfigs for this purpose?
> Or do we need a new defconfig for testing?
Because we cannot turn on or off capsule authentication dynamically
on a single U-Boot image, we cannot test non-signed test cases
and signed test cases simultaneously in CI.
That is why I proposed a new config file for sandbox with
EFI_CAPSULE_AUTHENTICATE, but the idea was rejected (if I remember correctly, by Simon).
That said, I also made a small change to unsigned test cases
(test_efi_capsule_firmware(_*).py) so that they can *pass* even with
EFI_CAPSULE_AUTHENTICATE enabled.
(As you can image, however, actual capsule update never happens in
this test environment.)
commit e012550cd7d6 ("test/py: efi_capsule: check the results in case of
CAPSULE_AUTHENTICATE")
-Takahiro Akashi
> Best regards
>
> Heinrich
>
> > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > ---
> > .../tests/test_efi_capsule/test_capsule_firmware_signed_fit.py | 3 +++
> > .../tests/test_efi_capsule/test_capsule_firmware_signed_raw.py | 2 ++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> > index 4400b8f1368..d6ca9b16745 100644
> > --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> > +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_fit.py
> > @@ -40,6 +40,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> > with u_boot_console.log.section('Test Case 1-a, before reboot'):
> > output = u_boot_console.run_command_list([
> > 'host bind 0 %s' % disk_img,
> > + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> > 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> > 'efidebug boot order 1',
> > 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> > @@ -115,6 +116,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> > with u_boot_console.log.section('Test Case 2-a, before reboot'):
> > output = u_boot_console.run_command_list([
> > 'host bind 0 %s' % disk_img,
> > + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> > 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> > 'efidebug boot order 1',
> > 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> > @@ -192,6 +194,7 @@ class TestEfiCapsuleFirmwareSignedFit(object):
> > with u_boot_console.log.section('Test Case 3-a, before reboot'):
> > output = u_boot_console.run_command_list([
> > 'host bind 0 %s' % disk_img,
> > + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> > 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> > 'efidebug boot order 1',
> > 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> > diff --git a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> > index 1b5a1bb42eb..2bbaa9cc55f 100644
> > --- a/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> > +++ b/test/py/tests/test_efi_capsule/test_capsule_firmware_signed_raw.py
> > @@ -112,6 +112,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
> > with u_boot_console.log.section('Test Case 2-a, before reboot'):
> > output = u_boot_console.run_command_list([
> > 'host bind 0 %s' % disk_img,
> > + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> > 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> > 'efidebug boot order 1',
> > 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
> > @@ -189,6 +190,7 @@ class TestEfiCapsuleFirmwareSignedRaw(object):
> > with u_boot_console.log.section('Test Case 3-a, before reboot'):
> > output = u_boot_console.run_command_list([
> > 'host bind 0 %s' % disk_img,
> > + 'printenv -e PlatformLangCodes', # workaround for terminal size determination
> > 'efidebug boot add -b 1 TEST host 0:1 /helloworld.efi',
> > 'efidebug boot order 1',
> > 'env set -e -nv -bs -rt OsIndications =0x0000000000000004',
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] efi: test/py: repair authenticated capsules tests
2022-06-28 5:14 ` AKASHI Takahiro
@ 2022-07-18 15:12 ` Heinrich Schuchardt
0 siblings, 0 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2022-07-18 15:12 UTC (permalink / raw)
To: Vincent Stehlé; +Cc: Simon Glass, AKASHI Takahiro, u-boot
On 6/28/22 07:14, AKASHI Takahiro wrote:
> Heinrich,
>
> On Mon, Jun 27, 2022 at 12:46:07PM +0200, Heinrich Schuchardt wrote:
>> On 6/27/22 12:23, Vincent Stehlé wrote:
>>> The UEFI console initialisation has been modified by commit 68edbed454b8
>>> ("efi_loader: initialize console size late"). A corresponding workaround is
>>> now necessary for the automated tests, as added to some of the tests
>>> already by commit e05bd68ed5fc ("test: work around for EFI terminal size
>>> probing").
>>>
>>> Add the same workaround to the UEFI authenticated capsules tests to repair
>>> them.
>>>
>>> This can be tested with sandbox_defconfig, sandbox64_defconfig or
>>> sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.
>>>
>>> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
>>
>> Why are these tests not run in Gitlab?
>> Can't we permanently adjust one of said defconfigs for this purpose?
>> Or do we need a new defconfig for testing?
>
> Because we cannot turn on or off capsule authentication dynamically
> on a single U-Boot image, we cannot test non-signed test cases
> and signed test cases simultaneously in CI.
>
> That is why I proposed a new config file for sandbox with
> EFI_CAPSULE_AUTHENTICATE, but the idea was rejected (if I remember correctly, by Simon).
>
> That said, I also made a small change to unsigned test cases
> (test_efi_capsule_firmware(_*).py) so that they can *pass* even with
> EFI_CAPSULE_AUTHENTICATE enabled.
> (As you can image, however, actual capsule update never happens in
> this test environment.)
>
> commit e012550cd7d6 ("test/py: efi_capsule: check the results in case of
> CAPSULE_AUTHENTICATE")
>
>
> -Takahiro Akashi
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-18 15:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 10:23 [PATCH] efi: test/py: repair authenticated capsules tests Vincent Stehlé
2022-06-27 10:46 ` Heinrich Schuchardt
2022-06-28 5:14 ` AKASHI Takahiro
2022-07-18 15:12 ` Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.