scripts: Fix PV run handling
cover scripts: Fix PV run handling
There are some issues that make our current PV handling in run_tests.sh and s390x/run a bit awkward:
* With ACCEL=tcg or if KVM is not available we will try to run PV tests which won't work
* If a host key cert has been specified but it does not exists then the compilation will break
This series is based on the common script fixes I just sent out.
Janosch Frank (3):
s390x: Don't run PV testcases under tcg
configure: s390x: Check if the host key document exists
s390x: run: Skip PV tests when tcg is the accelerator
configure | 5 +++++ s390x/run | 5 +++++ scripts/s390x/func.bash | 3 +++ 3 files changed, 13 insertions(+)
Signature · 1 line
2.27.0
PATCH 1/3 s390x: Don't run PV testcases under tcg
The UV call facility is only available on hardware.
--- scripts/s390x/func.bash | 3 +++ 1 file changed, 3 insertions(+)
scripts/s390x/func.bash +3 -0
@@ -21,6 +21,9 @@ function arch_cmd_s390x() "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" # run PV test case + if [ "$ACCEL" = 'tcg' ]; then + return + fi kernel=${kernel%.elf}.pv.bin testname=${testname}_PV if [ ! -f "${kernel}" ]; then
Signature · 1 line
2.27.0
Re: [kvm-unit-tests PATCH 1/3] s390x: Don't run PV testcases under tcg
Quoted 13 lines · Janosch Frank
The UV call facility is only available on hardware.
Signed-off-by Janosch Frank <[email protected]>--- scripts/s390x/func.bash | 3 +++ 1 file changed, 3 insertions(+)scripts/s390x/func.bash +0
-0
scripts/s390x/func.bash function arch_cmd_s390x() · line 29
Quoted 9 lines
scripts/s390x/func.bash +3
-0@@ -21,6 +21,9 @@ function arch_cmd_s390x() "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" # run PV test case + if [ "$ACCEL" = 'tcg' ]; then + return + fi kernel=${kernel%.elf}.pv.bin testname=${testname}_PV if [ ! -f "${kernel}" ]; then
Re: [kvm-unit-tests PATCH 1/3] s390x: Don't run PV testcases under tcg
In reply to Janosch FrankQuoted 13 lines · Janosch Frank
The UV call facility is only available on hardware.
Signed-off-by Janosch Frank <[email protected]>--- scripts/s390x/func.bash | 3 +++ 1 file changed, 3 insertions(+)scripts/s390x/func.bash +0
-0
scripts/s390x/func.bash function arch_cmd_s390x() · line 29
Quoted 9 lines
scripts/s390x/func.bash +3
-0@@ -21,6 +21,9 @@ function arch_cmd_s390x() "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" # run PV test case + if [ "$ACCEL" = 'tcg' ]; then + return + fi kernel=${kernel%.elf}.pv.bin testname=${testname}_PV if [ ! -f "${kernel}" ]; then
Signature · 3 lines
Thanks, David / dhildenb
PATCH 2/3 configure: s390x: Check if the host key document exists
In reply to Janosch FrankI'd rather have a readable error message than make failing the build with cryptic errors.
--- configure | 5 +++++ 1 file changed, 5 insertions(+)
configure +5 -0
@@ -121,6 +121,11 @@ while [[ "$1" = -* ]]; do esac done +if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; then + echo "Host key document doesn't exist at the specified location." + exit 1 +fi + if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then echo "erratatxt: $erratatxt does not exist or is not a regular file" exit 1
Signature · 1 line
2.27.0
Re: [kvm-unit-tests PATCH 2/3] configure: s390x: Check if the host key document exists
Quoted 13 lines · Janosch Frank
I'd rather have a readable error message than make failing the build with cryptic errors.
Signed-off-by Janosch Frank <[email protected]>--- configure | 5 +++++ 1 file changed, 5 insertions(+)configure +0
-0
configure while [[ "$1" = -* ]]; do · line 124
Quoted 4 lines
configure +1
-0@@ -121,6 +121,11 @@ while [[ "$1" = -* ]]; do esac done +if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; then
Use [ -n "$host_key_document" ] instead of just
[ "$host_key_document" ] ?
With that fixed:
Quoted 8 lines
configure +4
-0+ echo "Host key document doesn't exist at the specified location." + exit 1 +fi + if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then echo "erratatxt: $erratatxt does not exist or is not a regular file" exit 1
Re: [kvm-unit-tests PATCH 2/3] configure: s390x: Check if the host key document exists
Quoted 24 lines · Thomas Huth
Quoted 13 lines · Janosch Frank
I'd rather have a readable error message than make failing the build with cryptic errors.
Signed-off-by Janosch Frank <[email protected]>--- configure | 5 +++++ 1 file changed, 5 insertions(+)configure +0
-0configure while [[ "$1" = -* ]]; do · line 124
Quoted 4 lines
configure +1
-0@@ -121,6 +121,11 @@ while [[ "$1" = -* ]]; do esac done +if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; thenUse [ -n "$host_key_document" ] instead of just
[ "$host_key_document" ] ?With that fixed:
Quoted 8 lines
Reviewed-by Thomas Huth <[email protected]>configure while [[ "$1" = -* ]]; do · line 129
Quoted 5 lines
configure +4
-0+ echo "Host key document doesn't exist at the specified location." + exit 1 +fi + if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
^should we adjust that then as well?
Signature · 3 lines
Thanks, David / dhildenb
PATCH 3/3 s390x: run: Skip PV tests when tcg is the accelerator
In reply to Janosch FrankTCG doesn't support PV.
--- s390x/run | 5 +++++ 1 file changed, 5 insertions(+)
s390x/run +5 -0
@@ -19,6 +19,11 @@ else ACCEL=$DEF_ACCEL fi +if [ "${1: -7}" == ".pv.bin" ] || [ "${TESTNAME: -3}" == "_PV" ] && [ $ACCEL == "tcg" ]; then + echo "Protected Virtualization isn't supported under TCG" + exit 2 +fi + M='-machine s390-ccw-virtio' M+=",accel=$ACCEL" command="$qemu -nodefaults -nographic $M"
Signature · 1 line
2.27.0
Re: [kvm-unit-tests PATCH 3/3] s390x: run: Skip PV tests when tcg is the accelerator
Quoted 12 lines · Janosch Frank
TCG doesn't support PV.
Signed-off-by Janosch Frank <[email protected]>--- s390x/run | 5 +++++ 1 file changed, 5 insertions(+)s390x/run +0
-0
s390x/run else · line 22
Quoted 4 lines
s390x/run +1
-0@@ -19,6 +19,11 @@ else ACCEL=$DEF_ACCEL fi +if [ "${1: -7}" == ".pv.bin" ] || [ "${TESTNAME: -3}" == "_PV" ] && [ $ACCEL == "tcg" ]; then
Put $ACCEL in quotes?
With that nit fixed:
Quoted 8 lines
s390x/run +4
-0+ echo "Protected Virtualization isn't supported under TCG" + exit 2 +fi + M='-machine s390-ccw-virtio' M+=",accel=$ACCEL" command="$qemu -nodefaults -nographic $M"
Re: [kvm-unit-tests PATCH 3/3] s390x: run: Skip PV tests when tcg is the accelerator
Quoted 16 lines · Thomas Huth
Quoted 15 lines · Janosch Frank
TCG doesn't support PV.
Signed-off-by Janosch Frank <[email protected]>--- s390x/run | 5 +++++ 1 file changed, 5 insertions(+)s390x/run +0
-0@@ -19,6 +19,11 @@ else ACCEL=$DEF_ACCEL fi
Quoted 6 lines
s390x/run else · line 22
Quoted 1 line
s390x/run +1
-0+if [ "${1: -7}" == ".pv.bin" ] || [ "${TESTNAME: -3}" == "_PV" ] && [ $ACCEL == "tcg" ]; thenPut $ACCEL in quotes?
With that nit fixed:
Should these "==" be "=" ? Bash string comparisons always mess with my mind.
Signature · 3 lines
Thanks, David / dhildenb
Re: [kvm-unit-tests PATCH 3/3] s390x: run: Skip PV tests when tcg is the accelerator
Quoted 21 lines · David Hildenbrand
Quoted 20 lines · Thomas Huth
Quoted 12 lines · Janosch Frank
TCG doesn't support PV.
Signed-off-by Janosch Frank <[email protected]>---
s390x/run | 5 +++++1 file changed, 5 insertions(+)s390x/run +0
-0@@ -19,6 +19,11 @@ elseQuoted 4 lines
ACCEL=$DEF_ACCEL
fi
+if [ "${1: -7}" == ".pv.bin" ] || [ "${TESTNAME: -3}" == "_PV" ] && [ $ACCEL == "tcg" ]; thenPut $ACCEL in quotes?
Quoted 4 lines
Quoted 2 lines
With that nit fixed:
Should these "==" be "=" ? Bash string comparisons always mess with my mind.
Oh, right. I also always have to check "man test" to get the right answer, but "=" is more portable, indeed. (Well, k-u-t are hard-wired to bash, but it's better to write clean shell code anyway)
Thomas