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