grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases


From: Xiaotian Wu
Subject: Re: [PATCH v14 10/10] tests: Add LoongArch to various test cases
Date: Fri, 14 Apr 2023 12:12:24 +0800
User-agent: Evolution 3.46.4

在 2023-04-12星期三的 05:54 -0300,Glenn Washburn写道:
> On 4/11/23 03:02, Xiaotian Wu wrote:
> > 在 2023-04-10星期一的 15:58 +0800,Xiaotian Wu写道:
> > > 在 2023-04-10星期一的 15:36 +0800,Xiaotian Wu写道:
> > > > 在 2023-04-10星期一的 03:20 -0300,Glenn Washburn写道:
> > > > > On 4/8/23 02:05, Xiaotian Wu wrote:
> > > > > > The test results of running "make check" with qemu 7.2 are
> > > > > > as
> > > > > > follows:
> > > > > >    
> > > > > > ===========================================================
> > > > > > ====
> > > > > > ==
> > > > > > ==
> > > > > > =========
> > > > > >     Testsuite summary for GRUB 2.11
> > > > > >    
> > > > > > ===========================================================
> > > > > > ====
> > > > > > ==
> > > > > > ==
> > > > > > =========
> > > > > >     # TOTAL: 85
> > > > > >     # PASS:  57
> > > > > >     # SKIP:  8
> > > > > >     # XFAIL: 0
> > > > > >     # FAIL:  1
> > > > > >     # XPASS: 0
> > > > > >     # ERROR: 19
> > > > > >    
> > > > > > ===========================================================
> > > > > > ====
> > > > > > ==
> > > > > > ==
> > > > > > =========
> > > > > > 
> > > > > > These ERROR cases need to be run as root user:
> > > > > >     ERROR: ext234_test
> > > > > >     ERROR: hfsplus_test
> > > > > >     ERROR: ntfs_test
> > > > > >     ERROR: reiserfs_test
> > > > > >     ERROR: fat_test
> > > > > >     ERROR: minixfs_test
> > > > > >     ERROR: xfs_test
> > > > > >     ERROR: f2fs_test
> > > > > >     ERROR: nilfs2_test
> > > > > >     ERROR: romfs_test
> > > > > >     ERROR: exfat_test
> > > > > >     ERROR: udf_test
> > > > > >     ERROR: hfs_test
> > > > > >     ERROR: jfs_test
> > > > > >     ERROR: btrfs_test
> > > > > >     ERROR: zfs_test
> > > > > >     ERROR: luks1_test
> > > > > >     ERROR: luks2_test
> > > > > >     ERROR: grub_cmd_cryptomount
> > > > > 
> > > > > It would be great if you would follow the instructions in the
> > > > > INSTALL
> > > > > file to install the appropriate dependencies and to run the
> > > > > tests
> > > > > as
> > > > > root. Are you suggesting that you do not have access to the
> > > > > root
> > > > > user?
> > > > I can try to retest with root, but maybe the test case will
> > > > fail.
> > 
> > I re-run the test program with sudo, the results of these 19 test
> > cases
> > are: 10 passed, 5 errors, 4 failed.
> > 
> > The 10 passed use cases are:
> > PASS: ext234_test
> > PASS: ntfs_test
> > PASS: reiserfs_test
> > PASS: xfs_test
> > PASS: nilfs2_test
> > PASS: udf_test
> > PASS: jfs_test
> > PASS: btrfs_test
> > PASS: luks1_test
> > PASS: luks2_test
> > 
> > The 5 error cases are:
> > ERROR: minixfs_test
> > ERROR: f2fs_test
> > ERROR: romfs_test
> > ERROR: hfs_test
> > ERROR: zfs_test
> > 
> > minixfs_test: The kernel is not configured with minix file system
> > support.
> > f2fs_test: The kernel is not configured with f2fs file system
> > support.
> > romfs_test: No package provides "genromfs" on Archlinux.
> > hfs_test:  No package provides "mkfs.hfs" on Archlinux.
> 
> This is one reason why the tests officially only support being run on
> Debian systems. I leave it up to you or whoever maintains LoongArch 
> support to decide if you care about these tests, as these aren't 
> commonly used filesystems.
> 
I think the testing of these filesystems can be ignored for now so that
we can merge the patches first. After LoongArch for debian is ready,
let's test these filesystems again.

> > zfs_test: zfs has not been ported to the LoongArch architecture
> > yet.
> > 
> > The 4 failed cases are:
> > FAIL: hfsplus_test
> > FAIL: fat_test
> > FAIL: exfat_test
> > FAIL: grub_cmd_cryptomount
> > 
> > hfsplus_test:
> > I use hfsprogs-540.1.linux3-4, the log is:
> > mkfs.hfsplus: invalid option -- 'w'
> 
> This is strange. That version number is the same as the package
> version 
> on the Debian test machine I'm using and it does allow the -w option 
> (which has this as the help string "add a HFS wrapper (i.e. Native
> Mac 
> OS 9 bootable)"). I don't if that's a compile-time option that Arch 
> doesn't enable or maybe the Debian package has extra patches adding
> that 
> option.

Yes, the debian distribution has a patch[1] to adds the "-w" option.
https://salsa.debian.org/debian/hfsprogs/-/blob/debian/540.1.linux3-5/debian/patches/0005-Re-add-support-for-creating-legacy-HFS-filesystems.patch#L1069

> 
> > 
> > fat_test:
> > The log is:
> > cp: error writing '/tmp/grub-fs-
> > tester.20230410181941249964440.vfat12a.1g8/vfat12a_rw//american-
> > english': No space left on device
> 
> You ran out of disk space on /tmp. Can you allocate more space for
> the 
> tests?

The reason is not that "/tmp" is not big enough, I allocate 10g space
to it and still get error.
The reason for the failure is that the "/usr/share/dict/american-
english" file is too large to be saved in the fat12 partition. The
total size of this partition is 1.5M, and 330K has been used, and the
available space is 1.2M, while "american -english" file size is also
1.2M.

This test passes if I remove some lines from the
"/usr/share/dict/american-english" file.

The details are as follows:

+ df -lhT                                                             
Filesystem     Type      Size  Used Avail Use% Mounted on             
 /dev/loop0     vfat      1.5M  330K  1.2M  23% /tmp/grub-fs-
tester.20230414113447214459379.vfat12a.yx9/vfat12a_rw
+ ls -lh /tmp/grub-fs-
tester.20230414113447214459379.vfat12a.yx9/vfat12a_rw//    
total 129K                                                            
drwxr-xr-x 3 root root 512 Apr 14 11:34 0                             
-rwxr-xr-x 1 root root 32K Apr 14 11:34 1.img                         
-rwxr-xr-x 1 root root 32K Apr 14 11:34 CaSe                          
-rwxr-xr-x 1 root root 32K Apr 14 11:34
qwertzuiopasdfghjklyxcvbnm1234567890qwertzuiopasdfghjklyxcvbnm123456789
0oiewqfiewioqoiqoiurqruewqoiuwoieoiiuewqroreqiufieiuwrnureweriuvceoiroi
ewqoiricdsalkcndsakfirefoiwqeoircorejwoijfreoijojoiewjfwnfcoirenfoirefn
reoifenoiwfnoi
drwxr-xr-x 2 root root 512 Apr 14 11:34 sdir                          
-rwxr-xr-x 1 root root 32K Apr 14 11:34 éàèüöäëñкирилица䏌䐓䏕Ελληνικά䏌䐓䏕
+ ls -lh /usr/share/dict/american-english                             
-rw-r--r-- 1 root root 1.2M Apr 14 11:30 /usr/share/dict/american-
english        
+ cp /usr/share/dict/american-english /tmp/grub-fs-
tester.20230414113447214459379.vfat12a.yx9/vfat12a_rw//american-english
cp: error writing '/tmp/grub-fs-
tester.20230414113447214459379.vfat12a.yx9/vfat12a_rw//american-
english': No space left on device


> 
> > exfat_test:
> > The log give me the usage of "mkfs.exfat", it seems the
> > "mkfs.exfat"
> > command does not support "-s" "-n" arguments.
> 
> I'm noticing now that the INSTALL is incorrect. You should be using
> the 
> exfat-utils package not exfatprogs. Could this explain why you're 
> getting this error?

Thanks, this test passes when I use "exfat-utils" .

> > grub_cmd_cryptomount:
> > The log is:
> > Error[1]: WARNING: Image format was not specified for '/tmp/grub-
> > shell.2fRnxAhNbU/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.
> > error: test not verified [cryptomount failed: 2]
> > LUKS1 test cryptsetup defaults: FAIL
> > FAIL grub_cmd_cryptomount (exit status: 1)
> 
> For this it would be useful to have a shell trace of the test run.
> One 
> way to get that is to add the line "set -x" to the second line of 
> tests/grub_cmd_cryptomount.in.
> 

If I modify the "grub-shell-luks-tester.in" file to let disk="hd1" or
use the following patch, this test can pass. But I don't understand why
it works.

--- a/tests/util/grub-shell-luks-tester.in
+++ b/tests/util/grub-shell-luks-tester.in
@@ -72,6 +73,9 @@ case "${grub_modinfo_target_cpu}-
${grub_modinfo_platform}" in
     i386-qemu)
        disk="ata0"
        ;;
+    loongarch64-efi)
+       disk="hd1"
+       ;;
 esac
 
 # Check the arguments.


> Glenn
> 
> > 
> > 
> > 
> > > > 
> > > > > > 
> > > > > > These test cases are skipped:
> > > > > >     SKIP: pata_test
> > > > > >     SKIP: ahci_test
> > > > > >     SKIP: uhci_test
> > > > > >     SKIP: ohci_test
> > > > > >     SKIP: ehci_test
> > > > > >     SKIP: fddboot_test
> > > > > >     SKIP: netboot_test
> > > > > >     SKIP: pseries_test
> > > > > > 
> > > > > > This test case fails because of: qemu-system-loongarch64:
> > > > > > ram_size
> > > > > > must be greater than 1G.
> > > > > >     FAIL: grub_func_test
> > > > > 
> > > > > This sounds strange to me because you give QEMU 4G of memory
> > > > > in
> > > > > grub-shell (see below). Are you saying that you ran the tests
> > > > > on
> > > > > a
> > > > > system with 1G or less of memory?
> > > > > 
> > > > Yes, I set the memory to 4G, but on line 16 of the
> > > > "tests/grub_func_test.in" file, it is reset to 512M.
> > > After modifying "test/grub_func_test.in", I made a test, but it
> > > failed,
> > > the log is below, I'm not sure if it's related to grub, please
> > > check,
> > > thanks.
> > > 
> > > https://gist.github.com/yetist/7abfb78b84f06dc198148ce6e344d7bb
> > > 
> > > > 
> > > > > > 
> > > > > > Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
> > > > > > ---
> > > > > >    tests/ahci_test.in       |  2 +-
> > > > > >    tests/ehci_test.in       |  2 +-
> > > > > >    tests/ohci_test.in       |  2 +-
> > > > > >    tests/pata_test.in       |  2 +-
> > > > > >    tests/uhci_test.in       |  2 +-
> > > > > >    tests/util/grub-shell.in | 14 ++++++++++++++
> > > > > >    6 files changed, 19 insertions(+), 5 deletions(-)
> > > > > > 
> > > > > > diff --git a/tests/ahci_test.in b/tests/ahci_test.in
> > > > > > index 6d2e61d4e..70646a24e 100644
> > > > > > --- a/tests/ahci_test.in
> > > > > > +++ b/tests/ahci_test.in
> > > > > > @@ -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
> > > > > >    
> > > > > > diff --git a/tests/ehci_test.in b/tests/ehci_test.in
> > > > > > index df671b4b6..bf823a5de 100644
> > > > > > --- a/tests/ehci_test.in
> > > > > > +++ b/tests/ehci_test.in
> > > > > > @@ -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
> > > > > >    
> > > > > > diff --git a/tests/ohci_test.in b/tests/ohci_test.in
> > > > > > index 741ad881f..a40d3bc0a 100644
> > > > > > --- a/tests/ohci_test.in
> > > > > > +++ b/tests/ohci_test.in
> > > > > > @@ -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
> > > > > >    
> > > > > > diff --git a/tests/pata_test.in b/tests/pata_test.in
> > > > > > index 31144a8fd..4d0e7d573 100644
> > > > > > --- a/tests/pata_test.in
> > > > > > +++ b/tests/pata_test.in
> > > > > > @@ -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
> > > > > > diff --git a/tests/uhci_test.in b/tests/uhci_test.in
> > > > > > index 5aa5eb726..de199a281 100644
> > > > > > --- a/tests/uhci_test.in
> > > > > > +++ b/tests/uhci_test.in
> > > > > > @@ -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
> > > > > >    
> > > > > > diff --git a/tests/util/grub-shell.in b/tests/util/grub-
> > > > > > shell.in
> > > > > > index 75f71dc1a..bbeb63ef4 100644
> > > > > > --- a/tests/util/grub-shell.in
> > > > > > +++ b/tests/util/grub-shell.in
> > > > > > @@ -208,6 +208,16 @@ 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 4G \
> > > > > > +                 -bios
> > > > > > /usr/share/edk2/loongarch64/QEMU_CODE.fd
> > > > > > $qemuopts"
> > > > > 
> > > > > The tests are only officially supported on Debian. So is this
> > > > > firmware
> > > > > file installed from a Debian package? If so what is the
> > > > > package
> > > > > name
> > > > > and
> > > > > what apt repository is it located?
> > > > 
> > > > I did a local test on archlinux, the package is "edk2-
> > > > loongarch64",
> > > > the
> > > > installation directory refers to the packaging rules of fedora
> > > > and
> > > > archlinux, it will be installed in the
> > > > "/usr/share/edk2/<arch>/"
> > > > directory.
> > > > 
> > > > edk2-aarch64 on fedora:
> > > > https://koji.fedoraproject.org/koji/rpminfo?rpmID=33833091
> > > > edk2-riscv64 on fedora:
> > > > https://koji.fedoraproject.org/koji/rpminfo?rpmID=33833092
> > > > 
> > > > edk2-aarch64 on archlinux:
> > > > https://archlinux.org/packages/extra/any/edk2-aarch64/
> > > > edk2-arm on archlinux:
> > > > https://archlinux.org/packages/extra/any/edk2-arm/
> > > > edk2-loongarch64 on archlinux:
> > > > https://mirrors.wsyu.edu.cn/loongarch/archlinux/extra/os/loong64/edk2-loongarch64-202211-4-any.pkg.tar.zst
> > > > 
> > > 
> > > debian doesn't support LoongArch yet, maybe I should use "-L" to
> > > load
> > > "QEMU_CODE.fd" from the current directory as in previous
> > > versions?
> > > > > 
> > > > > Glenn
> > > > > 
> > > > > > +       disk="device virtio-blk-pci,drive=hd1 -drive
> > > > > > if=none,id=hd1,file="
> > > > > > +       serial_port=
> > > > > > +       ;;
> > > > > >        *)
> > > > > >          boot=hd
> > > > > >          qemu=qemu-system-i386
> > > > > > @@ -423,6 +433,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 +445,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
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > Grub-devel mailing list
> > > > > Grub-devel@gnu.org
> > > > > https://lists.gnu.org/mailman/listinfo/grub-devel
> > > > 
> > > 
> > 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel

-- 
Best Regards
Xiaotian Wu




reply via email to

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