[PULL 12/23] tests/functional/aspeed: Add to test vbootrom for AST2700

Cédric Le Goater posted 23 patches 7 months, 2 weeks ago
There is a newer version of this series
[PULL 12/23] tests/functional/aspeed: Add to test vbootrom for AST2700
Posted by Cédric Le Goater 7 months, 2 weeks ago
From: Jamin Lin <jamin_lin@aspeedtech.com>

Add the AST2700 functional test to boot using the vbootrom image
instead of manually loading boot components with -device loader.
The boot ROM binary is now passed via the
-bios option, using the image located in pc-bios/ast27x0_bootrom.bin.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250424075135.3715128-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 tests/functional/test_aarch64_aspeed.py | 26 +++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/functional/test_aarch64_aspeed.py b/tests/functional/test_aarch64_aspeed.py
index 1e1f3f9ecece..d02dc7991c1a 100755
--- a/tests/functional/test_aarch64_aspeed.py
+++ b/tests/functional/test_aarch64_aspeed.py
@@ -25,6 +25,18 @@ def do_test_aarch64_aspeed_sdk_start(self, image):
 
         self.vm.launch()
 
+    def verify_vbootrom_firmware_flow(self):
+        wait_for_console_pattern(self, 'Found valid FIT image')
+        wait_for_console_pattern(self, '[uboot] loading')
+        wait_for_console_pattern(self, 'done')
+        wait_for_console_pattern(self, '[fdt] loading')
+        wait_for_console_pattern(self, 'done')
+        wait_for_console_pattern(self, '[tee] loading')
+        wait_for_console_pattern(self, 'done')
+        wait_for_console_pattern(self, '[atf] loading')
+        wait_for_console_pattern(self, 'done')
+        wait_for_console_pattern(self, 'Jumping to BL31 (Trusted Firmware-A)')
+
     def verify_openbmc_boot_and_login(self, name):
         wait_for_console_pattern(self, 'U-Boot 2023.10')
         wait_for_console_pattern(self, '## Loading kernel from FIT Image')
@@ -94,6 +106,11 @@ def start_ast2700_test(self, name):
         self.do_test_aarch64_aspeed_sdk_start(
             self.scratch_file(name, 'image-bmc'))
 
+    def start_ast2700_test_vbootrom(self, name):
+        self.vm.add_args('-bios', 'ast27x0_bootrom.bin')
+        self.do_test_aarch64_aspeed_sdk_start(
+                self.scratch_file(name, 'image-bmc'))
+
     def test_aarch64_ast2700_evb_sdk_v09_06(self):
         self.set_machine('ast2700-evb')
 
@@ -110,5 +127,14 @@ def test_aarch64_ast2700a1_evb_sdk_v09_06(self):
         self.verify_openbmc_boot_and_login('ast2700-default')
         self.do_ast2700_i2c_test()
 
+    def test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_06(self):
+        self.set_machine('ast2700a1-evb')
+
+        self.archive_extract(self.ASSET_SDK_V906_AST2700A1)
+        self.start_ast2700_test_vbootrom('ast2700-default')
+        self.verify_vbootrom_firmware_flow()
+        self.verify_openbmc_boot_and_login('ast2700-default')
+        self.do_ast2700_i2c_test()
+
 if __name__ == '__main__':
     QemuSystemTest.main()
-- 
2.49.0


Re: [PULL 12/23] tests/functional/aspeed: Add to test vbootrom for AST2700
Posted by Thomas Huth 2 months, 1 week ago
On 05/05/2025 11.06, Cédric Le Goater wrote:
> From: Jamin Lin <jamin_lin@aspeedtech.com>
> 
> Add the AST2700 functional test to boot using the vbootrom image
> instead of manually loading boot components with -device loader.
> The boot ROM binary is now passed via the
> -bios option, using the image located in pc-bios/ast27x0_bootrom.bin.
...
> @@ -110,5 +127,14 @@ def test_aarch64_ast2700a1_evb_sdk_v09_06(self):
>           self.verify_openbmc_boot_and_login('ast2700-default')
>           self.do_ast2700_i2c_test()
>   
> +    def test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_06(self):
> +        self.set_machine('ast2700a1-evb')
> +
> +        self.archive_extract(self.ASSET_SDK_V906_AST2700A1)
> +        self.start_ast2700_test_vbootrom('ast2700-default')
> +        self.verify_vbootrom_firmware_flow()
> +        self.verify_openbmc_boot_and_login('ast2700-default')
> +        self.do_ast2700_i2c_test()

  Hi,

just a question / idea: The ast2700 test is now one of the longest running 
aarch64 tests ... would it maybe be ok to drop (or disable by default) the 
test_aarch64_ast2700a1_evb_sdk_v09_06 test now that the vbootrom test has 
been added? Or do we really get a lot of additional test coverage (that we 
don't get by the a0 test yet) by booting Linux twice on the a1 machine here?

  Thanks,
   Thomas


Re: [PULL 12/23] tests/functional/aspeed: Add to test vbootrom for AST2700
Posted by Cédric Le Goater 2 months, 1 week ago
On 10/6/25 18:35, Thomas Huth wrote:
> On 05/05/2025 11.06, Cédric Le Goater wrote:
>> From: Jamin Lin <jamin_lin@aspeedtech.com>
>>
>> Add the AST2700 functional test to boot using the vbootrom image
>> instead of manually loading boot components with -device loader.
>> The boot ROM binary is now passed via the
>> -bios option, using the image located in pc-bios/ast27x0_bootrom.bin.
> ...
>> @@ -110,5 +127,14 @@ def test_aarch64_ast2700a1_evb_sdk_v09_06(self):
>>           self.verify_openbmc_boot_and_login('ast2700-default')
>>           self.do_ast2700_i2c_test()
>> +    def test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_06(self):
>> +        self.set_machine('ast2700a1-evb')
>> +
>> +        self.archive_extract(self.ASSET_SDK_V906_AST2700A1)
>> +        self.start_ast2700_test_vbootrom('ast2700-default')
>> +        self.verify_vbootrom_firmware_flow()
>> +        self.verify_openbmc_boot_and_login('ast2700-default')
>> +        self.do_ast2700_i2c_test()
> 
>   Hi,
> 
> just a question / idea: The ast2700 test is now one of the longest running aarch64 tests ... 

yes. I should split the ast2600 test in two too to improve parallelism.

> would it maybe be ok to drop (or disable by default) the test_aarch64_ast2700a1_evb_sdk_v09_06 test now that the vbootrom test has been added? Or do we really get a lot of additional test coverage (that we don't get by the a0 test yet) by booting Linux twice on the a1 machine here?

We don't need to keep 'test_aarch64_ast2700a0_evb_sdk_v09_06', since
ast2700a0-evb is being deprecated.

May be we can reduce 'test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_08'
to 'verify_vbootrom_firmware_flow()' and a check on the kernel being
started only.

Jamin, what do you think ?

Thanks,

C.