Skip to content

Commit 827eecb

Browse files
jamin-aspeedlegoater
authored andcommitted
tests/functional/aspeed: Introduce start_ast2700_test API
Added a new method "start_ast2700_test" to the "AST2x00MachineSDK" class and this method centralizes the logic for starting the AST2700 test, making it reusable for different test cases. Signed-off-by: Jamin Lin <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> Link: https://lore.kernel.org/qemu-devel/[email protected] Signed-off-by: Cédric Le Goater <[email protected]>
1 parent ecc1a4e commit 827eecb

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tests/functional/test_aarch64_aspeed.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,29 @@ def do_test_aarch64_aspeed_sdk_start(self, image):
3131
'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.03/ast2700-default-obmc.tar.gz',
3232
'91225f50d255e2905ba8d8e0c80b71b9d157c3609770c7a740cd786370d85a77')
3333

34-
def test_aarch64_ast2700_evb_sdk_v09_03(self):
35-
self.set_machine('ast2700-evb')
36-
37-
self.archive_extract(self.ASSET_SDK_V903_AST2700)
38-
34+
def start_ast2700_test(self, name):
3935
num_cpu = 4
40-
uboot_size = os.path.getsize(self.scratch_file('ast2700-default',
36+
uboot_size = os.path.getsize(self.scratch_file(name,
4137
'u-boot-nodtb.bin'))
4238
uboot_dtb_load_addr = hex(0x400000000 + uboot_size)
4339

4440
load_images_list = [
4541
{
4642
'addr': '0x400000000',
47-
'file': self.scratch_file('ast2700-default',
43+
'file': self.scratch_file(name,
4844
'u-boot-nodtb.bin')
4945
},
5046
{
5147
'addr': str(uboot_dtb_load_addr),
52-
'file': self.scratch_file('ast2700-default', 'u-boot.dtb')
48+
'file': self.scratch_file(name, 'u-boot.dtb')
5349
},
5450
{
5551
'addr': '0x430000000',
56-
'file': self.scratch_file('ast2700-default', 'bl31.bin')
52+
'file': self.scratch_file(name, 'bl31.bin')
5753
},
5854
{
5955
'addr': '0x430080000',
60-
'file': self.scratch_file('ast2700-default', 'optee',
56+
'file': self.scratch_file(name, 'optee',
6157
'tee-raw.bin')
6258
}
6359
]
@@ -76,13 +72,12 @@ def test_aarch64_ast2700_evb_sdk_v09_03(self):
7672
self.vm.add_args('-device',
7773
'tmp105,bus=aspeed.i2c.bus.1,address=0x4d,id=tmp-test')
7874
self.do_test_aarch64_aspeed_sdk_start(
79-
self.scratch_file('ast2700-default', 'image-bmc'))
75+
self.scratch_file(name, 'image-bmc'))
8076

81-
wait_for_console_pattern(self, 'ast2700-default login:')
77+
wait_for_console_pattern(self, f'{name} login:')
8278

8379
exec_command_and_wait_for_pattern(self, 'root', 'Password:')
84-
exec_command_and_wait_for_pattern(self,
85-
'0penBmc', 'root@ast2700-default:~#')
80+
exec_command_and_wait_for_pattern(self, '0penBmc', f'root@{name}:~#')
8681

8782
exec_command_and_wait_for_pattern(self,
8883
'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device ',
@@ -94,6 +89,12 @@ def test_aarch64_ast2700_evb_sdk_v09_03(self):
9489
exec_command_and_wait_for_pattern(self,
9590
'cat /sys/class/hwmon/hwmon20/temp1_input', '18000')
9691

92+
def test_aarch64_ast2700_evb_sdk_v09_03(self):
93+
self.set_machine('ast2700-evb')
94+
95+
self.archive_extract(self.ASSET_SDK_V903_AST2700)
96+
self.start_ast2700_test('ast2700-default')
97+
9798

9899
if __name__ == '__main__':
99100
QemuSystemTest.main()

0 commit comments

Comments
 (0)