From: Wainer dos Santos Moschetta <wainersm@redhat.com>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Cc: "Huacai Chen" <chenhuacai@kernel.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Willian Rampazzo" <wrampazz@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU
Date: Tue, 12 Jan 2021 11:05:19 -0300 [thread overview]
Message-ID: <eb1cf209-b0fb-7009-bd29-1627cb839774@redhat.com> (raw)
In-Reply-To: <20210112020708.62922-1-jiaxun.yang@flygoat.com>
Hi,
On 1/11/21 11:07 PM, Jiaxun Yang wrote:
> Test booting of PMON bootloader on loongson3-virt platform.
>
> $ (venv) AVOCADO_ALLOW_UNTRUSTED_CODE=1 \
> avocado --show=app,console \
> run -t machine:loongson3-virt tests/acceptance
> Fetching asset from tests/acceptance/machine_mips_loongson3v.py:MipsLoongson3v.test_pmon_serial_console
> JOB ID : 8e202b3727847c9104d0d3d6546ed225d35f6706
> JOB LOG : /home/flygoat/avocado/job-results/job-2021-01-12T10.02-8e202b3/job.log
> (1/1) tests/acceptance/machine_mips_loongson3v.py:MipsLoongson3v.test_pmon_serial_console: console: PMON2000 MIPS Initializing. Standby...
> console: 00000000Jump to 9fc
<snip>
> 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?
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4be087b88e..f38882f997 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -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
>
> Boston
> M: Paul Burton <paulburton@kernel.org>
> diff --git a/tests/acceptance/machine_mips_loongson3v.py b/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
Thanks!
- 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 = self.fetch_asset('https://github.com/loongson-community/pmon/'
> + 'releases/download/20210112/pmon-3avirt.bin',
> + 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. Standby...')
> + wait_for_console_pattern(self, 'Copy PMON to execute location done.')
> + wait_for_console_pattern(self, 'CPU GODSON3 BogoMIPS:')
next prev parent reply other threads:[~2021-01-12 14:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 2:07 [PATCH] tests/acceptance: Test PMON with Loongson-3A1000 CPU Jiaxun Yang
2021-01-12 12:10 ` Philippe Mathieu-Daudé
2021-01-18 16:54 ` Alex Bennée
2021-01-19 5:57 ` Philippe Mathieu-Daudé
2021-01-19 6:59 ` Jiaxun Yang
2021-01-19 7:19 ` Philippe Mathieu-Daudé
2021-01-12 14:05 ` Wainer dos Santos Moschetta [this message]
2021-01-13 23:26 ` Philippe Mathieu-Daudé
-- strict thread matches above, loose matches on Subject: below --
2020-12-16 18:17 Philippe Mathieu-Daudé
2020-12-17 0:08 ` Jiaxun Yang
2020-12-17 3:36 ` Jiaxun Yang
2020-12-18 15:21 ` Philippe Mathieu-Daudé
2020-12-18 15:27 ` Wainer dos Santos Moschetta
2020-12-18 20:51 ` Willian Rampazzo
2020-12-21 12:51 ` Huacai Chen
2020-12-21 15:34 ` Philippe Mathieu-Daudé
2020-12-22 0:40 ` Jiaxun Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eb1cf209-b0fb-7009-bd29-1627cb839774@redhat.com \
--to=wainersm@redhat.com \
--cc=chenhuacai@kernel.org \
--cc=crosa@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wrampazz@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).