1*3a07875fSThomas Huth#!/usr/bin/env python3 2*3a07875fSThomas Huth# 3*3a07875fSThomas Huth# Functional test that boots a Linux kernel on an OpenRISC-1000 SIM machine 4*3a07875fSThomas Huth# and checks the console 5*3a07875fSThomas Huth# 6*3a07875fSThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 7*3a07875fSThomas Huth 8*3a07875fSThomas Huthimport os 9*3a07875fSThomas Huth 10*3a07875fSThomas Huthfrom qemu_test import LinuxKernelTest, Asset 11*3a07875fSThomas Huthfrom qemu_test.utils import archive_extract 12*3a07875fSThomas Huth 13*3a07875fSThomas Huthclass OpenRISC1kSimTest(LinuxKernelTest): 14*3a07875fSThomas Huth 15*3a07875fSThomas Huth ASSET_DAY20 = Asset( 16*3a07875fSThomas Huth 'https://www.qemu-advent-calendar.org/2018/download/day20.tar.xz', 17*3a07875fSThomas Huth 'ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a') 18*3a07875fSThomas Huth 19*3a07875fSThomas Huth def test_or1k_sim(self): 20*3a07875fSThomas Huth self.set_machine('or1k-sim') 21*3a07875fSThomas Huth file_path = self.ASSET_DAY20.fetch() 22*3a07875fSThomas Huth archive_extract(file_path, self.workdir) 23*3a07875fSThomas Huth self.vm.set_console() 24*3a07875fSThomas Huth self.vm.add_args('-kernel', self.workdir + '/day20/vmlinux') 25*3a07875fSThomas Huth self.vm.launch() 26*3a07875fSThomas Huth self.wait_for_console_pattern('QEMU advent calendar') 27*3a07875fSThomas Huth 28*3a07875fSThomas Huthif __name__ == '__main__': 29*3a07875fSThomas Huth LinuxKernelTest.main() 30