master
py 36 lines 1.04 KB
Raw
1 #!/usr/bin/env python3
2 #
3 # Functional tests for the Generic Loongson-3 Platform.
4 #
5 # Copyright (c) 2021 Jiaxun Yang <jiaxun.yang@flygoat.com>
6 #
7 # This work is licensed under the terms of the GNU GPL, version 2 or later.
8 # See the COPYING file in the top-level directory.
9 #
10 # SPDX-License-Identifier: GPL-2.0-or-later
11
12 from qemu_test import QemuSystemTest, Asset
13 from qemu_test import wait_for_console_pattern, skipUntrustedTest
14
15
16 class MipsLoongson3v(QemuSystemTest):
17 timeout = 60
18
19 ASSET_PMON = Asset(
20 ('https://github.com/loongson-community/pmon/'
21 'releases/download/20210112/pmon-3avirt.bin'),
22 'fcdf6bb2cb7885a4a62f31fcb0d5e368bac7b6cea28f40c6dfa678af22fea20a')
23
24 @skipUntrustedTest()
25 def test_pmon_serial_console(self):
26 self.set_machine('loongson3-virt')
27
28 pmon_path = self.ASSET_PMON.fetch()
29
30 self.vm.set_console()
31 self.vm.add_args('-bios', pmon_path)
32 self.vm.launch()
33 wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:')
34
35 if __name__ == '__main__':
36 QemuSystemTest.main()