Various fixes/improvements for tests
v3 cover Various fixes/improvements for tests
In this update from the previous patch series, I've only included the patches which required changes, which were the previous patches 4 and 7.
Patch 4 was broken up at the Daniel's request, also a little differently than requested. It is now the first 3 patches. I've also changed the patch slightly as can be seen in the interdiff, but its functionally equivalent to the previous patch. The first is just adding missing 'set -e' commands to turn on shell's errexit. The second move subshells containing grub-shell such that the output goes to a shell variable as opposed to input of another command, which occludes the exit code. The third fixes a different error code occlusion issue, where if grub-shell is not the last command in a pipeline its exit code will be ignored. Another way of preventing this is to use 'set -o pipefail' in bash, but this is not recognized in dash and perhaps other shells.
The fourth patch is the same as the previous patch #7, except that a missing skip exit code for the test grub_cmd_sleep was added.
Glenn
Glenn Washburn (4):
tests: Add set -e to missing tests
tests: Do not occlude subshell error codes
tests: Do not occlude grub-shell return code
tests: Exit with skipped exit code when test not performed
tests/ahci_test.in | 15 ++++++++++----- tests/cdboot_test.in | 11 ++++++----- tests/core_compress_test.in | 8 +++++--- tests/ehci_test.in | 15 ++++++++++----- tests/fddboot_test.in | 19 ++++++++++--------- tests/grub_cmd_date.in | 5 +++-- tests/grub_cmd_set_date.in | 6 +++--- tests/grub_cmd_sleep.in | 2 +- tests/grub_cmd_test.in | 1 + tests/grub_script_blockarg.in | 1 + tests/grub_script_expansion.in | 3 ++- tests/gzcompress_test.in | 3 ++- tests/hddboot_test.in | 9 +++++---- tests/lzocompress_test.in | 3 ++- tests/netboot_test.in | 15 ++++++++------- tests/ohci_test.in | 15 ++++++++++----- tests/partmap_test.in | 12 ++++++------ tests/pata_test.in | 9 +++++---- tests/pseries_test.in | 2 +- tests/test_sha512sum.in | 1 + tests/uhci_test.in | 15 ++++++++++----- tests/xzcompress_test.in | 3 ++- 22 files changed, 104 insertions(+), 69 deletions(-)
Interdiff against v2:
tests/ahci_test.in +4 -3
@@ -41,11 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -echo "nativedisk; source '(ahci0)/$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" >$outfile -if [ "$(cat "$outfile" | tail -n 1)" != "Hello World" ]; then + -device ide-hd,drive=disk,bus=ahci.0") +v=$(echo "$v" | tail -n 1) +if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1
tests/ehci_test.in +4 -3
@@ -41,11 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -echo "nativedisk; source '(usb0)/$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" >$outfile -if [ "$(cat "$outfile" | tail -n 1)" != "Hello World" ]; then + -device usb-storage,drive=my_usb_disk") +v=$(echo "$v" | tail -n 1) +if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1
tests/grub_cmd_sleep.in +1 -1
@@ -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.
tests/grub_script_blockarg.in +2 -1
@@ -1,4 +1,5 @@ -#! @BUILD_SHEBANG@ -e +#! @BUILD_SHEBANG@ +set -e # Run GRUB script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc.
tests/ohci_test.in +4 -3
@@ -41,11 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -echo "nativedisk; source '(usb0)/$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" >$outfile -if [ "$(cat "$outfile" | tail -n 1)" != "Hello World" ]; then + -device usb-storage,drive=my_usb_disk") +v=$(echo "$v" | tail -n 1) +if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1
tests/uhci_test.in +4 -3
@@ -41,11 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile" -echo "nativedisk; source '(usb0)/$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" >$outfile -if [ "$(cat "$outfile" | tail -n 1)" != "Hello World" ]; then + -device usb-storage,drive=my_usb_disk") +v=$(echo "$v" | tail -n 1) +if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1
Signature · 1 line
2.27.0
PATCH v3 1/4 tests: Add set -e to missing tests
This helps to ensure that error codes do not get ignored.
--- tests/grub_cmd_test.in | 1 + tests/grub_script_blockarg.in | 1 + tests/test_sha512sum.in | 1 + 3 files changed, 3 insertions(+)
tests/grub_cmd_test.in +1 -0
@@ -1,4 +1,5 @@ #! @BUILD_SHEBANG@ +set -e # create a randome file empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
tests/grub_script_blockarg.in +1 -0
@@ -1,4 +1,5 @@ #! @BUILD_SHEBANG@ +set -e # Run GRUB script in a Qemu instance # Copyright (C) 2010 Free Software Foundation, Inc.
tests/test_sha512sum.in +1 -0
@@ -1,4 +1,5 @@ #! @BUILD_SHEBANG@ +set -e # create a randome file file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
Signature · 1 line
2.27.0
Re: [PATCH v3 1/4] tests: Add set -e to missing tests
Quoted 3 lines · Glenn Washburn
This helps to ensure that error codes do not get ignored.
Signed-off-by Glenn Washburn <[email protected]>
Daniel
PATCH v3 2/4 tests: Do not occlude subshell error codes
In reply to Glenn WashburnWhen 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.
--- 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(-)
tests/ahci_test.in +6 -1
@@ -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
tests/cdboot_test.in +2 -1
@@ -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
tests/core_compress_test.in +4 -2
@@ -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
tests/ehci_test.in +6 -1
@@ -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
tests/fddboot_test.in +2 -1
@@ -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
tests/gzcompress_test.in +2 -1
@@ -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
tests/hddboot_test.in +2 -1
@@ -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
tests/lzocompress_test.in +2 -1
@@ -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
tests/netboot_test.in +2 -1
@@ -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
tests/ohci_test.in +6 -1
@@ -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
tests/pata_test.in +2 -1
@@ -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
tests/uhci_test.in +6 -1
@@ -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
tests/xzcompress_test.in +2 -1
@@ -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
Signature · 1 line
2.27.0
Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
Quoted 30 lines · 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 <[email protected]>--- 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(-)tests/ahci_test.in +0
-0
tests/ahci_test.in echo "hello" > "$outfile" · line 48
Quoted 9 lines
tests/ahci_test.in +5
-1@@ -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.
Quoted 9 lines
tests/ahci_test.in +1
-0+if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1tests/cdboot_test.in +0
-0
tests/cdboot_test.in case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in · line 37
Quoted 5 lines
tests/cdboot_test.in +1
-1@@ -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
Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
Quoted 4 lines · On Mon, 11 Oct 2021 16:20:46 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 3 lines · 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
This "grub-shell" should be "subshell"
Quoted 2 lines
Quoted 2 lines
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.
Quoted 28 lines
Quoted 28 lines
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 <[email protected]>--- 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(-)tests/ahci_test.in +0
-0@@ -41,7 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile"
Quoted 12 lines
tests/ahci_test.in echo "hello" > "$outfile" · line 48
Quoted 6 lines
tests/ahci_test.in +5
-1-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.
Quoted 12 lines
Quoted 12 lines
tests/ahci_test.in +1
-0+if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1tests/cdboot_test.in +0
-0@@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esac
Quoted 5 lines
tests/cdboot_test.in case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in · line 37
Quoted 2 lines
tests/cdboot_test.in +1
-1-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
Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
Quoted 5 lines · Glenn Washburn
Quoted 2 lines · On Mon, 11 Oct 2021 16:20:46 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 1 line · Glenn Washburn
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".
Quoted 51 lines
Quoted 2 lines
Quoted 2 lines
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"
Quoted 2 lines
Quoted 2 lines
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.
Quoted 28 lines
Quoted 28 lines
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 <[email protected]>--- 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(-)tests/ahci_test.in +0
-0@@ -41,7 +41,12 @@ echo "hello" > "$outfile" tar cf "$imgfile" "$outfile"Quoted 12 lines
tests/ahci_test.in echo "hello" > "$outfile" · line 48
Quoted 6 lines
tests/ahci_test.in +5
-1-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.
Quoted 3 lines
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.
Quoted 18 lines
Quoted 12 lines
Quoted 12 lines
tests/ahci_test.in +1
-0+if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1tests/cdboot_test.in +0
-0@@ -34,6 +34,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in exit 0;; esacQuoted 5 lines
tests/cdboot_test.in case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in · line 37
Quoted 2 lines
tests/cdboot_test.in +1
-1-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.
Quoted 3 lines
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
Re: [PATCH v3 2/4] tests: Do not occlude subshell error codes
Quoted 9 lines · On Tue, 12 Oct 2021 21:40:45 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 5 lines · Glenn Washburn
Quoted 2 lines · On Mon, 11 Oct 2021 16:20:46 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 1 line · Glenn Washburn
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.
Quoted 52 lines
Quoted 52 lines
Quoted 3 lines
Quoted 3 lines
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"
Quoted 2 lines
Quoted 2 lines
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.
Quoted 40 lines
Quoted 25 lines
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 <[email protected]>--- 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(-)tests/ahci_test.in +0
-0tests/ahci_test.in echo "hello" > "$outfile" · line 48
Quoted 9 lines
tests/ahci_test.in +5
-1@@ -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.
Quoted 6 lines
Quoted 3 lines
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.
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 10 lines
tests/ahci_test.in +1
-0+if [ "$v" != "Hello World" ]; then rm "$imgfile" rm "$outfile" exit 1tests/cdboot_test.in +0
-0tests/cdboot_test.in case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in · line 37
Quoted 5 lines
tests/cdboot_test.in +1
-1@@ -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.
Quoted 3 lines
Quoted 3 lines
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.
Quoted 3 lines
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
PATCH v3 3/4 tests: Do not occlude grub-shell return code
In reply to Glenn WashburnThe 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.
--- 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(-)
tests/ahci_test.in +2 -2
@@ -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"
tests/ehci_test.in +2 -2
@@ -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"
tests/grub_cmd_date.in +2 -1
@@ -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)"
tests/grub_script_expansion.in +2 -1
@@ -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
tests/ohci_test.in +2 -2
@@ -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"
tests/partmap_test.in +2 -2
@@ -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 }
tests/uhci_test.in +2 -2
@@ -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"
Signature · 1 line
2.27.0
Re: [PATCH v3 3/4] tests: Do not occlude grub-shell return code
Quoted 10 lines · 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 <[email protected]>
Quoted 9 lines
--- 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(-)
[...]
tests/grub_cmd_date.in if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ]; · line 13
Quoted 11 lines
tests/grub_cmd_date.in +2
-1@@ -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?
Quoted 8 lines
tests/grub_cmd_date.in +0
-0dtg="$(date -u -d "$dt" +%s)" ndt="$(date -u +%s)"tests/grub_script_expansion.in +0
-0
tests/grub_script_expansion.in set -e · line 22
Quoted 7 lines
tests/grub_script_expansion.in +2
-1@@ -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
PATCH v3 4/4 tests: Exit with skipped exit code when test not performed
In reply to Glenn WashburnThese 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.
--- 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(-)
tests/ahci_test.in +4 -4
@@ -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
tests/cdboot_test.in +4 -4
@@ -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`
tests/core_compress_test.in +1 -1
@@ -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
tests/ehci_test.in +4 -4
@@ -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
tests/fddboot_test.in +8 -8
@@ -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"`
tests/grub_cmd_date.in +1 -1
@@ -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)"
tests/grub_cmd_set_date.in +3 -3
@@ -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
tests/grub_cmd_sleep.in +1 -1
@@ -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.
tests/hddboot_test.in +3 -3
@@ -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`
tests/netboot_test.in +6 -6
@@ -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`
tests/ohci_test.in +4 -4
@@ -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
tests/partmap_test.in +4 -4
@@ -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 ;;
tests/pata_test.in +3 -3
@@ -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
tests/pseries_test.in +1 -1
@@ -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
tests/uhci_test.in +4 -4
@@ -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
Signature · 1 line
2.27.0
Re: [PATCH v3 4/4] tests: Exit with skipped exit code when test not performed
Quoted 5 lines · 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_testwill pass on i386-pc, which is not a pseries architecture.Signed-off-by Glenn Washburn <[email protected]>
Daniel