]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
tests: Add LoongArch to various test cases
authorXiaotian Wu <wuxiaotian@loongson.cn>
Thu, 27 Apr 2023 07:46:22 +0000 (15:46 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 17 May 2023 11:32:54 +0000 (13:32 +0200)
I ran the test suite on a 3A5000 desktop, a LoongArch architecture machine,
using Archlinux for LoongArch distro, see https://github.com/loongarchlinux.

Some software versions are:
* linux 6.3.0-rc4
* gcc 13.0.1 20230312
* binutils 2.40
* qemu 7.2.0

The test results of running "make check" with qemu 7.2 are as follows:

=================================
   GRUB 2.11: ./test-suite.log
=================================

  # TOTAL: 85
  # PASS:  73
  # SKIP:  8
  # XFAIL: 0
  # FAIL:  2
  # XPASS: 0
  # ERROR: 2

.. contents:: :depth: 2

ERROR: f2fs_test
================

mount: /tmp/grub-fs-tester.20230418175640563815408.f2fs.UDs/f2fs_rw: unknown filesystem type 'f2fs'.
       dmesg(1) may have more information after failed mount system call.
MOUNT FAILED.
ERROR f2fs_test (exit status: 99)

FAIL: hfs_test
==============

recode: Request `utf8..macroman' is erroneous
mkfs.hfs: name required with -v option
FAIL hfs_test (exit status: 1)

ERROR: zfs_test
===============

zpool not installed; cannot test zfs.
ERROR zfs_test (exit status: 99)

SKIP: pata_test
===============

SKIP pata_test (exit status: 77)

SKIP: ahci_test
===============

SKIP ahci_test (exit status: 77)

SKIP: uhci_test
===============

SKIP uhci_test (exit status: 77)

SKIP: ohci_test
===============

SKIP ohci_test (exit status: 77)

SKIP: ehci_test
===============

SKIP ehci_test (exit status: 77)

SKIP: fddboot_test
==================

SKIP fddboot_test (exit status: 77)

SKIP: netboot_test
==================

SKIP netboot_test (exit status: 77)

SKIP: pseries_test
==================

SKIP pseries_test (exit status: 77)

FAIL: grub_func_test
====================

WARNING: Image format was not specified for '/tmp/grub-shell.HeTAD8Ty3U/grub.iso' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Functional test failure: shift_test:
...
gfxterm_menu_640x480xi16:3 failed: 0xce34981e vs 0xd9f04953
 tests/video_checksum.c:checksum:615: assert failed: 0 Checksum
gfxterm_menu_640x480xi16:2 failed: 0xa8fb749d vs 0xbf3fa5d0
 tests/video_checksum.c:checksum:615: assert failed: 0 Checksum
gfxterm_menu_640x480xi16:1 failed: 0xce34981e vs 0xd9f04953
gfxterm_menu: FAIL
...
videotest_checksum:
videotest_checksum: PASS
exfctest:
exfctest: PASS
TEST FAILURE
FAIL grub_func_test (exit status: 1)

We got 2 errors:

* f2fs_test
The kernel uses 16k pages, causing failures when loading the f2fs kernel module,
see https://github.com/torvalds/linux/blob/master/fs/f2fs/super.c#L4670
This error can be ignored.

* zfs_test
zfs does not support the LoongArch architecture and is not compatible with the
6.3 kernel.
This error can be ignored.

We got 2 failures:

* hfs_test
I use recode 3.7.14-1 on Archlinux, running `recode -l` gives no output `MacRoman`,
so we get this error.
On Linux systems that support LoongArch, there is currently no need to use HFS,
so this failure can be ignored.

* grub_func_test
I don't know the reason for this failure. I guess it may be related to qemu's edk2.
In the previous review, I was told that the failure here is the expected behavior.
So, we can ignore this failure.

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
tests/ahci_test.in
tests/ehci_test.in
tests/grub_func_test.in
tests/ohci_test.in
tests/pata_test.in
tests/uhci_test.in
tests/util/grub-shell-luks-tester.in
tests/util/grub-shell.in

index 6d2e61d4eff7741be2bdc0ea808d1b7b321a25c6..70646a24ece4d63f3bd6e7525b861432df8c4db3 100644 (file)
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     mips*-arc | mips*-qemu_mips)
        exit 77;;
     # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
 esac
 
index df671b4b6a5ba129c81e2b58d0d5be298ececc3b..bf823a5de7c8883574e3c4dcb7c959c3a079c01d 100644 (file)
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     mips*-arc | mips*-qemu_mips)
        exit 77;;
     # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
 esac
 
index d43427c568b2dadd714e35f07f61b73f19bc7e0c..1fa3c435276e74206c4d4b3371ae9016163e573a 100644 (file)
@@ -12,6 +12,8 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     # PLATFORM: Max RAM is 256M
     mips-qemu_mips | mipsel-qemu_mips)
        mem=256M;;
+    loongarch64-efi)
+       mem=3G;;
     *)
        mem=512M;;
 esac
index 741ad881f71883260a97f79db1ab31158801f8da..a40d3bc0a05f9c62055eda25fdf926a092b3c0e6 100644 (file)
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     mips*-arc | mips*-qemu_mips)
        exit 77;;
     # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
 esac
 
index 31144a8fd5cde678e9de37b2b9f0d46c312fee0d..4d0e7d5731a6963f8cdf43e5e68ce27685d07dcb 100644 (file)
@@ -33,7 +33,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     i386-efi)
        exit 77;;
     # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
     i386-ieee1275)
        disk=hdb
index 5aa5eb7262678c927d10d4159ae14010457d486b..de199a28106cafc568dc80630b5c544cd8deea2e 100644 (file)
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     mips*-arc | mips*-qemu_mips)
        exit 77;;
     # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
 esac
 
index 258f043a68195743ac902438343d449e2cc5c0df..18920619a10a1818021cc3279c195769c39d70a5 100644 (file)
@@ -72,6 +72,9 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
     i386-qemu)
        disk="ata0"
        ;;
+    loongarch64-efi)
+       disk="hd1"
+       ;;
 esac
 
 # Check the arguments.
index 75f71dc1a22187d27a4be858f3e73c2db7526d22..a0ca18e41c3f19e79e53e8cb101fb4dd4a52e676 100644 (file)
@@ -208,6 +208,17 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
        disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file="
        serial_port=efi0
        ;;
+    loongarch64-efi)
+       qemu=qemu-system-loongarch64
+       boot=hd
+       console=console
+       trim=1
+       qemuopts="-machine virt -cpu la464-loongarch-cpu -smp 4 -nographic -m 3G \
+                 -bios QEMU_EFI.fd -L ${srcdir} -L /usr/share/edk2/loongarch64  \
+                 -L /usr/share/qemu-efi-loongarch64 $qemuopts"
+       disk="device virtio-blk-pci,drive=hd1 -drive if=none,id=hd1,file="
+       serial_port=
+       ;;
     *)
        boot=hd
        qemu=qemu-system-i386
@@ -423,6 +434,8 @@ fi
 if [ x$boot = xhd ]; then
     if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then
        device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file="
+    elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = loongarch64-efi ]; then
+       device="device virtio-blk-pci,drive=grubdisk -drive if=none,id=grubdisk,file="
     elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then
        device="hdb "
     else
@@ -433,6 +446,8 @@ fi
 if [ x$boot = xcd ]; then
     if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then
        device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file="
+    elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = loongarch64-efi ]; then
+       device="device virtio-blk-pci,drive=grubcd -drive if=none,id=grubcd,media=cdrom,file="
     elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then
        device="-drive if=ide,media=cdrom,file="
     else