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: diff --git a/tests/ahci_test.in b/tests/ahci_test.in index 0e1c3679b..6d2e61d4e 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -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 diff --git a/tests/ehci_test.in b/tests/ehci_test.in index bd80f93d4..df671b4b6 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -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 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/grub_script_blockarg.in b/tests/grub_script_blockarg.in index 6d63a345a..a91c7ca82 100644 --- a/tests/grub_script_blockarg.in +++ b/tests/grub_script_blockarg.in @@ -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. diff --git a/tests/ohci_test.in b/tests/ohci_test.in index 105220856..741ad881f 100644 --- a/tests/ohci_test.in +++ b/tests/ohci_test.in @@ -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 diff --git a/tests/uhci_test.in b/tests/uhci_test.in index 2984283c0..5aa5eb726 100644 --- a/tests/uhci_test.in +++ b/tests/uhci_test.in @@ -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 -- 2.27.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel