14c0a2df8SThomas Huth#!/usr/bin/env python3 24c0a2df8SThomas Huth# 34c0a2df8SThomas Huth# Functional tests for the Generic Loongson-3 Platform. 44c0a2df8SThomas Huth# 54c0a2df8SThomas Huth# Copyright (c) 2021 Jiaxun Yang <jiaxun.yang@flygoat.com> 64c0a2df8SThomas Huth# 74c0a2df8SThomas Huth# This work is licensed under the terms of the GNU GPL, version 2 or later. 84c0a2df8SThomas Huth# See the COPYING file in the top-level directory. 94c0a2df8SThomas Huth# 104c0a2df8SThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later 114c0a2df8SThomas Huth 124c0a2df8SThomas Huthfrom qemu_test import QemuSystemTest, Asset 13*3d593860SDaniel P. Berrangéfrom qemu_test import wait_for_console_pattern, skipUntrustedTest 14*3d593860SDaniel P. Berrangé 154c0a2df8SThomas Huth 164c0a2df8SThomas Huthclass MipsLoongson3v(QemuSystemTest): 174c0a2df8SThomas Huth timeout = 60 184c0a2df8SThomas Huth 194c0a2df8SThomas Huth ASSET_PMON = Asset( 204c0a2df8SThomas Huth ('https://github.com/loongson-community/pmon/' 214c0a2df8SThomas Huth 'releases/download/20210112/pmon-3avirt.bin'), 224c0a2df8SThomas Huth 'fcdf6bb2cb7885a4a62f31fcb0d5e368bac7b6cea28f40c6dfa678af22fea20a') 234c0a2df8SThomas Huth 24*3d593860SDaniel P. Berrangé @skipUntrustedTest() 254c0a2df8SThomas Huth def test_pmon_serial_console(self): 264c0a2df8SThomas Huth self.set_machine('loongson3-virt') 274c0a2df8SThomas Huth 284c0a2df8SThomas Huth pmon_path = self.ASSET_PMON.fetch() 294c0a2df8SThomas Huth 304c0a2df8SThomas Huth self.vm.set_console() 314c0a2df8SThomas Huth self.vm.add_args('-bios', pmon_path) 324c0a2df8SThomas Huth self.vm.launch() 334c0a2df8SThomas Huth wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:') 344c0a2df8SThomas Huth 354c0a2df8SThomas Huthif __name__ == '__main__': 364c0a2df8SThomas Huth QemuSystemTest.main() 37