1e3fc99b1SThomas Huth#!/usr/bin/env python3 2e3fc99b1SThomas Huth# 3e3fc99b1SThomas Huth# Functional test that boots a Linux kernel and checks the console 4e3fc99b1SThomas Huth# 5e3fc99b1SThomas Huth# Copyright (c) 2020 Red Hat, Inc. 6e3fc99b1SThomas Huth# 7e3fc99b1SThomas Huth# Author: 8e3fc99b1SThomas Huth# Thomas Huth <thuth@redhat.com> 9e3fc99b1SThomas Huth# 10e3fc99b1SThomas Huth# This work is licensed under the terms of the GNU GPL, version 2 or 11e3fc99b1SThomas Huth# later. See the COPYING file in the top-level directory. 12e3fc99b1SThomas Huth 13e3fc99b1SThomas Huthfrom qemu_test import QemuSystemTest, Asset 14e3fc99b1SThomas Huthfrom qemu_test import wait_for_console_pattern 15e3fc99b1SThomas Huth 16beaf88c8SDaniel P. Berrangé 17e3fc99b1SThomas Huthclass Sun4uMachine(QemuSystemTest): 18e3fc99b1SThomas Huth """Boots the Linux kernel and checks that the console is operational""" 19e3fc99b1SThomas Huth 20e3fc99b1SThomas Huth timeout = 90 21e3fc99b1SThomas Huth 22e3fc99b1SThomas Huth ASSET_IMAGE = Asset( 23e3fc99b1SThomas Huth ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/' 24e3fc99b1SThomas Huth 'day23.tar.xz'), 25e3fc99b1SThomas Huth 'a3ed92450704af244178351afd0e769776e7decb298e95a63abfd9a6e3f6c854') 26e3fc99b1SThomas Huth 27e3fc99b1SThomas Huth def test_sparc64_sun4u(self): 28e3fc99b1SThomas Huth self.set_machine('sun4u') 29*5831ed84SDaniel P. Berrangé kernel_file = self.archive_extract(self.ASSET_IMAGE, 30*5831ed84SDaniel P. Berrangé member='day23/vmlinux') 31e3fc99b1SThomas Huth self.vm.set_console() 32*5831ed84SDaniel P. Berrangé self.vm.add_args('-kernel', kernel_file, 33e3fc99b1SThomas Huth '-append', 'printk.time=0') 34e3fc99b1SThomas Huth self.vm.launch() 35e3fc99b1SThomas Huth wait_for_console_pattern(self, 'Starting logging: OK') 36e3fc99b1SThomas Huth 37e3fc99b1SThomas Huthif __name__ == '__main__': 38e3fc99b1SThomas Huth QemuSystemTest.main() 39