19f989d65SThomas Huth#!/usr/bin/env python3
29f989d65SThomas Huth#
39f989d65SThomas Huth# Functional test that boots a Linux kernel on an MCF5208EVB machine
49f989d65SThomas Huth# and checks the console
59f989d65SThomas Huth#
69f989d65SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
79f989d65SThomas Huth
89f989d65SThomas Huthimport os
99f989d65SThomas Huth
109f989d65SThomas Huthfrom qemu_test import LinuxKernelTest, Asset
119f989d65SThomas Huthfrom qemu_test.utils import archive_extract
129f989d65SThomas Huth
139f989d65SThomas Huthclass Mcf5208EvbTest(LinuxKernelTest):
149f989d65SThomas Huth
159f989d65SThomas Huth    ASSET_DAY07 = Asset(
16*67d76bdeSThomas Huth        'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day07.tar.xz',
179f989d65SThomas Huth        '753c2f3837126b7c6ba92d0b1e0b156e8a2c5131d2d576bb0b9a763fae73c08a')
189f989d65SThomas Huth
199f989d65SThomas Huth    def test_m68k_mcf5208evb(self):
209f989d65SThomas Huth        self.set_machine('mcf5208evb')
219f989d65SThomas Huth        file_path = self.ASSET_DAY07.fetch()
229f989d65SThomas Huth        archive_extract(file_path, self.workdir)
239f989d65SThomas Huth        self.vm.set_console()
249f989d65SThomas Huth        self.vm.add_args('-kernel', self.workdir + '/day07/sanity-clause.elf')
259f989d65SThomas Huth        self.vm.launch()
269f989d65SThomas Huth        self.wait_for_console_pattern('QEMU advent calendar')
279f989d65SThomas Huth
289f989d65SThomas Huthif __name__ == '__main__':
299f989d65SThomas Huth    LinuxKernelTest.main()
30