[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/22] tests/functional: Convert nanomips Malta avocado tests
From: |
Thomas Huth |
Subject: |
[PULL 13/22] tests/functional: Convert nanomips Malta avocado tests |
Date: |
Tue, 10 Sep 2024 14:37:14 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Straight forward conversion. Update the SHA1 hashes to
SHA256 hashes since SHA1 should not be used anymore nowadays.
$ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 \
make check-functional-mipsel
...
▶ 4/4
test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_16k_up OK
▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_4k
OK
▶ 4/4
test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_64k_dbg OK
▶ 4/4 test_mipsel_malta.MaltaMachineYAMON.test_mipsel_malta_yamon
OK
4/4 qemu:func-thorough+func-mipsel-thorough+thorough /
func-mipsel-mipsel_malta OK 9.95s 4 subtests passed
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240827094905.80648-7-philmd@linaro.org>
[thuth: Use LinuxKernelTest]
Message-ID: <20240906180549.792832-8-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/avocado/boot_linux_console.py | 59 ---------------------------
tests/functional/test_mipsel_malta.py | 51 ++++++++++++++++++++++-
2 files changed, 50 insertions(+), 60 deletions(-)
diff --git a/tests/avocado/boot_linux_console.py
b/tests/avocado/boot_linux_console.py
index 84b31cb84e..34f4abadd0 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -179,65 +179,6 @@ def test_mips_malta_cpio(self):
# Wait for VM to shut down gracefully
self.vm.wait()
- def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
- kernel_path = self.workdir + "kernel"
- with lzma.open(kernel_path_xz, 'rb') as f_in:
- with open(kernel_path, 'wb') as f_out:
- shutil.copyfileobj(f_in, f_out)
-
- self.vm.set_console()
- kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
- + 'mem=256m@@0x0 '
- + 'console=ttyS0')
- self.vm.add_args('-no-reboot',
- '-kernel', kernel_path,
- '-append', kernel_command_line)
- self.vm.launch()
- console_pattern = 'Kernel command line: %s' % kernel_command_line
- self.wait_for_console_pattern(console_pattern)
-
- def test_mips_malta32el_nanomips_4k(self):
- """
- :avocado: tags=arch:mipsel
- :avocado: tags=machine:malta
- :avocado: tags=endian:little
- :avocado: tags=cpu:I7200
- """
- kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
- 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
- 'generic_nano32r6el_page4k.xz')
- kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
- kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
- self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
- def test_mips_malta32el_nanomips_16k_up(self):
- """
- :avocado: tags=arch:mipsel
- :avocado: tags=machine:malta
- :avocado: tags=endian:little
- :avocado: tags=cpu:I7200
- """
- kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
- 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
- 'generic_nano32r6el_page16k_up.xz')
- kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
- kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
- self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
- def test_mips_malta32el_nanomips_64k_dbg(self):
- """
- :avocado: tags=arch:mipsel
- :avocado: tags=machine:malta
- :avocado: tags=endian:little
- :avocado: tags=cpu:I7200
- """
- kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
- 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
- 'generic_nano32r6el_page64k_dbg.xz')
- kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
- kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
- self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
def test_aarch64_xlnx_versal_virt(self):
"""
:avocado: tags=arch:aarch64
diff --git a/tests/functional/test_mipsel_malta.py
b/tests/functional/test_mipsel_malta.py
index f31f96b012..b8dfddd856 100755
--- a/tests/functional/test_mipsel_malta.py
+++ b/tests/functional/test_mipsel_malta.py
@@ -11,12 +11,61 @@
import os
-from qemu_test import QemuSystemTest, Asset
+from qemu_test import QemuSystemTest, LinuxKernelTest, Asset
from qemu_test import interrupt_interactive_console_until_pattern
from qemu_test import wait_for_console_pattern
+from qemu_test.utils import lzma_uncompress
from zipfile import ZipFile
+class MaltaMachineConsole(LinuxKernelTest):
+
+ ASSET_KERNEL_4K = Asset(
+ ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
+ 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
+ 'generic_nano32r6el_page4k.xz'),
+ '019e034094ac6cf3aa77df5e130fb023ce4dbc804b04bfcc560c6403e1ae6bdb')
+ ASSET_KERNEL_16K = Asset(
+ ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
+ 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
+ 'generic_nano32r6el_page16k_up.xz'),
+ '3a54a10b3108c16a448dca9ea3db378733a27423befc2a45a5bdf990bd85e12c')
+ ASSET_KERNEL_64K = Asset(
+ ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
+ 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
+ 'generic_nano32r6el_page64k_dbg.xz'),
+ 'ce21ff4b07a981ecb8a39db2876616f5a2473eb2ab459c6f67465b9914b0c6b6')
+
+ def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
+ kernel_path = os.path.join(self.workdir, 'kernel')
+ lzma_uncompress(kernel_path_xz, kernel_path)
+
+ self.set_machine('malta')
+ self.vm.set_console()
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
+ + 'mem=256m@@0x0 '
+ + 'console=ttyS0')
+ self.vm.add_args('-cpu', 'I7200',
+ '-no-reboot',
+ '-kernel', kernel_path,
+ '-append', kernel_command_line)
+ self.vm.launch()
+ console_pattern = 'Kernel command line: %s' % kernel_command_line
+ self.wait_for_console_pattern(console_pattern)
+
+ def test_mips_malta32el_nanomips_4k(self):
+ kernel_path_xz = self.ASSET_KERNEL_4K.fetch()
+ self.do_test_mips_malta32el_nanomips(kernel_path_xz)
+
+ def test_mips_malta32el_nanomips_16k_up(self):
+ kernel_path_xz = self.ASSET_KERNEL_16K.fetch()
+ self.do_test_mips_malta32el_nanomips(kernel_path_xz)
+
+ def test_mips_malta32el_nanomips_64k_dbg(self):
+ kernel_path_xz = self.ASSET_KERNEL_16K.fetch()
+ self.do_test_mips_malta32el_nanomips(kernel_path_xz)
+
+
class MaltaMachineYAMON(QemuSystemTest):
ASSET_YAMON_ROM = Asset(
--
2.46.0
- [PULL 01/22] meson: Split --enable-sanitizers to --enable-{asan, ubsan}, (continued)
- [PULL 01/22] meson: Split --enable-sanitizers to --enable-{asan, ubsan}, Thomas Huth, 2024/09/10
- [PULL 04/22] contrib/plugins/Makefile: Add a 'distclean' target, Thomas Huth, 2024/09/10
- [PULL 02/22] meson: Move -fsanitize=undefined into normal configuraton, Thomas Huth, 2024/09/10
- [PULL 05/22] MAINTAINERS: Remove myself as reviewer, Thomas Huth, 2024/09/10
- [PULL 09/22] tests/functional: Convert mips64el Fuloong2e avocado test (2/2), Thomas Huth, 2024/09/10
- [PULL 06/22] MAINTAINERS: Remove myself from the Meson section, Thomas Huth, 2024/09/10
- [PULL 08/22] tests/functional: Convert the m68k Q800 Avocado test into a functional test, Thomas Huth, 2024/09/10
- [PULL 10/22] tests/functional: Convert mips64el I6400 Malta avocado tests, Thomas Huth, 2024/09/10
- [PULL 11/22] tests/functional: Convert mips64el 5KEc Malta avocado tests, Thomas Huth, 2024/09/10
- [PULL 07/22] tests/functional: Add the LinuxKernelTest for testing the Linux boot process, Thomas Huth, 2024/09/10
- [PULL 13/22] tests/functional: Convert nanomips Malta avocado tests,
Thomas Huth <=
- [PULL 15/22] tests/functional: Convert ARM Raspi2 avocado tests, Thomas Huth, 2024/09/10
- [PULL 12/22] tests/functional: Convert mips32el Malta YAMON avocado test, Thomas Huth, 2024/09/10
- [PULL 14/22] tests/functional: Convert mips32eb 4Kc Malta avocado tests, Thomas Huth, 2024/09/10
- [PULL 16/22] tests/functional: Convert Aarch64 Raspi3 avocado tests, Thomas Huth, 2024/09/10
- [PULL 17/22] tests/functional: Convert Aarch64 Raspi4 avocado tests, Thomas Huth, 2024/09/10
- [PULL 18/22] tests/functional: Convert the Alpha Clipper Avocado test, Thomas Huth, 2024/09/10
- [PULL 19/22] tests/functional: Convert the m68k MCF5208EVB Avocado test, Thomas Huth, 2024/09/10
- [PULL 20/22] tests/functional: Convert the or1k-sim Avocado test, Thomas Huth, 2024/09/10
- [PULL 21/22] tests/functional: Convert the multiprocess avocado test into a standalone test, Thomas Huth, 2024/09/10
- [PULL 22/22] tests/functional: Fix bad usage of has_cmd, Thomas Huth, 2024/09/10