From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Beraldo Leal <bleal@redhat.com>, Cleber Rosa <crosa@redhat.com>,
Wainer dos Santos Moschetta <wainersm@redhat.com>
Subject: Re: [PATCH 1/2] tests/functional: Convert mips64el Malta I6400 avocado tests
Date: Wed, 21 Aug 2024 15:14:08 +0200 [thread overview]
Message-ID: <cba8d04b-f4af-4f3c-9f19-456180af84dc@redhat.com> (raw)
In-Reply-To: <20240821125701.63042-2-philmd@linaro.org>
On 21/08/2024 14.57, Philippe Mathieu-Daudé wrote:
> Straight forward conversion. Update the SHA1 hashes to SHA256
> hashes since SHA1 should not be used anymore nowadays.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> MAINTAINERS | 1 +
> tests/avocado/machine_mips_malta.py | 108 -----------------------
> tests/functional/meson.build | 1 +
> tests/functional/test_mips64el_malta.py | 111 ++++++++++++++++++++++++
> 4 files changed, 113 insertions(+), 108 deletions(-)
> create mode 100755 tests/functional/test_mips64el_malta.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 77fbb5d42e..3a91017979 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1369,6 +1369,7 @@ F: hw/pci-host/gt64120.c
> F: include/hw/southbridge/piix.h
> F: tests/avocado/linux_ssh_mips_malta.py
> F: tests/avocado/machine_mips_malta.py
> +F: tests/functional/test_mips64el_malta.py
>
> Mipssim
> R: Aleksandar Rikalo <arikalo@gmail.com>
> diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py
> index 07a80633b5..05c64e18c4 100644
> --- a/tests/avocado/machine_mips_malta.py
> +++ b/tests/avocado/machine_mips_malta.py
> @@ -8,121 +8,13 @@
> # SPDX-License-Identifier: GPL-2.0-or-later
>
> import os
> -import gzip
> -import logging
>
> -from avocado import skipUnless
> -from avocado import skipUnless
> from avocado.utils import archive
> from avocado_qemu import QemuSystemTest
> -from avocado_qemu import exec_command_and_wait_for_pattern
> from avocado_qemu import interrupt_interactive_console_until_pattern
> from avocado_qemu import wait_for_console_pattern
>
>
> -NUMPY_AVAILABLE = True
> -try:
> - import numpy as np
> -except ImportError:
> - NUMPY_AVAILABLE = False
> -
> -CV2_AVAILABLE = True
> -try:
> - import cv2
> -except ImportError:
> - CV2_AVAILABLE = False
> -
> -
> -@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
> -@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
> -class MaltaMachineFramebuffer(QemuSystemTest):
> -
> - timeout = 30
> -
> - KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
> -
> - def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
> - """
> - Boot Linux kernel and check Tux logo is displayed on the framebuffer.
> - """
> - screendump_path = os.path.join(self.workdir, 'screendump.pbm')
> -
> - kernel_url = ('https://github.com/philmd/qemu-testing-blob/raw/'
> - 'a5966ca4b5/mips/malta/mips64el/'
> - 'vmlinux-4.7.0-rc1.I6400.gz')
> - kernel_hash = '096f50c377ec5072e6a366943324622c312045f6'
> - kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
> - kernel_path = self.workdir + "vmlinux"
> - archive.gzip_uncompress(kernel_path_gz, kernel_path)
> -
> - tuxlogo_url = ('https://github.com/torvalds/linux/raw/v2.6.12/'
> - 'drivers/video/logo/logo_linux_vga16.ppm')
> - tuxlogo_hash = '3991c2ddbd1ddaecda7601f8aafbcf5b02dc86af'
> - tuxlogo_path = self.fetch_asset(tuxlogo_url, asset_hash=tuxlogo_hash)
> -
> - self.vm.set_console()
> - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> - 'clocksource=GIC console=tty0 console=ttyS0')
> - self.vm.add_args('-kernel', kernel_path,
> - '-smp', '%u' % cpu_cores_count,
> - '-vga', 'std',
> - '-append', kernel_command_line)
> - self.vm.launch()
> - framebuffer_ready = 'Console: switching to colour frame buffer device'
> - wait_for_console_pattern(self, framebuffer_ready,
> - failure_message='Kernel panic - not syncing')
> - self.vm.cmd('human-monitor-command', command_line='stop')
> - self.vm.cmd('human-monitor-command',
> - command_line='screendump %s' % screendump_path)
> - logger = logging.getLogger('framebuffer')
> -
> - match_threshold = 0.95
> - screendump_bgr = cv2.imread(screendump_path, cv2.IMREAD_COLOR)
> - tuxlogo_bgr = cv2.imread(tuxlogo_path, cv2.IMREAD_COLOR)
> - result = cv2.matchTemplate(screendump_bgr, tuxlogo_bgr,
> - cv2.TM_CCOEFF_NORMED)
> - loc = np.where(result >= match_threshold)
> - tuxlogo_count = 0
> - h, w = tuxlogo_bgr.shape[:2]
> - debug_png = os.getenv('AVOCADO_CV2_SCREENDUMP_PNG_PATH')
> - for tuxlogo_count, pt in enumerate(zip(*loc[::-1]), start=1):
> - logger.debug('found Tux at position (x, y) = %s', pt)
> - cv2.rectangle(screendump_bgr, pt,
> - (pt[0] + w, pt[1] + h), (0, 0, 255), 2)
> - if debug_png:
> - cv2.imwrite(debug_png, screendump_bgr)
> - self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)
> -
> - def test_mips_malta_i6400_framebuffer_logo_1core(self):
> - """
> - :avocado: tags=arch:mips64el
> - :avocado: tags=machine:malta
> - :avocado: tags=cpu:I6400
> - """
> - self.do_test_i6400_framebuffer_logo(1)
> -
> - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
> - def test_mips_malta_i6400_framebuffer_logo_7cores(self):
> - """
> - :avocado: tags=arch:mips64el
> - :avocado: tags=machine:malta
> - :avocado: tags=cpu:I6400
> - :avocado: tags=mips:smp
> - :avocado: tags=flaky
> - """
> - self.do_test_i6400_framebuffer_logo(7)
> -
> - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
> - def test_mips_malta_i6400_framebuffer_logo_8cores(self):
> - """
> - :avocado: tags=arch:mips64el
> - :avocado: tags=machine:malta
> - :avocado: tags=cpu:I6400
> - :avocado: tags=mips:smp
> - :avocado: tags=flaky
> - """
> - self.do_test_i6400_framebuffer_logo(8)
> -
> class MaltaMachine(QemuSystemTest):
>
> def do_test_yamon(self):
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 8d28313a65..1823f88897 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -56,6 +56,7 @@ tests_mips64el_quick = [
> ]
>
> tests_mips64el_thorough = [
> + 'mips64el_malta',
> 'mips64el_loongson3v',
> ]
Maybe keep the list in alphabetical order?
Anyway:
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2024-08-21 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 12:56 [PATCH 0/2] tests/functional: Convert MIPS Malta avocado tests Philippe Mathieu-Daudé
2024-08-21 12:57 ` [PATCH 1/2] tests/functional: Convert mips64el Malta I6400 " Philippe Mathieu-Daudé
2024-08-21 13:14 ` Thomas Huth [this message]
2024-08-21 12:57 ` [PATCH 2/2] tests/functional: Convert mipsel Malta YAMON avocado test Philippe Mathieu-Daudé
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=cba8d04b-f4af-4f3c-9f19-456180af84dc@redhat.com \
--to=thuth@redhat.com \
--cc=aurelien@aurel32.net \
--cc=bleal@redhat.com \
--cc=crosa@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@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).