[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU

From: Wainer dos Santos Moschetta
Subject: Re: [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU
Date: Tue, 12 Jan 2021 11:05:19 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0


On 1/11/21 11:07 PM, Jiaxun Yang wrote:
Test booting of PMON bootloader on loongson3-virt platform.

     avocado --show=app,console \
       run -t machine:loongson3-virt tests/acceptance
Fetching asset from 
JOB ID     : 8e202b3727847c9104d0d3d6546ed225d35f6706
JOB LOG    : 
  console: PMON2000 MIPS Initializing. Standby...
console: 00000000Jump to 9fc
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
  MAINTAINERS                                 |  1 +
  tests/acceptance/machine_mips_loongson3v.py | 39 +++++++++++++++++++++
  2 files changed, 40 insertions(+)
  create mode 100644 tests/acceptance/machine_mips_loongson3v.py

Allow me to use this new test as an example to start a discussion about the organization of the acceptance files.

The mips64le tests currently are:

$ ./venv/bin/avocado list -t arch:mips64el acceptance/

INSTRUMENTED acceptance/boot_linux_console.py:BootLinuxConsole.test_mips64el_malta INSTRUMENTED acceptance/boot_linux_console.py:BootLinuxConsole.test_mips64el_fuloong2e INSTRUMENTED acceptance/boot_linux_console.py:BootLinuxConsole.test_mips64el_malta_5KEc_cpio INSTRUMENTED acceptance/linux_ssh_mips_malta.py:LinuxSSH.test_mips_malta64el_kernel3_2_0 INSTRUMENTED acceptance/machine_mips_loongson3v.py:MipsLoongson3v.test_pmon_serial_console INSTRUMENTED acceptance/machine_mips_malta.py:MaltaMachineFramebuffer.test_mips_malta_i6400_framebuffer_logo_1core INSTRUMENTED acceptance/machine_mips_malta.py:MaltaMachineFramebuffer.test_mips_malta_i6400_framebuffer_logo_7cores INSTRUMENTED acceptance/machine_mips_malta.py:MaltaMachineFramebuffer.test_mips_malta_i6400_framebuffer_logo_8cores INSTRUMENTED acceptance/replay_kernel.py:ReplayKernelNormal.test_mips64el_malta INSTRUMENTED acceptance/replay_kernel.py:ReplayKernelSlow.test_mips64el_malta_5KEc_cpio

Most of them are simple "boot linux (or firmware) and check the console" tests. The replay_kernel.py contain tests for a given feature and happen to be testing on mips64el as well. So on tests/acceptance directory we've got boot tests spread across files and mixed with "generic" feature tests.

I think we should find a home for those boot tests. Maybe throw them all in a sub-directory called "boot_tests", or in arch-oriented directories (boot_tests/mips64el, boot_tests/x86_64, ...) which would make easier to reference them in the MAINTAINERS file.

Any thought?

index 4be087b88e..f38882f997 100644
@@ -1164,6 +1164,7 @@ F: hw/intc/loongson_liointc.c
  F: hw/mips/loongson3_bootp.c
  F: hw/mips/loongson3_bootp.h
  F: hw/mips/loongson3_virt.c
+F: tests/acceptance/machine_mips_loongson3v.py
  M: Paul Burton <paulburton@kernel.org>
diff --git a/tests/acceptance/machine_mips_loongson3v.py 
new file mode 100644
index 0000000000..17a85de69f
--- /dev/null
+++ b/tests/acceptance/machine_mips_loongson3v.py
@@ -0,0 +1,39 @@
+# Functional tests for the Generic Loongson-3 Platform.
+# Copyright (c) 2020 Philippe Mathieu-Daudé <f4bug@amsat.org>
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+# SPDX-License-Identifier: GPL-2.0-or-later
+import os
+import time

Unused time import


- Wainer

+from avocado import skipUnless
+from avocado_qemu import Test
+from avocado_qemu import wait_for_console_pattern
+class MipsLoongson3v(Test):
+    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
+    def test_pmon_serial_console(self):
+        """
+        :avocado: tags=arch:mips64el
+        :avocado: tags=endian:little
+        :avocado: tags=machine:loongson3-virt
+        :avocado: tags=cpu:Loongson-3A1000
+        :avocado: tags=device:liointc
+        :avocado: tags=device:goldfish_rtc
+        """
+        pmon_hash = '7c8b45dd81ccfc55ff28f5aa267a41c3'
+        pmon_path = 
+                                     asset_hash=pmon_hash, algorithm='md5'
+        self.vm.set_console()
+        self.vm.add_args('-bios', pmon_path)
+        self.vm.launch()
+        wait_for_console_pattern(self, 'PMON2000 MIPS Initializing. 
+        wait_for_console_pattern(self, 'Copy PMON to execute location done.')
+        wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:')

reply via email to

[Prev in Thread] Current Thread [Next in Thread]