mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
automation: fix false success in qemu tests
Fix flaw in qemu-*.sh tests that producess a false success. The following
lines produces success despite the "expect" script producing nonzero exit
status:
set +e
...
./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
(end of file)
The default exit status for a pipeline using "|" operator is that of the
rightmost command. Fix this by setting the "pipefail" option in the shell,
and removing "set +e" allowing the expect script to determine the result.
Signed-off-by: Victor Lira <victorm.lira@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
99f942f3d4
commit
740c41ca05
10 files changed
+10
-19
No files matched your search
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
# DomU Busybox
|
||||
cd binaries
|
||||
@@ -76,7 +76,6 @@ EOF
|
||||
|
||||
# Run the test
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
export QEMU_CMD="qemu-system-x86_64 \
|
||||
-cpu qemu64,+svm \
|
||||
-m 2G -smp 2 \
|
||||
|
||||
@@ -14,7 +14,7 @@ eval spawn $env(QEMU_CMD)
|
||||
|
||||
expect_after {
|
||||
-re "(.*)\r" {
|
||||
exp_continue
|
||||
exp_continue -continue_timer
|
||||
}
|
||||
timeout {send_error "ERROR-Timeout!\n"; exit 1}
|
||||
eof {send_error "ERROR-EOF!\n"; exit 1}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
serial_log="$(pwd)/smoke.serial"
|
||||
|
||||
@@ -77,7 +77,6 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
|
||||
bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
|
||||
|
||||
rm -f ${serial_log}
|
||||
set +e
|
||||
export QEMU_CMD="./qemu-system-arm \
|
||||
-machine virt \
|
||||
-machine virtualization=true \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
# DomU Busybox
|
||||
cd binaries
|
||||
@@ -93,7 +93,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
|
||||
|
||||
# Run the test
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
export QEMU_CMD="./binaries/qemu-system-aarch64 \
|
||||
-machine virtualization=true \
|
||||
-cpu cortex-a57 -machine type=virt \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
test_variant=$1
|
||||
|
||||
@@ -130,7 +130,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
|
||||
|
||||
# Run the test
|
||||
rm -f ${serial_log}
|
||||
set +e
|
||||
export QEMU_CMD="./qemu-system-arm \
|
||||
-machine virt \
|
||||
-machine virtualization=true \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
test_variant=$1
|
||||
|
||||
@@ -204,7 +204,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
|
||||
|
||||
# Run the test
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
export QEMU_CMD="./binaries/qemu-system-aarch64 \
|
||||
-machine virtualization=true \
|
||||
-cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
serial_log="$(pwd)/smoke.serial"
|
||||
|
||||
@@ -9,7 +9,6 @@ machine=$1
|
||||
|
||||
# Run the test
|
||||
rm -f ${serial_log}
|
||||
set +e
|
||||
|
||||
export QEMU_CMD="qemu-system-ppc64 \
|
||||
-bios skiboot.lid \
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
# Run the test
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
|
||||
export QEMU_CMD="qemu-system-riscv64 \
|
||||
-M virt \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
# variant should be either pv or pvh
|
||||
variant=$1
|
||||
@@ -15,7 +15,6 @@ case $variant in
|
||||
esac
|
||||
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
|
||||
-initrd xtf/tests/example/$k \
|
||||
-append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
set -ex -o pipefail
|
||||
|
||||
# Name of the XTF test
|
||||
xtf_test=$1
|
||||
@@ -50,7 +50,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
|
||||
|
||||
# Run the test
|
||||
rm -f smoke.serial
|
||||
set +e
|
||||
export QEMU_CMD="./binaries/qemu-system-aarch64 \
|
||||
-machine virtualization=true \
|
||||
-cpu cortex-a57 -machine type=virt \
|
||||
|
||||