On Fri, 19 Sep 2025 15:45:03 -0600
Leo Sandoval via Grub-devel <[email protected]> wrote:

> There is no reason to fail a test if the required testing tool is not
> present on the system, so skip the test instead of failing it.

TLDR; This should be reverted.

Wow, this got accepted too. I am disappointed.

I'm going to be blunt here. Yes, I am very opinionated on this
matter and this is not personal. Also, I'm not happy this got included.
I had to fend off Ubuntu wanting to make these same changes a couple
years ago[1]. Unfortunately, I didn't catch this in time.

There is definitely a good reason to "fail a test if the required
testing tool is not present on the system". And just because someone at
some distro who got recently tasked with "fixing _their_ failing tests"
can't think of a good reason doesn't mean there isn't one. In fact,
it should be a huge red-flag to anyone looking at any system that they
have little experience with to think "there's not reason for ___, I'm
going to change that". That should be a cue to ask "hmm, why was this
used?" Its quite another matter to desire to change something because
one understands why its there and its limitations.

Let me copy verbatim part of the referenced reply, but I strongly
encourage you to read it in its entirety as I believe all of it applies
to this situation and has more in-depth explanation:

> Let me be clear here, the purpose of GRUB tests is not so distros can
> run half of them after the build to see if it passes the smell test.
> The purpose of the tests are primarily to test regressions and
> functionality. To that end, the less tests that are run, the less
> useful the test suite. So the testing system should be implemented to
> try to run as many tests as possible and clearly note where tests are
> not being run. Of course, you're free to run tests how ever you want,
> but that does not mean that the GRUB project should support it,
> especially when its in conflict with the interests of the project.

GRUB and some distros have divergent interests. Apparently some distros
want tests that do not fail and will sacrifice testing coverage in order
to make that happen. I'm tempted to ask, why run the tests at all? But
anyway that's their prerogative. GRUB is not telling them how they
should package GRUB and what patches they should include. Neither
should GRUB be accepting patches that are only in the "interests" of
distros.
</rant>

Glenn

[1]
https://lore.kernel.org/grub-devel/20230719180355.73e1b480@crass-HP-ZBook-15-G2/

> 
> Signed-off-by: Leo Sandoval <[email protected]>
> ---
>  tests/btrfs_test.in              | 2 +-
>  tests/cpio_test.in               | 2 +-
>  tests/erofs_test.in              | 2 +-
>  tests/exfat_test.in              | 2 +-
>  tests/ext234_test.in             | 6 +++---
>  tests/f2fs_test.in               | 2 +-
>  tests/fat_test.in                | 2 +-
>  tests/grub_cmd_cryptomount.in    | 4 ++--
>  tests/gzcompress_test.in         | 2 +-
>  tests/hfs_test.in                | 2 +-
>  tests/hfsplus_test.in            | 2 +-
>  tests/iso9660_test.in            | 2 +-
>  tests/jfs_test.in                | 2 +-
>  tests/luks1_test.in              | 4 ++--
>  tests/luks2_test.in              | 4 ++--
>  tests/lzocompress_test.in        | 2 +-
>  tests/minixfs_test.in            | 2 +-
>  tests/nilfs2_test.in             | 2 +-
>  tests/ntfs_test.in               | 4 ++--
>  tests/partmap_test.in            | 2 +-
>  tests/reiserfs_test.in           | 2 +-
>  tests/romfs_test.in              | 2 +-
>  tests/squashfs_test.in           | 2 +-
>  tests/tar_test.in                | 2 +-
>  tests/tpm2_key_protector_test.in | 4 ++--
>  tests/udf_test.in                | 2 +-
>  tests/xfs_test.in                | 2 +-
>  tests/xzcompress_test.in         | 2 +-
>  tests/zfs_test.in                | 2 +-
>  29 files changed, 36 insertions(+), 36 deletions(-)
> 
> diff --git a/tests/btrfs_test.in b/tests/btrfs_test.in
> index 0d098c9a27..a07d2e5d18 100644
> --- a/tests/btrfs_test.in
> +++ b/tests/btrfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.btrfs >/dev/null 2>&1; then
>     echo "mkfs.btrfs not installed; cannot test btrfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" btrfs
> diff --git a/tests/cpio_test.in b/tests/cpio_test.in
> index e2e668cf6b..5742cf17b9 100644
> --- a/tests/cpio_test.in
> +++ b/tests/cpio_test.in
> @@ -4,7 +4,7 @@ set -e
>  
>  if ! which cpio >/dev/null 2>&1; then
>     echo "cpio not installed; cannot test cpio."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" cpio_bin
> diff --git a/tests/erofs_test.in b/tests/erofs_test.in
> index 51111627ac..436468dac6 100644
> --- a/tests/erofs_test.in
> +++ b/tests/erofs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.erofs >/dev/null 2>&1; then
>     echo "mkfs.erofs not installed; cannot test erofs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" erofs_compact
> diff --git a/tests/exfat_test.in b/tests/exfat_test.in
> index 7939f25d27..7acde1977e 100644
> --- a/tests/exfat_test.in
> +++ b/tests/exfat_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.exfat >/dev/null 2>&1; then
>     echo "mkfs.exfat not installed; cannot test exFAT."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" exfat
> diff --git a/tests/ext234_test.in b/tests/ext234_test.in
> index 4df696710d..c9a8c1056a 100644
> --- a/tests/ext234_test.in
> +++ b/tests/ext234_test.in
> @@ -12,17 +12,17 @@ fi
>  
>  if ! which mkfs.ext2 >/dev/null 2>&1; then
>     echo "mkfs.ext2 not installed; cannot test ext2."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which mkfs.ext3 >/dev/null 2>&1; then
>     echo "mkfs.ext3 not installed; cannot test ext3."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which mkfs.ext4 >/dev/null 2>&1; then
>     echo "mkfs.ext4 not installed; cannot test ext4."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" ext2_old
> diff --git a/tests/f2fs_test.in b/tests/f2fs_test.in
> index 85f8cc8bc3..a020a0f96d 100644
> --- a/tests/f2fs_test.in
> +++ b/tests/f2fs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.f2fs >/dev/null 2>&1; then
>   echo "mkfs.f2fs not installed; cannot test f2fs."
> - exit 99
> + exit 77
>  fi
>  
>  
> diff --git a/tests/fat_test.in b/tests/fat_test.in
> index 8a2b37c5c6..77e3f16c67 100644
> --- a/tests/fat_test.in
> +++ b/tests/fat_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.vfat >/dev/null 2>&1; then
>     echo "mkfs.vfat not installed; cannot test FAT."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" vfat16a
> diff --git a/tests/grub_cmd_cryptomount.in b/tests/grub_cmd_cryptomount.in
> index eaa187efad..25d7d8c368 100644
> --- a/tests/grub_cmd_cryptomount.in
> +++ b/tests/grub_cmd_cryptomount.in
> @@ -27,12 +27,12 @@ fi
>  
>  if ! which cryptsetup >/dev/null 2>&1; then
>     echo "cryptsetup not installed; cannot test cryptomount."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which mkfs.vfat >/dev/null 2>&1; then
>     echo "mkfs.vfat not installed; cannot test cryptomount."
> -   exit 99
> +   exit 77
>  fi
>  
>  COMMON_OPTS='${V:+--debug=$V} --cs-opts="--pbkdf-force-iterations 1000"'
> diff --git a/tests/gzcompress_test.in b/tests/gzcompress_test.in
> index 8e7e6a6335..d7a594bb2c 100644
> --- a/tests/gzcompress_test.in
> +++ b/tests/gzcompress_test.in
> @@ -21,7 +21,7 @@ grubshell=@builddir@/grub-shell
>  
>  if ! which gzip >/dev/null 2>&1; then
>     echo "gzip not installed; cannot test gzip compression."
> -   exit 99
> +   exit 77
>  fi
>  
>  v=$(echo hello | "${grubshell}" --mkrescue-arg=--compress=gz)
> diff --git a/tests/hfs_test.in b/tests/hfs_test.in
> index 960f1cbd0f..c916b9bac9 100644
> --- a/tests/hfs_test.in
> +++ b/tests/hfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.hfs >/dev/null 2>&1; then
>     echo "mkfs.hfs not installed; cannot test HFS."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! grep -q mac_roman /proc/modules && ! modprobe mac_roman; then
> diff --git a/tests/hfsplus_test.in b/tests/hfsplus_test.in
> index f727cf0e2e..cb36a3661c 100644
> --- a/tests/hfsplus_test.in
> +++ b/tests/hfsplus_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.hfsplus >/dev/null 2>&1; then
>     echo "mkfs.hfsplus not installed; cannot test hfsplus."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" hfsplus
> diff --git a/tests/iso9660_test.in b/tests/iso9660_test.in
> index a1f752adfa..793664c874 100644
> --- a/tests/iso9660_test.in
> +++ b/tests/iso9660_test.in
> @@ -4,7 +4,7 @@ set -e
>  
>  if ! which xorriso >/dev/null 2>&1; then
>     echo "xorriso not installed; cannot test iso9660."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" joliet
> diff --git a/tests/jfs_test.in b/tests/jfs_test.in
> index d13780e230..86f9ebeaa0 100644
> --- a/tests/jfs_test.in
> +++ b/tests/jfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.jfs >/dev/null 2>&1; then
>     echo "mkfs.jfs not installed; cannot test JFS."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" jfs
> diff --git a/tests/luks1_test.in b/tests/luks1_test.in
> index cd28fd7149..0bfb53c98c 100644
> --- a/tests/luks1_test.in
> +++ b/tests/luks1_test.in
> @@ -12,12 +12,12 @@ fi
>  
>  if ! which mkfs.ext2 >/dev/null 2>&1; then
>     echo "mkfs.ext2 not installed; cannot test luks."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which cryptsetup >/dev/null 2>&1; then
>     echo "cryptsetup not installed; cannot test luks."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" luks1
> diff --git a/tests/luks2_test.in b/tests/luks2_test.in
> index 6a26ba6266..49db47380e 100644
> --- a/tests/luks2_test.in
> +++ b/tests/luks2_test.in
> @@ -12,12 +12,12 @@ fi
>  
>  if ! which mkfs.ext2 >/dev/null 2>&1; then
>     echo "mkfs.ext2 not installed; cannot test luks2."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which cryptsetup >/dev/null 2>&1; then
>     echo "cryptsetup not installed; cannot test luks2."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" luks2
> diff --git a/tests/lzocompress_test.in b/tests/lzocompress_test.in
> index 915f74bd9f..42e270df02 100644
> --- a/tests/lzocompress_test.in
> +++ b/tests/lzocompress_test.in
> @@ -21,7 +21,7 @@ grubshell=@builddir@/grub-shell
>  
>  if ! which lzop >/dev/null 2>&1; then
>     echo "lzop not installed; cannot test lzo compression."
> -   exit 99
> +   exit 77
>  fi
>  
>  v=$(echo hello | "${grubshell}" --mkrescue-arg=--compress=lzo)
> diff --git a/tests/minixfs_test.in b/tests/minixfs_test.in
> index c62f56c8b4..78577fec8c 100644
> --- a/tests/minixfs_test.in
> +++ b/tests/minixfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.minix >/dev/null 2>&1; then
>     echo "mkfs.minix not installed; cannot test minixfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! mkfs.minix -h | grep -- -v > /dev/null; then
> diff --git a/tests/nilfs2_test.in b/tests/nilfs2_test.in
> index 8cc93754cd..719972f53f 100644
> --- a/tests/nilfs2_test.in
> +++ b/tests/nilfs2_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.nilfs2 >/dev/null 2>&1; then
>     echo "mkfs.nilfs2 not installed; cannot test nilfs2."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" nilfs2
> diff --git a/tests/ntfs_test.in b/tests/ntfs_test.in
> index c2b08d27f8..da73c59f9e 100644
> --- a/tests/ntfs_test.in
> +++ b/tests/ntfs_test.in
> @@ -12,12 +12,12 @@ fi
>  
>  if ! which mkfs.ntfs >/dev/null 2>&1; then
>     echo "mkfs.ntfs not installed; cannot test ntfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! which setfattr >/dev/null 2>&1; then
>     echo "setfattr not installed; cannot test ntfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" ntfs
> diff --git a/tests/partmap_test.in b/tests/partmap_test.in
> index 4138e88fe9..9810cc1acc 100644
> --- a/tests/partmap_test.in
> +++ b/tests/partmap_test.in
> @@ -100,7 +100,7 @@ esac
>  
>  if ! which ${parted} >/dev/null 2>&1; then
>     echo "${parted} not installed; cannot test partmap"
> -   exit 99
> +   exit 77
>  fi
>  
>  imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
> diff --git a/tests/reiserfs_test.in b/tests/reiserfs_test.in
> index 37226c01b7..36e34c3050 100644
> --- a/tests/reiserfs_test.in
> +++ b/tests/reiserfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.reiserfs >/dev/null 2>&1; then
>     echo "mkfs.reiserfs not installed; cannot test reiserfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" reiserfs
> diff --git a/tests/romfs_test.in b/tests/romfs_test.in
> index f968e9b7db..98bb50c324 100644
> --- a/tests/romfs_test.in
> +++ b/tests/romfs_test.in
> @@ -4,7 +4,7 @@ set -e
>  
>  if ! which genromfs >/dev/null 2>&1; then
>     echo "genromfs not installed; cannot test romfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" romfs
> diff --git a/tests/squashfs_test.in b/tests/squashfs_test.in
> index 15e70218f2..2f044f95d9 100644
> --- a/tests/squashfs_test.in
> +++ b/tests/squashfs_test.in
> @@ -4,7 +4,7 @@ set -e
>  
>  if ! which mksquashfs >/dev/null 2>&1; then
>     echo "mksquashfs not installed; cannot test squashfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" squash4_gzip
> diff --git a/tests/tar_test.in b/tests/tar_test.in
> index 97944b2433..6e2f2de8b7 100644
> --- a/tests/tar_test.in
> +++ b/tests/tar_test.in
> @@ -4,7 +4,7 @@ set -e
>  
>  if ! which tar >/dev/null 2>&1; then
>     echo "tar not installed; cannot test tar."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" tarfs
> diff --git a/tests/tpm2_key_protector_test.in 
> b/tests/tpm2_key_protector_test.in
> index 1d80d5d260..6853434adc 100644
> --- a/tests/tpm2_key_protector_test.in
> +++ b/tests/tpm2_key_protector_test.in
> @@ -41,7 +41,7 @@ fi
>  
>  if ! command -v cryptsetup >/dev/null 2>&1; then
>     echo "cryptsetup not installed; cannot test tpm2."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! grep -q tpm_vtpm_proxy /proc/modules && ! modprobe tpm_vtpm_proxy; then
> @@ -51,7 +51,7 @@ fi
>  
>  if ! command -v swtpm >/dev/null 2>&1; then
>     echo "swtpm not installed; cannot test tpm2."
> -   exit 99
> +   exit 77
>  fi
>  
>  if ! command -v tpm2_startup >/dev/null 2>&1; then
> diff --git a/tests/udf_test.in b/tests/udf_test.in
> index 302b28ab26..8968fb1033 100644
> --- a/tests/udf_test.in
> +++ b/tests/udf_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkudffs >/dev/null 2>&1; then
>     echo "mkudffs not installed; cannot test UDF."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" udf
> diff --git a/tests/xfs_test.in b/tests/xfs_test.in
> index 5e029c1827..8a648aa4a7 100644
> --- a/tests/xfs_test.in
> +++ b/tests/xfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which mkfs.xfs >/dev/null 2>&1; then
>     echo "mkfs.xfs not installed; cannot test xfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  
> diff --git a/tests/xzcompress_test.in b/tests/xzcompress_test.in
> index 6ef73e41e8..cfc6ccba66 100644
> --- a/tests/xzcompress_test.in
> +++ b/tests/xzcompress_test.in
> @@ -21,7 +21,7 @@ grubshell=@builddir@/grub-shell
>  
>  if ! which xz >/dev/null 2>&1; then
>     echo "xz not installed; cannot test xz compression."
> -   exit 99
> +   exit 77
>  fi
>  
>  v=$(echo hello | "${grubshell}" --mkrescue-arg=--compress=xz)
> diff --git a/tests/zfs_test.in b/tests/zfs_test.in
> index 0d0a57f7d0..c8bb7937fe 100644
> --- a/tests/zfs_test.in
> +++ b/tests/zfs_test.in
> @@ -12,7 +12,7 @@ fi
>  
>  if ! which zpool >/dev/null 2>&1; then
>     echo "zpool not installed; cannot test zfs."
> -   exit 99
> +   exit 77
>  fi
>  
>  "@builddir@/grub-fs-tester" zfs

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to