tests/functional: Extend the ppc64 e500 test
PATCH 1/1 tests/functional: Extend the ppc64 e500 test
The test sequence boots a ppce500 machine from kernel and disk.
The buildroot is built with the qemu_ppc64_e5500_defconfig config.
--- tests/functional/test_ppc64_e500.py | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
tests/functional/test_ppc64_e500.py +30 -0
@@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern class E500Test(LinuxKernelTest):
@@ -20,5 +21,34 @@ def test_ppc64_e500(self): self.launch_kernel(self.scratch_file('day19', 'uImage'), wait_for='QEMU advent calendar') + ASSET_BR2_E5500_UIMAGE = Asset( + 'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_e5500-2023.11-8-gdcd9f0f6eb-20240104/uImage', + '2478187c455d6cca3984e9dfde9c635d824ea16236b85fd6b4809f744706deda') + + ASSET_BR2_E5500_ROOTFS = Asset( + 'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_e5500-2023.11-8-gdcd9f0f6eb-20240104/rootfs.ext2', + '9035ef97237c84c7522baaff17d25cdfca4bb7a053d5e296e902919473423d76') + + def test_ppc64_e500_buildroot(self): + self.set_machine('ppce500') + self.cpu = 'e5500' + + uimage_path = self.ASSET_BR2_E5500_UIMAGE.fetch() + rootfs_path = self.ASSET_BR2_E5500_ROOTFS.fetch() + + self.vm.set_console() + self.vm.add_args('-kernel', uimage_path, + '-append', 'root=/dev/vda', + '-drive', f'file={rootfs_path},if=virtio,format=raw', + '-snapshot', '-no-shutdown') + self.vm.launch() + + self.wait_for_console_pattern('Linux version') + self.wait_for_console_pattern('/init as init process') + self.wait_for_console_pattern('lease of 10.0.2.15') + self.wait_for_console_pattern('buildroot login:') + exec_command_and_wait_for_pattern(self, 'root', '#') + exec_command_and_wait_for_pattern(self, 'poweroff', 'Power down') + if __name__ == '__main__': LinuxKernelTest.main()
Signature · 1 line
2.48.1
Quoted 22 lines · Cédric Le Goater
The test sequence boots a ppce500 machine from kernel and disk.
The buildroot is built with the
qemu_ppc64_e5500_defconfigconfig.Signed-off-by Cédric Le Goater <[email protected]>--- tests/functional/test_ppc64_e500.py | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)tests/functional/test_ppc64_e500.py +1
-0@@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern class E500Test(LinuxKernelTest):
tests/functional/test_ppc64_e500.py def test_ppc64_e500(self): · line 30
Quoted 10 lines
tests/functional/test_ppc64_e500.py +7
-0@@ -20,5 +21,34 @@ def test_ppc64_e500(self): self.launch_kernel(self.scratch_file('day19', 'uImage'), wait_for='QEMU advent calendar') + ASSET_BR2_E5500_UIMAGE = Asset( + 'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_e5500-2023.11-8-gdcd9f0f6eb-20240104/uImage', + '2478187c455d6cca3984e9dfde9c635d824ea16236b85fd6b4809f744706deda') + + ASSET_BR2_E5500_ROOTFS = Asset( + 'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_e5500-2023.11-8-gdcd9f0f6eb-20240104/rootfs.ext2', + '9035ef97237c84c7522baaff17d25cdfca4bb7a053d5e296e902919473423d76')
Hmm, the advent calendar test that is already available in this file is also based on build root ... so I think we don't need both tests here. IIRC I built most of the advent calendar images without networking stack (to keep them smaller), so your image is likely better suited here, thus I'd suggest to remove the advent calendar image now when you add your new test. WDYT?
Thomas