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