112c0b407SThomas Huth#!/usr/bin/env python3 212c0b407SThomas Huth# 312c0b407SThomas Huth# Boot Linux kernel on a mac99 and g3beige ppc machine and check the console 412c0b407SThomas Huth# 512c0b407SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 612c0b407SThomas Huth 712c0b407SThomas Huthfrom qemu_test import LinuxKernelTest, Asset 8*5831ed84SDaniel P. Berrangé 912c0b407SThomas Huth 1012c0b407SThomas Huthclass MacTest(LinuxKernelTest): 1112c0b407SThomas Huth 1212c0b407SThomas Huth ASSET_DAY15 = Asset( 1367d76bdeSThomas Huth 'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day15.tar.xz', 1412c0b407SThomas Huth '03e0757c131d2959decf293a3572d3b96c5a53587165bf05ce41b2818a2bccd5') 1512c0b407SThomas Huth 1612c0b407SThomas Huth def do_day15_test(self): 1712c0b407SThomas Huth # mac99 also works with kvm_pr but we don't have a reliable way at 1812c0b407SThomas Huth # the moment (e.g. by looking at /proc/modules) to detect whether 1912c0b407SThomas Huth # we're running kvm_hv or kvm_pr. For now let's disable this test 2012c0b407SThomas Huth # if we don't have TCG support. 2112c0b407SThomas Huth self.require_accelerator("tcg") 22*5831ed84SDaniel P. Berrangé self.archive_extract(self.ASSET_DAY15) 2312c0b407SThomas Huth self.vm.add_args('-M', 'graphics=off') 24beaf88c8SDaniel P. Berrangé self.launch_kernel(self.scratch_file('day15', 'invaders.elf'), 2512c0b407SThomas Huth wait_for='QEMU advent calendar') 2612c0b407SThomas Huth 2712c0b407SThomas Huth def test_ppc_g3beige(self): 2812c0b407SThomas Huth self.set_machine('g3beige') 2912c0b407SThomas Huth self.do_day15_test() 3012c0b407SThomas Huth 3112c0b407SThomas Huth def test_ppc_mac99(self): 3212c0b407SThomas Huth self.set_machine('mac99') 3312c0b407SThomas Huth self.do_day15_test() 3412c0b407SThomas Huth 3512c0b407SThomas Huthif __name__ == '__main__': 3612c0b407SThomas Huth LinuxKernelTest.main() 37