xref: /qemu/tests/functional/test_microblaze_s3adsp1800.py (revision 513823e7521a09ed7ad1e32e6454bac3b2cbf52d)
1#!/usr/bin/env python3
2#
3# Functional test that boots a microblaze Linux kernel and checks the console
4#
5# Copyright (c) 2018, 2021 Red Hat, Inc.
6#
7# This work is licensed under the terms of the GNU GPL, version 2 or
8# later. See the COPYING file in the top-level directory.
9
10from qemu_test import QemuSystemTest, Asset
11from qemu_test import wait_for_console_pattern
12
13
14class MicroblazeMachine(QemuSystemTest):
15
16    timeout = 90
17
18    ASSET_IMAGE_BE = Asset(
19        ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/'
20         'day17.tar.xz'),
21        '3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057')
22
23    def do_ballerina_be_test(self, machine):
24        self.set_machine(machine)
25        self.archive_extract(self.ASSET_IMAGE_BE)
26        self.vm.set_console()
27        self.vm.add_args('-kernel',
28                         self.scratch_file('day17', 'ballerina.bin'))
29        self.vm.launch()
30        wait_for_console_pattern(self, 'This architecture does not have '
31                                       'kernel memory protection')
32        # Note:
33        # The kernel sometimes gets stuck after the "This architecture ..."
34        # message, that's why we don't test for a later string here. This
35        # needs some investigation by a microblaze wizard one day...
36
37    def test_microblaze_s3adsp1800_legacy_be(self):
38        self.do_ballerina_be_test('petalogix-s3adsp1800')
39
40if __name__ == '__main__':
41    QemuSystemTest.main()
42