Skip to contentSkip to conversation

test/py: efi_capsule: aligned with efidebug syntax changes

PATCH Superseded AKASHI Takahiro 2 participants 3 messages May 10, 2021 – Jul 20, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/py: efi_capsule: aligned with efidebug syntax changes

After the commit c70f44817d46 ("efi_loader: simplify 'printenv -e'"), "-all" option is no longer necessary.
Just remove them in the test script.

Fixes c70f44817d46 ("efi_loader: simplify 'printenv -e'")
---
 test/py/tests/test_efi_capsule/test_capsule_firmware.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
test/py/tests/test_efi_capsule/test_capsule_firmware.py +3 -3
index 4697ca6f1c5c..9eeaae27d626 100644
@@ -85,7 +85,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                 # need to run uefi command to initiate capsule handling
                 output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
@@ -160,7 +160,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                 # need to run uefi command to initiate capsule handling
                 output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
@@ -227,7 +227,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                 # need to run uefi command to initiate capsule handling
                 output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
             output = u_boot_console.run_command_list(['efidebug capsule esrt'])
 
Signature · 1 line
2.31.0
#1 lore raw

PATCH 1/1 test/py: efi_capsule: aligned with efidebug syntax changes

On 5/10/21 10:21 AM, AKASHI Takahiro wrote:

In the subject: %s/aligned/align/

Quoted 3 lines

After the commit c70f44817d46 ("efi_loader: simplify 'printenv -e'"), "-all" option is no longer necessary.
Just remove them in the test script.

'env print -e -all Capsule0000' leads to an error CMD_RET_USAGE.

Capsule0000 does not necessarily exist. Shouldn't we print CapsuleLast and CapsuleMax and check their value instead?

Shouldn't we restrict the output to EFI_CAPSULE_REPORT_GUID to be sure that the GUID of these variables is correct?

Best regards

Heinrich

Quoted 39 lines
Fixes c70f44817d46 ("efi_loader: simplify 'printenv -e'")
---
  test/py/tests/test_efi_capsule/test_capsule_firmware.py | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
test/py/tests/test_efi_capsule/test_capsule_firmware.py +3 -3
index 4697ca6f1c5c..9eeaae27d626 100644
@@ -85,7 +85,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list([
                  'host bind 0 %s' % disk_img,
@@ -160,7 +160,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list([
                  'host bind 0 %s' % disk_img,
@@ -227,7 +227,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list(['efidebug capsule esrt'])
 
#2 lore raw
Quoted 3 lines · Heinrich Schuchardt

On 5/10/21 10:21 AM, AKASHI Takahiro wrote:

In the subject: %s/aligned/align/

I think that the passive usage is grammatically correct here, but I can fix it if you like.

Quoted 11 lines
Quoted 3 lines

After the commit c70f44817d46 ("efi_loader: simplify 'printenv -e'"), "-all" option is no longer necessary.
Just remove them in the test script.

'env print -e -all Capsule0000' leads to an error CMD_RET_USAGE.

Capsule0000 does not necessarily exist. Shouldn't we print CapsuleLast and CapsuleMax and check their value instead?

Shouldn't we restrict the output to EFI_CAPSULE_REPORT_GUID to be sure that the GUID of these variables is correct?

No. The whole aim of executing "env print -e" (or whatever else command) was to invoke efi_init_obj_list(), hence efi_launch_capsules(). We don't have to care whether it fails or not.

In fact, this test case still works correctly even with "--all". So this patch is just a cleanup. I will repost it.

-Takahiro Akashi

Quoted 44 lines

Best regards

Heinrich

Quoted 39 lines
Fixes c70f44817d46 ("efi_loader: simplify 'printenv -e'")
---
  test/py/tests/test_efi_capsule/test_capsule_firmware.py | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
test/py/tests/test_efi_capsule/test_capsule_firmware.py +3 -3
index 4697ca6f1c5c..9eeaae27d626 100644
@@ -85,7 +85,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list([
                  'host bind 0 %s' % disk_img,
@@ -160,7 +160,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list([
                  'host bind 0 %s' % disk_img,
@@ -227,7 +227,7 @@ class TestEfiCapsuleFirmwareFit(object):
 
                  # need to run uefi command to initiate capsule handling
                  output = u_boot_console.run_command(
-                    'env print -e -all Capsule0000')
+                    'env print -e Capsule0000')
 
              output = u_boot_console.run_command_list(['efidebug capsule esrt'])