* [PATCH v3 1/4] tests: Add set -e to missing tests
2021-10-07 20:33 [PATCH v3 0/4] Various fixes/improvements for tests Glenn Washburn
@ 2021-10-07 20:33 ` Glenn Washburn
2021-10-11 14:04 ` Daniel Kiper
2021-10-07 20:33 ` [PATCH v3 2/4] tests: Do not occlude subshell error codes Glenn Washburn
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Glenn Washburn @ 2021-10-07 20:33 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Glenn Washburn
This helps to ensure that error codes do not get ignored.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/grub_cmd_test.in | 1 +
tests/grub_script_blockarg.in | 1 +
tests/test_sha512sum.in | 1 +
3 files changed, 3 insertions(+)
diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.in
index 20473b62d..043c3a634 100644
--- a/tests/grub_cmd_test.in
+++ b/tests/grub_cmd_test.in
@@ -1,4 +1,5 @@
#! @BUILD_SHEBANG@
+set -e
# create a randome file
empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/grub_script_blockarg.in b/tests/grub_script_blockarg.in
index 3739a95e3..a91c7ca82 100644
--- a/tests/grub_script_blockarg.in
+++ b/tests/grub_script_blockarg.in
@@ -1,4 +1,5 @@
#! @BUILD_SHEBANG@
+set -e
# Run GRUB script in a Qemu instance
# Copyright (C) 2010 Free Software Foundation, Inc.
diff --git a/tests/test_sha512sum.in b/tests/test_sha512sum.in
index 65953153f..b2bd89609 100644
--- a/tests/test_sha512sum.in
+++ b/tests/test_sha512sum.in
@@ -1,4 +1,5 @@
#! @BUILD_SHEBANG@
+set -e
# create a randome file
file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
--
2.27.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v3 2/4] tests: Do not occlude subshell error codes
2021-10-07 20:33 [PATCH v3 0/4] Various fixes/improvements for tests Glenn Washburn
2021-10-07 20:33 ` [PATCH v3 1/4] tests: Add set -e to missing tests Glenn Washburn
@ 2021-10-07 20:33 ` Glenn Washburn
2021-10-11 14:20 ` Daniel Kiper
2021-10-07 20:33 ` [PATCH v3 3/4] tests: Do not occlude grub-shell return code Glenn Washburn
2021-10-07 20:33 ` [PATCH v3 4/4] tests: Exit with skipped exit code when test not performed Glenn Washburn
3 siblings, 1 reply; 12+ messages in thread
From: Glenn Washburn @ 2021-10-07 20:33 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Glenn Washburn
When a subshell's output is used as input to a "simple command", its return
code is not checked. These subshells contain an execution of the grub-shell
script which does the work of the actual test. If grub-shell returns an
error code, the test should fail. So refactor to not have the subshell which
contains grub-shell be direct input into a simple command (usually the test
command). Mostly this is accomplished by having the output first go to a
shell variable, and then using the shell variable in the simple command.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/ahci_test.in | 7 ++++++-
tests/cdboot_test.in | 3 ++-
tests/core_compress_test.in | 6 ++++--
tests/ehci_test.in | 7 ++++++-
tests/fddboot_test.in | 3 ++-
tests/gzcompress_test.in | 3 ++-
tests/hddboot_test.in | 3 ++-
tests/lzocompress_test.in | 3 ++-
tests/netboot_test.in | 3 ++-
tests/ohci_test.in | 7 ++++++-
tests/pata_test.in | 3 ++-
tests/uhci_test.in | 7 ++++++-
tests/xzcompress_test.in | 3 ++-
13 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/tests/ahci_test.in b/tests/ahci_test.in
index 9b1d85df4..1e4e3e443 100644
--- a/tests/ahci_test.in
+++ b/tests/ahci_test.in
@@ -41,7 +41,12 @@ echo "hello" > "$outfile"
tar cf "$imgfile" "$outfile"
-if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then
+v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
+ "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
+ -device ahci,id=ahci
+ -device ide-hd,drive=disk,bus=ahci.0" |
+ tail -n 1)
+if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
exit 1
diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
index 75acdfedb..7229f79fb 100644
--- a/tests/cdboot_test.in
+++ b/tests/cdboot_test.in
@@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
exit 0;;
esac
-if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --boot=cd`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in
index 9d216ebcf..90dd00607 100644
--- a/tests/core_compress_test.in
+++ b/tests/core_compress_test.in
@@ -27,10 +27,12 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
esac
-if [ "$(echo hello | "${grubshell}" --grub-mkimage-extra=--compress=xz)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --grub-mkimage-extra=--compress=xz`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
-if [ "$(echo hello | "${grubshell}" --grub-mkimage-extra=--compress=none)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --grub-mkimage-extra=--compress=none`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
index b20c09f0f..115e64e29 100644
--- a/tests/ehci_test.in
+++ b/tests/ehci_test.in
@@ -41,7 +41,12 @@ echo "hello" > "$outfile"
tar cf "$imgfile" "$outfile"
-if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-device ich9-usb-ehci1 -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then
+v=$(echo "nativedisk; source '(usb0)/$outfile';" |
+ "${grubshell}" --qemu-opts="-device ich9-usb-ehci1
+ -drive id=my_usb_disk,file=$imgfile,if=none
+ -device usb-storage,drive=my_usb_disk" |
+ tail -n 1)
+if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
exit 1
diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in
index 2d7dfc889..1bbe60ee5 100644
--- a/tests/fddboot_test.in
+++ b/tests/fddboot_test.in
@@ -46,6 +46,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
exit 0;;
esac
-if [ "$(echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad")" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad"`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/gzcompress_test.in b/tests/gzcompress_test.in
index 42c8fe7c4..572b2a1a5 100644
--- a/tests/gzcompress_test.in
+++ b/tests/gzcompress_test.in
@@ -24,6 +24,7 @@ if ! which gzip >/dev/null 2>&1; then
exit 77
fi
-if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=gz)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --mkrescue-arg=--compress=gz`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in
index 6d70847a5..abe3e0ae1 100644
--- a/tests/hddboot_test.in
+++ b/tests/hddboot_test.in
@@ -31,7 +31,8 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
exit 0;;
esac
-if [ "$(echo hello | "${grubshell}" --boot=hd)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --boot=hd`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/lzocompress_test.in b/tests/lzocompress_test.in
index 4e5f7e078..8f08a8046 100644
--- a/tests/lzocompress_test.in
+++ b/tests/lzocompress_test.in
@@ -24,6 +24,7 @@ if ! which lzop >/dev/null 2>&1; then
exit 77
fi
-if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=lzo)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --mkrescue-arg=--compress=lzo`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/netboot_test.in b/tests/netboot_test.in
index 9f71e3d88..6a1d95a22 100644
--- a/tests/netboot_test.in
+++ b/tests/netboot_test.in
@@ -40,6 +40,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
exit 0;;
esac
-if [ "$(echo hello | "${grubshell}" --boot=net)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --boot=net`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
index 8226e64ae..9b9a853d6 100644
--- a/tests/ohci_test.in
+++ b/tests/ohci_test.in
@@ -41,7 +41,12 @@ echo "hello" > "$outfile"
tar cf "$imgfile" "$outfile"
-if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-device pci-ohci -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then
+v=$(echo "nativedisk; source '(usb0)/$outfile';" |
+ "${grubshell}" --qemu-opts="-device pci-ohci
+ -drive id=my_usb_disk,file=$imgfile,if=none
+ -device usb-storage,drive=my_usb_disk" |
+ tail -n 1)
+if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
exit 1
diff --git a/tests/pata_test.in b/tests/pata_test.in
index 0dadbf5d3..0db4778d7 100644
--- a/tests/pata_test.in
+++ b/tests/pata_test.in
@@ -45,7 +45,8 @@ echo "hello" > "$outfile"
tar cf "$imgfile" "$outfile"
-if [ "$(echo "nativedisk; source '($indisk)/$outfile';" | "${grubshell}" --qemu-opts="-$disk $imgfile")" != "Hello World" ]; then
+v=`echo "nativedisk; source '($indisk)/$outfile';" | "${grubshell}" --qemu-opts="-$disk $imgfile"`
+if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
exit 1
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
index cc8b1a1fe..11689d23c 100644
--- a/tests/uhci_test.in
+++ b/tests/uhci_test.in
@@ -41,7 +41,12 @@ echo "hello" > "$outfile"
tar cf "$imgfile" "$outfile"
-if [ "$(echo "nativedisk; source '(usb0)/$outfile';" | "${grubshell}" --qemu-opts="-device ich9-usb-uhci1 -drive id=my_usb_disk,file=$imgfile,if=none -device usb-storage,drive=my_usb_disk" | tail -n 1)" != "Hello World" ]; then
+v=$(echo "nativedisk; source '(usb0)/$outfile';" |
+ "${grubshell}" --qemu-opts="-device ich9-usb-uhci1
+ -drive id=my_usb_disk,file=$imgfile,if=none
+ -device usb-storage,drive=my_usb_disk" |
+ tail -n 1)
+if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
exit 1
diff --git a/tests/xzcompress_test.in b/tests/xzcompress_test.in
index 03bfb5e95..61acba33b 100644
--- a/tests/xzcompress_test.in
+++ b/tests/xzcompress_test.in
@@ -24,6 +24,7 @@ if ! which xz >/dev/null 2>&1; then
exit 77
fi
-if [ "$(echo hello | "${grubshell}" --mkrescue-arg=--compress=xz)" != "Hello World" ]; then
+v=`echo hello | "${grubshell}" --mkrescue-arg=--compress=xz`
+if [ "$v" != "Hello World" ]; then
exit 1
fi
--
2.27.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
2021-10-07 20:33 ` [PATCH v3 2/4] tests: Do not occlude subshell error codes Glenn Washburn
@ 2021-10-11 14:20 ` Daniel Kiper
2021-10-11 18:06 ` Glenn Washburn
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Kiper @ 2021-10-11 14:20 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel
On Thu, Oct 07, 2021 at 03:33:25PM -0500, Glenn Washburn wrote:
> When a subshell's output is used as input to a "simple command", its return
> code is not checked. These subshells contain an execution of the grub-shell
> script which does the work of the actual test. If grub-shell returns an
> error code, the test should fail. So refactor to not have the subshell which
> contains grub-shell be direct input into a simple command (usually the test
> command). Mostly this is accomplished by having the output first go to a
> shell variable, and then using the shell variable in the simple command.
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
> ---
> tests/ahci_test.in | 7 ++++++-
> tests/cdboot_test.in | 3 ++-
> tests/core_compress_test.in | 6 ++++--
> tests/ehci_test.in | 7 ++++++-
> tests/fddboot_test.in | 3 ++-
> tests/gzcompress_test.in | 3 ++-
> tests/hddboot_test.in | 3 ++-
> tests/lzocompress_test.in | 3 ++-
> tests/netboot_test.in | 3 ++-
> tests/ohci_test.in | 7 ++++++-
> tests/pata_test.in | 3 ++-
> tests/uhci_test.in | 7 ++++++-
> tests/xzcompress_test.in | 3 ++-
> 13 files changed, 44 insertions(+), 14 deletions(-)
>
> diff --git a/tests/ahci_test.in b/tests/ahci_test.in
> index 9b1d85df4..1e4e3e443 100644
> --- a/tests/ahci_test.in
> +++ b/tests/ahci_test.in
> @@ -41,7 +41,12 @@ echo "hello" > "$outfile"
>
> tar cf "$imgfile" "$outfile"
>
> -if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then
> +v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
> + "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
> + -device ahci,id=ahci
> + -device ide-hd,drive=disk,bus=ahci.0" |
> + tail -n 1)
The first change partially contradicts what you said in the commit
message. I had to take a look at the patch #3 to understand why you did
not drop "tail -n 1". I think the commit message should be clarified in
a such way which does not require referring to another patch to
understand this one.
> +if [ "$v" != "Hello World" ]; then
> rm "$imgfile"
> rm "$outfile"
> exit 1
> diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
> index 75acdfedb..7229f79fb 100644
> --- a/tests/cdboot_test.in
> +++ b/tests/cdboot_test.in
> @@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
> exit 0;;
> esac
>
> -if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then
> +v=`echo hello | "${grubshell}" --boot=cd`
I would prefer if you are more consistent and use "$(...)" instead of "`...`".
The former looks more common in these scripts.
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
2021-10-11 14:20 ` Daniel Kiper
@ 2021-10-11 18:06 ` Glenn Washburn
2021-10-12 19:40 ` Daniel Kiper
0 siblings, 1 reply; 12+ messages in thread
From: Glenn Washburn @ 2021-10-11 18:06 UTC (permalink / raw)
To: Daniel Kiper; +Cc: grub-devel
On Mon, 11 Oct 2021 16:20:46 +0200
Daniel Kiper <daniel.kiper@oracle.com> wrote:
> On Thu, Oct 07, 2021 at 03:33:25PM -0500, Glenn Washburn wrote:
> > When a subshell's output is used as input to a "simple command", its return
> > code is not checked. These subshells contain an execution of the grub-shell
> > script which does the work of the actual test. If grub-shell returns an
This "grub-shell" should be "subshell"
> > error code, the test should fail. So refactor to not have the subshell which
> > contains grub-shell be direct input into a simple command (usually the test
This "grub-shell" is correct, as far as I can tell.
> > command). Mostly this is accomplished by having the output first go to a
> > shell variable, and then using the shell variable in the simple command.
> >
> > Signed-off-by: Glenn Washburn <development@efficientek.com>
> > ---
> > tests/ahci_test.in | 7 ++++++-
> > tests/cdboot_test.in | 3 ++-
> > tests/core_compress_test.in | 6 ++++--
> > tests/ehci_test.in | 7 ++++++-
> > tests/fddboot_test.in | 3 ++-
> > tests/gzcompress_test.in | 3 ++-
> > tests/hddboot_test.in | 3 ++-
> > tests/lzocompress_test.in | 3 ++-
> > tests/netboot_test.in | 3 ++-
> > tests/ohci_test.in | 7 ++++++-
> > tests/pata_test.in | 3 ++-
> > tests/uhci_test.in | 7 ++++++-
> > tests/xzcompress_test.in | 3 ++-
> > 13 files changed, 44 insertions(+), 14 deletions(-)
> >
> > diff --git a/tests/ahci_test.in b/tests/ahci_test.in
> > index 9b1d85df4..1e4e3e443 100644
> > --- a/tests/ahci_test.in
> > +++ b/tests/ahci_test.in
> > @@ -41,7 +41,12 @@ echo "hello" > "$outfile"
> >
> > tar cf "$imgfile" "$outfile"
> >
> > -if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then
> > +v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
> > + "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
> > + -device ahci,id=ahci
> > + -device ide-hd,drive=disk,bus=ahci.0" |
> > + tail -n 1)
>
> The first change partially contradicts what you said in the commit
> message. I had to take a look at the patch #3 to understand why you did
> not drop "tail -n 1". I think the commit message should be clarified in
> a such way which does not require referring to another patch to
> understand this one.
Yep, mix up. Please see correction above to see if it removes the
contradiction you're seeing. The intent was not to refer to a further
patch.
> > +if [ "$v" != "Hello World" ]; then
> > rm "$imgfile"
> > rm "$outfile"
> > exit 1
> > diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
> > index 75acdfedb..7229f79fb 100644
> > --- a/tests/cdboot_test.in
> > +++ b/tests/cdboot_test.in
> > @@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
> > exit 0;;
> > esac
> >
> > -if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then
> > +v=`echo hello | "${grubshell}" --boot=cd`
>
> I would prefer if you are more consistent and use "$(...)" instead of "`...`".
> The former looks more common in these scripts.
Yep, I agree and prefer in general the former style. Not sure, why I
changed style there. I see its done in a few places. Want me to just
resend this patch or the whole series?
Glenn
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
2021-10-11 18:06 ` Glenn Washburn
@ 2021-10-12 19:40 ` Daniel Kiper
2021-10-13 0:39 ` Glenn Washburn
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Kiper @ 2021-10-12 19:40 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel
On Mon, Oct 11, 2021 at 01:06:17PM -0500, Glenn Washburn wrote:
> On Mon, 11 Oct 2021 16:20:46 +0200
> Daniel Kiper <daniel.kiper@oracle.com> wrote:
>
> > On Thu, Oct 07, 2021 at 03:33:25PM -0500, Glenn Washburn wrote:
> > > When a subshell's output is used as input to a "simple command", its return
I think you should move "(usually the test command)" from below here
and/or add definition of "simple command".
> > > code is not checked. These subshells contain an execution of the grub-shell
> > > script which does the work of the actual test. If grub-shell returns an
>
> This "grub-shell" should be "subshell"
>
> > > error code, the test should fail. So refactor to not have the subshell which
> > > contains grub-shell be direct input into a simple command (usually the test
>
> This "grub-shell" is correct, as far as I can tell.
>
> > > command). Mostly this is accomplished by having the output first go to a
> > > shell variable, and then using the shell variable in the simple command.
> > >
> > > Signed-off-by: Glenn Washburn <development@efficientek.com>
> > > ---
> > > tests/ahci_test.in | 7 ++++++-
> > > tests/cdboot_test.in | 3 ++-
> > > tests/core_compress_test.in | 6 ++++--
> > > tests/ehci_test.in | 7 ++++++-
> > > tests/fddboot_test.in | 3 ++-
> > > tests/gzcompress_test.in | 3 ++-
> > > tests/hddboot_test.in | 3 ++-
> > > tests/lzocompress_test.in | 3 ++-
> > > tests/netboot_test.in | 3 ++-
> > > tests/ohci_test.in | 7 ++++++-
> > > tests/pata_test.in | 3 ++-
> > > tests/uhci_test.in | 7 ++++++-
> > > tests/xzcompress_test.in | 3 ++-
> > > 13 files changed, 44 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/tests/ahci_test.in b/tests/ahci_test.in
> > > index 9b1d85df4..1e4e3e443 100644
> > > --- a/tests/ahci_test.in
> > > +++ b/tests/ahci_test.in
> > > @@ -41,7 +41,12 @@ echo "hello" > "$outfile"
> > >
> > > tar cf "$imgfile" "$outfile"
> > >
> > > -if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then
> > > +v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
> > > + "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
> > > + -device ahci,id=ahci
> > > + -device ide-hd,drive=disk,bus=ahci.0" |
> > > + tail -n 1)
> >
> > The first change partially contradicts what you said in the commit
> > message. I had to take a look at the patch #3 to understand why you did
> > not drop "tail -n 1". I think the commit message should be clarified in
> > a such way which does not require referring to another patch to
> > understand this one.
>
> Yep, mix up. Please see correction above to see if it removes the
> contradiction you're seeing. The intent was not to refer to a further
> patch.
I think it improves situation a bit. If you could think how to reword
this commit message in general that (probably) would be better.
> > > +if [ "$v" != "Hello World" ]; then
> > > rm "$imgfile"
> > > rm "$outfile"
> > > exit 1
> > > diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
> > > index 75acdfedb..7229f79fb 100644
> > > --- a/tests/cdboot_test.in
> > > +++ b/tests/cdboot_test.in
> > > @@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
> > > exit 0;;
> > > esac
> > >
> > > -if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then
> > > +v=`echo hello | "${grubshell}" --boot=cd`
> >
> > I would prefer if you are more consistent and use "$(...)" instead of "`...`".
> > The former looks more common in these scripts.
>
> Yep, I agree and prefer in general the former style. Not sure, why I
> changed style there. I see its done in a few places. Want me to just
> resend this patch or the whole series?
I think it would be easier for me if you could merge v3 with v2 patch
series and repost as one batch.
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
2021-10-12 19:40 ` Daniel Kiper
@ 2021-10-13 0:39 ` Glenn Washburn
0 siblings, 0 replies; 12+ messages in thread
From: Glenn Washburn @ 2021-10-13 0:39 UTC (permalink / raw)
To: Daniel Kiper; +Cc: grub-devel
On Tue, 12 Oct 2021 21:40:45 +0200
Daniel Kiper <daniel.kiper@oracle.com> wrote:
> On Mon, Oct 11, 2021 at 01:06:17PM -0500, Glenn Washburn wrote:
> > On Mon, 11 Oct 2021 16:20:46 +0200
> > Daniel Kiper <daniel.kiper@oracle.com> wrote:
> >
> > > On Thu, Oct 07, 2021 at 03:33:25PM -0500, Glenn Washburn wrote:
> > > > When a subshell's output is used as input to a "simple command", its return
>
> I think you should move "(usually the test command)" from below here
> and/or add definition of "simple command".
I didn't state it, but "simple command" is defined in the man page for
dash and bash.
>
> > > > code is not checked. These subshells contain an execution of the grub-shell
> > > > script which does the work of the actual test. If grub-shell returns an
> >
> > This "grub-shell" should be "subshell"
> >
> > > > error code, the test should fail. So refactor to not have the subshell which
> > > > contains grub-shell be direct input into a simple command (usually the test
> >
> > This "grub-shell" is correct, as far as I can tell.
> >
> > > > command). Mostly this is accomplished by having the output first go to a
> > > > shell variable, and then using the shell variable in the simple command.
> > > >
> > > > Signed-off-by: Glenn Washburn <development@efficientek.com>
> > > > ---
> > > > tests/ahci_test.in | 7 ++++++-
> > > > tests/cdboot_test.in | 3 ++-
> > > > tests/core_compress_test.in | 6 ++++--
> > > > tests/ehci_test.in | 7 ++++++-
> > > > tests/fddboot_test.in | 3 ++-
> > > > tests/gzcompress_test.in | 3 ++-
> > > > tests/hddboot_test.in | 3 ++-
> > > > tests/lzocompress_test.in | 3 ++-
> > > > tests/netboot_test.in | 3 ++-
> > > > tests/ohci_test.in | 7 ++++++-
> > > > tests/pata_test.in | 3 ++-
> > > > tests/uhci_test.in | 7 ++++++-
> > > > tests/xzcompress_test.in | 3 ++-
> > > > 13 files changed, 44 insertions(+), 14 deletions(-)
> > > >
> > > > diff --git a/tests/ahci_test.in b/tests/ahci_test.in
> > > > index 9b1d85df4..1e4e3e443 100644
> > > > --- a/tests/ahci_test.in
> > > > +++ b/tests/ahci_test.in
> > > > @@ -41,7 +41,12 @@ echo "hello" > "$outfile"
> > > >
> > > > tar cf "$imgfile" "$outfile"
> > > >
> > > > -if [ "$(echo "nativedisk; source '(ahci0)/$outfile';" | "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 " | tail -n 1)" != "Hello World" ]; then
> > > > +v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
> > > > + "${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
> > > > + -device ahci,id=ahci
> > > > + -device ide-hd,drive=disk,bus=ahci.0" |
> > > > + tail -n 1)
> > >
> > > The first change partially contradicts what you said in the commit
> > > message. I had to take a look at the patch #3 to understand why you did
> > > not drop "tail -n 1". I think the commit message should be clarified in
> > > a such way which does not require referring to another patch to
> > > understand this one.
> >
> > Yep, mix up. Please see correction above to see if it removes the
> > contradiction you're seeing. The intent was not to refer to a further
> > patch.
>
> I think it improves situation a bit. If you could think how to reword
> this commit message in general that (probably) would be better.
Yes, I agree. Now I'm seeing I was being more generic than I needed to
be and wasn't quite correct.
>
> > > > +if [ "$v" != "Hello World" ]; then
> > > > rm "$imgfile"
> > > > rm "$outfile"
> > > > exit 1
> > > > diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
> > > > index 75acdfedb..7229f79fb 100644
> > > > --- a/tests/cdboot_test.in
> > > > +++ b/tests/cdboot_test.in
> > > > @@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
> > > > exit 0;;
> > > > esac
> > > >
> > > > -if [ "$(echo hello | "${grubshell}" --boot=cd)" != "Hello World" ]; then
> > > > +v=`echo hello | "${grubshell}" --boot=cd`
> > >
> > > I would prefer if you are more consistent and use "$(...)" instead of "`...`".
> > > The former looks more common in these scripts.
> >
> > Yep, I agree and prefer in general the former style. Not sure, why I
> > changed style there. I see its done in a few places. Want me to just
> > resend this patch or the whole series?
Now I see this change from $(...) to `...` was unintentional and due to
starting from an older commit.
>
> I think it would be easier for me if you could merge v3 with v2 patch
> series and repost as one batch.
Ok, I'll do that.
Glenn
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 3/4] tests: Do not occlude grub-shell return code
2021-10-07 20:33 [PATCH v3 0/4] Various fixes/improvements for tests Glenn Washburn
2021-10-07 20:33 ` [PATCH v3 1/4] tests: Add set -e to missing tests Glenn Washburn
2021-10-07 20:33 ` [PATCH v3 2/4] tests: Do not occlude subshell error codes Glenn Washburn
@ 2021-10-07 20:33 ` Glenn Washburn
2021-10-11 14:31 ` Daniel Kiper
2021-10-07 20:33 ` [PATCH v3 4/4] tests: Exit with skipped exit code when test not performed Glenn Washburn
3 siblings, 1 reply; 12+ messages in thread
From: Glenn Washburn @ 2021-10-07 20:33 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Glenn Washburn
The script grub-shell does the bulk of the testing. If it returns an error
code, that means that the test failed and the test should immediately exit
with that error code. When grub-shell is used as a non-terminating command
in a pipeline, eg. when data needs to be extracted from its output, its
error code will be occluded by the last command in the pipeline. Refactor
tests so that the shell will error with the exit code of grub-shell by
breaking up pipelines such that grub-shell is always the last command in the
pipeline that it is used in.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/ahci_test.in | 4 ++--
tests/ehci_test.in | 4 ++--
tests/grub_cmd_date.in | 3 ++-
tests/grub_script_expansion.in | 3 ++-
tests/ohci_test.in | 4 ++--
tests/partmap_test.in | 4 ++--
tests/uhci_test.in | 4 ++--
7 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/tests/ahci_test.in b/tests/ahci_test.in
index 1e4e3e443..3f7645ad8 100644
--- a/tests/ahci_test.in
+++ b/tests/ahci_test.in
@@ -44,8 +44,8 @@ tar cf "$imgfile" "$outfile"
v=$(echo "nativedisk; source '(ahci0)/$outfile';" |
"${grubshell}" --qemu-opts="-drive id=disk,file=$imgfile,if=none
-device ahci,id=ahci
- -device ide-hd,drive=disk,bus=ahci.0" |
- tail -n 1)
+ -device ide-hd,drive=disk,bus=ahci.0")
+v=$(echo "$v" | tail -n 1)
if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
index 115e64e29..df408d77a 100644
--- a/tests/ehci_test.in
+++ b/tests/ehci_test.in
@@ -44,8 +44,8 @@ tar cf "$imgfile" "$outfile"
v=$(echo "nativedisk; source '(usb0)/$outfile';" |
"${grubshell}" --qemu-opts="-device ich9-usb-ehci1
-drive id=my_usb_disk,file=$imgfile,if=none
- -device usb-storage,drive=my_usb_disk" |
- tail -n 1)
+ -device usb-storage,drive=my_usb_disk")
+v=$(echo "$v" | tail -n 1)
if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
index f7c9ca004..f9156691e 100644
--- a/tests/grub_cmd_date.in
+++ b/tests/grub_cmd_date.in
@@ -9,7 +9,8 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ];
fi
pdt="$(date -u +%s)"
-dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
+dt=`echo date | @builddir@/grub-shell`
+dt=`echo "$dt" | sed 's, [A-Z][a-z]*$,,'`
dtg="$(date -u -d "$dt" +%s)"
ndt="$(date -u +%s)"
diff --git a/tests/grub_script_expansion.in b/tests/grub_script_expansion.in
index 9d0dcdd29..98d5a9068 100644
--- a/tests/grub_script_expansion.in
+++ b/tests/grub_script_expansion.in
@@ -17,7 +17,8 @@ set -e
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
-disks=`echo ls | @builddir@/grub-shell| grep -av '^Network protocols:$'| grep -av '^tftp http $'`
+disks=`echo ls | @builddir@/grub-shell`
+disks=`echo "$disks"| grep -av '^Network protocols:$'| grep -av '^tftp http $'`
other=`echo insmod regexp\; echo \* | @builddir@/grub-shell`
for d in $disks; do
if echo "$d" |grep ',' >/dev/null; then
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
index 9b9a853d6..c72618656 100644
--- a/tests/ohci_test.in
+++ b/tests/ohci_test.in
@@ -44,8 +44,8 @@ tar cf "$imgfile" "$outfile"
v=$(echo "nativedisk; source '(usb0)/$outfile';" |
"${grubshell}" --qemu-opts="-device pci-ohci
-drive id=my_usb_disk,file=$imgfile,if=none
- -device usb-storage,drive=my_usb_disk" |
- tail -n 1)
+ -device usb-storage,drive=my_usb_disk")
+v=$(echo "$v" | tail -n 1)
if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
index cf82b4f98..7906db43d 100644
--- a/tests/partmap_test.in
+++ b/tests/partmap_test.in
@@ -58,8 +58,8 @@ list_parts () {
shift
echo ls | "${grubshell}" --disk="${imgfile}" \
- --modules=$mod | tr -d "\n\r" > "${outfile}"
- cat "${outfile}"
+ --modules=$mod > "${outfile}"
+ cat "${outfile}" | tr -d "\n\r"
echo
}
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
index 11689d23c..7b8892c63 100644
--- a/tests/uhci_test.in
+++ b/tests/uhci_test.in
@@ -44,8 +44,8 @@ tar cf "$imgfile" "$outfile"
v=$(echo "nativedisk; source '(usb0)/$outfile';" |
"${grubshell}" --qemu-opts="-device ich9-usb-uhci1
-drive id=my_usb_disk,file=$imgfile,if=none
- -device usb-storage,drive=my_usb_disk" |
- tail -n 1)
+ -device usb-storage,drive=my_usb_disk")
+v=$(echo "$v" | tail -n 1)
if [ "$v" != "Hello World" ]; then
rm "$imgfile"
rm "$outfile"
--
2.27.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/4] tests: Do not occlude grub-shell return code
2021-10-07 20:33 ` [PATCH v3 3/4] tests: Do not occlude grub-shell return code Glenn Washburn
@ 2021-10-11 14:31 ` Daniel Kiper
0 siblings, 0 replies; 12+ messages in thread
From: Daniel Kiper @ 2021-10-11 14:31 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel
On Thu, Oct 07, 2021 at 03:33:26PM -0500, Glenn Washburn wrote:
> The script grub-shell does the bulk of the testing. If it returns an error
> code, that means that the test failed and the test should immediately exit
> with that error code. When grub-shell is used as a non-terminating command
> in a pipeline, eg. when data needs to be extracted from its output, its
> error code will be occluded by the last command in the pipeline. Refactor
> tests so that the shell will error with the exit code of grub-shell by
> breaking up pipelines such that grub-shell is always the last command in the
> pipeline that it is used in.
>
> Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> except...
> ---
> tests/ahci_test.in | 4 ++--
> tests/ehci_test.in | 4 ++--
> tests/grub_cmd_date.in | 3 ++-
> tests/grub_script_expansion.in | 3 ++-
> tests/ohci_test.in | 4 ++--
> tests/partmap_test.in | 4 ++--
> tests/uhci_test.in | 4 ++--
> 7 files changed, 14 insertions(+), 12 deletions(-)
[...]
> diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
> index f7c9ca004..f9156691e 100644
> --- a/tests/grub_cmd_date.in
> +++ b/tests/grub_cmd_date.in
> @@ -9,7 +9,8 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ];
> fi
>
> pdt="$(date -u +%s)"
> -dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
> +dt=`echo date | @builddir@/grub-shell`
> +dt=`echo "$dt" | sed 's, [A-Z][a-z]*$,,'`
If you change this line could you change "`...`" to "$(...)"? to align
this code with what is before and after it?
> dtg="$(date -u -d "$dt" +%s)"
> ndt="$(date -u +%s)"
>
> diff --git a/tests/grub_script_expansion.in b/tests/grub_script_expansion.in
> index 9d0dcdd29..98d5a9068 100644
> --- a/tests/grub_script_expansion.in
> +++ b/tests/grub_script_expansion.in
> @@ -17,7 +17,8 @@ set -e
> # You should have received a copy of the GNU General Public License
> # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
>
> -disks=`echo ls | @builddir@/grub-shell| grep -av '^Network protocols:$'| grep -av '^tftp http $'`
> +disks=`echo ls | @builddir@/grub-shell`
> +disks=`echo "$disks"| grep -av '^Network protocols:$'| grep -av '^tftp http $'`
> other=`echo insmod regexp\; echo \* | @builddir@/grub-shell`
Ugh... Next "`...`" usage... Though I would live it as is to not complicate
this patch... Or fix this in separate patch if you do not mind...
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 4/4] tests: Exit with skipped exit code when test not performed
2021-10-07 20:33 [PATCH v3 0/4] Various fixes/improvements for tests Glenn Washburn
` (2 preceding siblings ...)
2021-10-07 20:33 ` [PATCH v3 3/4] tests: Do not occlude grub-shell return code Glenn Washburn
@ 2021-10-07 20:33 ` Glenn Washburn
2021-10-11 14:34 ` Daniel Kiper
3 siblings, 1 reply; 12+ messages in thread
From: Glenn Washburn @ 2021-10-07 20:33 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Glenn Washburn
These tests were not performed and therefore did not pass, nor fail. This
fixes misleading test exit code where, for instance, the pseries_test will
pass on i386-pc, which is not a pseries architecture.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/ahci_test.in | 8 ++++----
tests/cdboot_test.in | 8 ++++----
tests/core_compress_test.in | 2 +-
tests/ehci_test.in | 8 ++++----
tests/fddboot_test.in | 16 ++++++++--------
tests/grub_cmd_date.in | 2 +-
tests/grub_cmd_set_date.in | 6 +++---
tests/grub_cmd_sleep.in | 2 +-
tests/hddboot_test.in | 6 +++---
tests/netboot_test.in | 12 ++++++------
tests/ohci_test.in | 8 ++++----
tests/partmap_test.in | 8 ++++----
tests/pata_test.in | 6 +++---
tests/pseries_test.in | 2 +-
tests/uhci_test.in | 8 ++++----
15 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/tests/ahci_test.in b/tests/ahci_test.in
index 3f7645ad8..6d2e61d4e 100644
--- a/tests/ahci_test.in
+++ b/tests/ahci_test.in
@@ -22,16 +22,16 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: Don't mess with real devices when OS is active
*-emu)
- exit 0;;
+ exit 77;;
# FIXME: qemu gets bonito DMA wrong
mipsel-loongson)
- exit 0;;
+ exit 77;;
# PLATFORM: no AHCI on ARC and qemu-mips platforms
mips*-arc | mips*-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: No native drivers are available for those
powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
- exit 0;;
+ exit 77;;
esac
imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
index 7229f79fb..c0a5212ff 100644
--- a/tests/cdboot_test.in
+++ b/tests/cdboot_test.in
@@ -22,16 +22,16 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: emu is different
*-emu)
- exit 0;;
+ exit 77;;
# PLATFORM: Flash targets
i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: currently grub-shell uses only -kernel for loongson
mipsel-loongson)
- exit 0;;
+ exit 77;;
# FIXME: OFW fails to open CD-ROM
i386-ieee1275)
- exit 0;;
+ exit 77;;
esac
v=`echo hello | "${grubshell}" --boot=cd`
diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in
index 90dd00607..72d2eca7d 100644
--- a/tests/core_compress_test.in
+++ b/tests/core_compress_test.in
@@ -22,7 +22,7 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# FIXME: Only mips currently supports configurable core compression
*-emu | i386-* | x86_64-* | sparc64-* | ia64-*)
- exit 0
+ exit 77
;;
esac
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
index df408d77a..df671b4b6 100644
--- a/tests/ehci_test.in
+++ b/tests/ehci_test.in
@@ -22,16 +22,16 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: Don't mess with real devices when OS is active
*-emu)
- exit 0;;
+ exit 77;;
# FIXME: qemu gets bonito DMA wrong
mipsel-loongson)
- exit 0;;
+ exit 77;;
# PLATFORM: no USB on ARC and qemu-mips platforms
mips*-arc | mips*-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: No native drivers are available for those
powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
- exit 0;;
+ exit 77;;
esac
imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in
index 1bbe60ee5..5348ac56b 100644
--- a/tests/fddboot_test.in
+++ b/tests/fddboot_test.in
@@ -22,28 +22,28 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: emu is different
*-emu)
- exit 0;;
+ exit 77;;
# PLATFORM: Flash targets
i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: currently grub-shell uses only -kernel for loongson
mipsel-loongson)
- exit 0;;
+ exit 77;;
# FIXME: We don't support EFI floppy boot in grub-mkrescue
*-efi)
- exit 0;;
+ exit 77;;
# FIXME: no floppy support
i386-multiboot)
- exit 0;;
+ exit 77;;
# FIXME: QEMU firmware crashes when trying to boot from floppy
sparc64-ieee1275)
- exit 0;;
+ exit 77;;
# FIXME: QEMU doesn't emulate SCSI floppies
mipsel-arc | mips-arc)
- exit 0;;
+ exit 77;;
# PLATFORM: powerpc doesn't boot from floppy except OldWorld Macs which we don't support anyway
powerpc-ieee1275)
- exit 0;;
+ exit 77;;
esac
v=`echo hello | "${grubshell}" --boot=fd --mkrescue-arg="--compress=xz --fonts= --locales= --themes= -no-pad"`
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
index f9156691e..409cb684a 100644
--- a/tests/grub_cmd_date.in
+++ b/tests/grub_cmd_date.in
@@ -5,7 +5,7 @@ set -e
# FIXME: OpenBIOS on sparc64 doesn't implement RTC
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
- exit 0
+ exit 77
fi
pdt="$(date -u +%s)"
diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in
index aac120a6c..17673cd8a 100644
--- a/tests/grub_cmd_set_date.in
+++ b/tests/grub_cmd_set_date.in
@@ -6,15 +6,15 @@ set -e
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# FIXME: OpenBIOS on sparc64 doesn't implement RTC
sparc64-ieee1275)
- exit 0;;
+ exit 77;;
# PLATFORM: ARC doesn't provide any way to set time
*-arc)
- exit 0;;
+ exit 77;;
# PLATFORM: EMU doesn't provide any way to set time
# Even if it did we'd need some kind of sandbox to avoid
# modifying real system time.
*-emu)
- exit 0;;
+ exit 77;;
esac
out=$(cat <<EOF | @builddir@/grub-shell
diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in
index 8797f6632..1a57fb388 100644
--- a/tests/grub_cmd_sleep.in
+++ b/tests/grub_cmd_sleep.in
@@ -5,7 +5,7 @@ set -e
# FIXME: OpenBIOS on sparc64 doesn't implement RTC
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; then
- exit 0
+ exit 77
fi
# Compare RTC with interval timer.
diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in
index abe3e0ae1..110c70950 100644
--- a/tests/hddboot_test.in
+++ b/tests/hddboot_test.in
@@ -22,13 +22,13 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: emu is different
*-emu)
- exit 0;;
+ exit 77;;
# PLATFORM: Flash targets
i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: currently grub-shell uses only -kernel for loongson
mipsel-loongson)
- exit 0;;
+ exit 77;;
esac
v=`echo hello | "${grubshell}" --boot=hd`
diff --git a/tests/netboot_test.in b/tests/netboot_test.in
index 6a1d95a22..e0b2c9d25 100644
--- a/tests/netboot_test.in
+++ b/tests/netboot_test.in
@@ -22,22 +22,22 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: emu is different
*-emu)
- exit 0;;
+ exit 77;;
# PLATFORM: Flash targets
i386-qemu | i386-coreboot | mips-qemu_mips | mipsel-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: currently grub-shell uses only -kernel for loongson
mipsel-loongson)
- exit 0;;
+ exit 77;;
# FIXME: no rtl8139 support
i386-multiboot)
- exit 0;;
+ exit 77;;
# FIXME: We don't fully support netboot on ARC
*-arc)
- exit 0;;
+ exit 77;;
# FIXME: Many QEMU firmware have no netboot capability
*-efi | i386-ieee1275 | powerpc-ieee1275 | sparc64-ieee1275)
- exit 0;;
+ exit 77;;
esac
v=`echo hello | "${grubshell}" --boot=net`
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
index c72618656..741ad881f 100644
--- a/tests/ohci_test.in
+++ b/tests/ohci_test.in
@@ -22,16 +22,16 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: Don't mess with real devices when OS is active
*-emu)
- exit 0;;
+ exit 77;;
# FIXME: qemu gets bonito DMA wrong
mipsel-loongson)
- exit 0;;
+ exit 77;;
# PLATFORM: no USB on ARC and qemu-mips platforms
mips*-arc | mips*-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: No native drivers are available for those
powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
- exit 0;;
+ exit 77;;
esac
imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
index 7906db43d..e72af9ce4 100644
--- a/tests/partmap_test.in
+++ b/tests/partmap_test.in
@@ -70,21 +70,21 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
powerpc-ieee1275)
disk=ieee1275//pci@80000000/mac-io@4/ata-3@20000/disk@0
# FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
- exit 0
+ exit 77
;;
sparc64-ieee1275)
disk=ieee1275//pci@1fe\,0/pci-ata@5/ide0@500/disk@0
# FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
- exit 0
+ exit 77
;;
i386-ieee1275)
disk=ieee1275/d
# FIXME: QEMU firmware has bugs which prevent it from accessing hard disk w/o recognised label.
- exit 0
+ exit 77
;;
mips-arc)
# FIXME: ARC firmware has bugs which prevent it from accessing hard disk w/o dvh disklabel.
- exit 0 ;;
+ exit 77 ;;
mipsel-arc)
disk=arc/scsi0/disk0/rdisk0
;;
diff --git a/tests/pata_test.in b/tests/pata_test.in
index 0db4778d7..4a9c68ae4 100644
--- a/tests/pata_test.in
+++ b/tests/pata_test.in
@@ -25,13 +25,13 @@ indisk=ata0
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: Don't mess with real devices when OS is active
*-emu)
- exit 0;;
+ exit 77;;
# PLATFORM: no ATA on ARC platforms (they use SCSI)
*-arc)
- exit 0;;
+ exit 77;;
# FIXME: No native drivers are available for those
powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
- exit 0;;
+ exit 77;;
i386-ieee1275)
disk=hdb
indisk=ata1
diff --git a/tests/pseries_test.in b/tests/pseries_test.in
index 655eb4f3a..9b4090cf5 100644
--- a/tests/pseries_test.in
+++ b/tests/pseries_test.in
@@ -20,7 +20,7 @@ grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" != powerpc-ieee1275 ]; then
- exit 0
+ exit 77
fi
if [ "$(echo hello | "${grubshell}" --pseries --timeout=180 --boot=cd)" != "Hello World" ]; then
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
index 7b8892c63..5aa5eb726 100644
--- a/tests/uhci_test.in
+++ b/tests/uhci_test.in
@@ -22,16 +22,16 @@ grubshell=@builddir@/grub-shell
case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
# PLATFORM: Don't mess with real devices when OS is active
*-emu)
- exit 0;;
+ exit 77;;
# FIXME: qemu gets bonito DMA wrong
mipsel-loongson)
- exit 0;;
+ exit 77;;
# PLATFORM: no USB on ARC and qemu-mips platforms
mips*-arc | mips*-qemu_mips)
- exit 0;;
+ exit 77;;
# FIXME: No native drivers are available for those
powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
- exit 0;;
+ exit 77;;
esac
imgfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
--
2.27.0
^ permalink raw reply related [flat|nested] 12+ messages in thread