13a07875fSThomas Huth#!/usr/bin/env python3 23a07875fSThomas Huth# 33a07875fSThomas Huth# Functional test that boots a Linux kernel on an OpenRISC-1000 SIM machine 43a07875fSThomas Huth# and checks the console 53a07875fSThomas Huth# 63a07875fSThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 73a07875fSThomas Huth 83a07875fSThomas Huthimport os 93a07875fSThomas Huth 103a07875fSThomas Huthfrom qemu_test import LinuxKernelTest, Asset 113a07875fSThomas Huthfrom qemu_test.utils import archive_extract 123a07875fSThomas Huth 133a07875fSThomas Huthclass OpenRISC1kSimTest(LinuxKernelTest): 143a07875fSThomas Huth 153a07875fSThomas Huth ASSET_DAY20 = Asset( 16*67d76bdeSThomas Huth 'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day20.tar.xz', 173a07875fSThomas Huth 'ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a') 183a07875fSThomas Huth 193a07875fSThomas Huth def test_or1k_sim(self): 203a07875fSThomas Huth self.set_machine('or1k-sim') 213a07875fSThomas Huth file_path = self.ASSET_DAY20.fetch() 223a07875fSThomas Huth archive_extract(file_path, self.workdir) 233a07875fSThomas Huth self.vm.set_console() 243a07875fSThomas Huth self.vm.add_args('-kernel', self.workdir + '/day20/vmlinux') 253a07875fSThomas Huth self.vm.launch() 263a07875fSThomas Huth self.wait_for_console_pattern('QEMU advent calendar') 273a07875fSThomas Huth 283a07875fSThomas Huthif __name__ == '__main__': 293a07875fSThomas Huth LinuxKernelTest.main() 30