xref: /qemu/tests/functional/test_or1k_sim.py (revision beaf88c895a5eda649777757c80ab4171de777ff)
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 Huthfrom qemu_test import LinuxKernelTest, Asset
93a07875fSThomas Huthfrom qemu_test.utils import archive_extract
103a07875fSThomas Huth
113a07875fSThomas Huthclass OpenRISC1kSimTest(LinuxKernelTest):
123a07875fSThomas Huth
133a07875fSThomas Huth    ASSET_DAY20 = Asset(
1467d76bdeSThomas Huth        'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day20.tar.xz',
153a07875fSThomas Huth        'ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a')
163a07875fSThomas Huth
173a07875fSThomas Huth    def test_or1k_sim(self):
183a07875fSThomas Huth        self.set_machine('or1k-sim')
193a07875fSThomas Huth        file_path = self.ASSET_DAY20.fetch()
203a07875fSThomas Huth        archive_extract(file_path, self.workdir)
213a07875fSThomas Huth        self.vm.set_console()
22*beaf88c8SDaniel P. Berrangé        self.vm.add_args('-kernel', self.scratch_file('day20', 'vmlinux'))
233a07875fSThomas Huth        self.vm.launch()
243a07875fSThomas Huth        self.wait_for_console_pattern('QEMU advent calendar')
253a07875fSThomas Huth
263a07875fSThomas Huthif __name__ == '__main__':
273a07875fSThomas Huth    LinuxKernelTest.main()
28