2024-08-30 16:38:13 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
2021-10-15 12:00:08 +03:00
|
|
|
# Test that Linux kernel boots on the ppc bamboo board and check the console
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 Red Hat
|
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
# later. See the COPYING file in the top-level directory.
|
|
|
|
|
2024-08-30 16:38:13 +03:00
|
|
|
from qemu_test.utils import archive_extract
|
|
|
|
from qemu_test import QemuSystemTest, Asset
|
|
|
|
from qemu_test import wait_for_console_pattern
|
|
|
|
from qemu_test import exec_command_and_wait_for_pattern
|
2021-10-15 12:00:08 +03:00
|
|
|
|
2021-09-27 19:14:33 +03:00
|
|
|
class BambooMachine(QemuSystemTest):
|
2021-10-15 12:00:08 +03:00
|
|
|
|
|
|
|
timeout = 90
|
|
|
|
|
2024-08-30 16:38:13 +03:00
|
|
|
ASSET_IMAGE = Asset(
|
|
|
|
('http://landley.net/aboriginal/downloads/binaries/'
|
|
|
|
'system-image-powerpc-440fp.tar.gz'),
|
|
|
|
'c12b58f841c775a0e6df4832a55afe6b74814d1565d08ddeafc1fb949a075c5e')
|
|
|
|
|
2021-10-15 12:00:08 +03:00
|
|
|
def test_ppc_bamboo(self):
|
2024-08-30 16:38:13 +03:00
|
|
|
self.set_machine('bamboo')
|
2022-03-14 17:57:17 +03:00
|
|
|
self.require_accelerator("tcg")
|
2022-10-01 22:52:24 +03:00
|
|
|
self.require_netdev('user')
|
2024-08-30 16:38:13 +03:00
|
|
|
file_path = self.ASSET_IMAGE.fetch()
|
|
|
|
archive_extract(file_path, self.workdir)
|
2021-10-15 12:00:08 +03:00
|
|
|
self.vm.set_console()
|
|
|
|
self.vm.add_args('-kernel', self.workdir +
|
|
|
|
'/system-image-powerpc-440fp/linux',
|
|
|
|
'-initrd', self.workdir +
|
|
|
|
'/system-image-powerpc-440fp/rootfs.cpio.gz',
|
|
|
|
'-nic', 'user,model=rtl8139,restrict=on')
|
|
|
|
self.vm.launch()
|
|
|
|
wait_for_console_pattern(self, 'Type exit when done')
|
|
|
|
exec_command_and_wait_for_pattern(self, 'ping 10.0.2.2',
|
|
|
|
'10.0.2.2 is alive!')
|
|
|
|
exec_command_and_wait_for_pattern(self, 'halt', 'System Halted')
|
2024-08-30 16:38:13 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
QemuSystemTest.main()
|