1c5f0a816SDavid Gibson# Test that Linux kernel boots on ppc machines and check the console 2c5f0a816SDavid Gibson# 3c5f0a816SDavid Gibson# Copyright (c) 2018, 2020 Red Hat, Inc. 4c5f0a816SDavid Gibson# 5c5f0a816SDavid Gibson# This work is licensed under the terms of the GNU GPL, version 2 or 6c5f0a816SDavid Gibson# later. See the COPYING file in the top-level directory. 7c5f0a816SDavid Gibson 8c5f0a816SDavid Gibsonfrom avocado.utils import archive 9*2283b627SPhilippe Mathieu-Daudéfrom avocado_qemu import QemuSystemTest 10c5f0a816SDavid Gibsonfrom avocado_qemu import wait_for_console_pattern 11c5f0a816SDavid Gibson 12*2283b627SPhilippe Mathieu-Daudéclass pseriesMachine(QemuSystemTest): 13c5f0a816SDavid Gibson 14c5f0a816SDavid Gibson timeout = 90 15c5f0a816SDavid Gibson KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' 16c5f0a816SDavid Gibson panic_message = 'Kernel panic - not syncing' 17c5f0a816SDavid Gibson 18c5f0a816SDavid Gibson def test_ppc64_pseries(self): 19c5f0a816SDavid Gibson """ 20c5f0a816SDavid Gibson :avocado: tags=arch:ppc64 21c5f0a816SDavid Gibson :avocado: tags=machine:pseries 22c5f0a816SDavid Gibson """ 23c5f0a816SDavid Gibson kernel_url = ('https://archives.fedoraproject.org/pub/archive' 24c5f0a816SDavid Gibson '/fedora-secondary/releases/29/Everything/ppc64le/os' 25c5f0a816SDavid Gibson '/ppc/ppc64/vmlinuz') 26c5f0a816SDavid Gibson kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77' 27c5f0a816SDavid Gibson kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) 28c5f0a816SDavid Gibson 29c5f0a816SDavid Gibson self.vm.set_console() 30c5f0a816SDavid Gibson kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0' 31c5f0a816SDavid Gibson self.vm.add_args('-kernel', kernel_path, 32c5f0a816SDavid Gibson '-append', kernel_command_line) 33c5f0a816SDavid Gibson self.vm.launch() 34c5f0a816SDavid Gibson console_pattern = 'Kernel command line: %s' % kernel_command_line 35c5f0a816SDavid Gibson wait_for_console_pattern(self, console_pattern, self.panic_message) 36