mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
tests/functional/aarch64/aspeed_ast2700: Add PCIe and network tests
Extend the AST2700 and AST2700fc functional tests with PCIe and network checks. This patch introduces a helper "do_ast2700_pcie_test()" that runs "lspci" on the emulated system and verifies the expected PCIe devices: - 0002:00:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge - 0002:01:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection Additional changes: - Add `-device e1000e,netdev=net1,bus=pcie.2 -netdev user,id=net1` to the AST2700 and AST2700fc test machines. - In the AST2700 vbootrom test, assign an IP address to the e1000e interface and verify it using `ip addr`. 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/20250919093017.338309-15-jamin_lin@aspeedtech.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
f3f2ad1193
commit
2dc5298d31
@@ -69,6 +69,16 @@ class AST2x00MachineSDK(QemuSystemTest):
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '18000')
|
||||
|
||||
def do_ast2700_pcie_test(self):
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'lspci -s 0002:00:00.0',
|
||||
'0002:00:00.0 PCI bridge: '
|
||||
'ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge')
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'lspci -s 0002:01:00.0',
|
||||
'0002:01:00.0 Ethernet controller: '
|
||||
'Intel Corporation 82574L Gigabit Network Connection')
|
||||
|
||||
def start_ast2700_test(self, name):
|
||||
num_cpu = 4
|
||||
uboot_size = os.path.getsize(self.scratch_file(name,
|
||||
@@ -125,20 +135,31 @@ class AST2x00MachineSDK(QemuSystemTest):
|
||||
|
||||
def test_aarch64_ast2700a1_evb_sdk_v09_06(self):
|
||||
self.set_machine('ast2700a1-evb')
|
||||
self.require_netdev('user')
|
||||
|
||||
self.archive_extract(self.ASSET_SDK_V906_AST2700A1)
|
||||
self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
|
||||
self.vm.add_args('-netdev', 'user,id=net1')
|
||||
self.start_ast2700_test('ast2700-default')
|
||||
self.verify_openbmc_boot_and_login('ast2700-default')
|
||||
self.do_ast2700_i2c_test()
|
||||
self.do_ast2700_pcie_test()
|
||||
|
||||
def test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_07(self):
|
||||
self.set_machine('ast2700a1-evb')
|
||||
self.require_netdev('user')
|
||||
|
||||
self.archive_extract(self.ASSET_SDK_V907_AST2700A1_VBOOROM)
|
||||
self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
|
||||
self.vm.add_args('-netdev', 'user,id=net1')
|
||||
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()
|
||||
self.do_ast2700_pcie_test()
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'ip addr show dev eth2',
|
||||
'inet 10.0.2.15/24')
|
||||
|
||||
if __name__ == '__main__':
|
||||
QemuSystemTest.main()
|
||||
|
||||
@@ -20,6 +20,8 @@ class AST2x00MachineSDK(QemuSystemTest):
|
||||
self.vm.set_console()
|
||||
self.vm.add_args('-device',
|
||||
'tmp105,bus=aspeed.i2c.bus.1,address=0x4d,id=tmp-test')
|
||||
self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
|
||||
self.vm.add_args('-netdev', 'user,id=net1')
|
||||
self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
|
||||
'-net', 'nic', '-net', 'user', '-snapshot')
|
||||
|
||||
@@ -49,6 +51,16 @@ class AST2x00MachineSDK(QemuSystemTest):
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '18000')
|
||||
|
||||
def do_ast2700_pcie_test(self):
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'lspci -s 0002:00:00.0',
|
||||
'0002:00:00.0 PCI bridge: '
|
||||
'ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge')
|
||||
exec_command_and_wait_for_pattern(self,
|
||||
'lspci -s 0002:01:00.0',
|
||||
'0002:01:00.0 Ethernet controller: '
|
||||
'Intel Corporation 82574L Gigabit Network Connection')
|
||||
|
||||
def do_ast2700fc_ssp_test(self):
|
||||
self.vm.shutdown()
|
||||
self.vm.set_console(console_index=1)
|
||||
@@ -128,6 +140,7 @@ class AST2x00MachineSDK(QemuSystemTest):
|
||||
self.start_ast2700fc_test('ast2700-default')
|
||||
self.verify_openbmc_boot_and_login('ast2700-default')
|
||||
self.do_ast2700_i2c_test()
|
||||
self.do_ast2700_pcie_test()
|
||||
self.do_ast2700fc_ssp_test()
|
||||
self.do_ast2700fc_tsp_test()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user