1) don't create a test.log file in every CWD that a standalone test gets run from. 2) keep '>> test.log' from interfering with the MAX_SMP loop. 3) replace ./$TEST_DIR-run with $RUNTIME_arch_run in the MAX_SMP loop. Also fixes the MAX_SMP loop for later QEMU. The 'exceeds max...' string needed updating to have capital CPU. We change that, but also just add '-i' to grep to keep it working on older QEMU. The comment for the MAX_SMP loop is also updated to better explain it and hint at its eventual demise. Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx> --- run_tests.sh | 5 +++-- scripts/runtime.bash | 15 ++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index b488949d219b0..2312e031482a4 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -7,9 +7,10 @@ fi source config.mak source scripts/functions.bash -RUNTIME_arch_run="./$TEST_DIR/run >> test.log" +RUNTIME_arch_run="./$TEST_DIR/run" source scripts/runtime.bash +RUNTIME_arch_run="./$TEST_DIR/run >> test.log" config=$TEST_DIR/unittests.cfg - +echo > test.log for_each_unittest $config run diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 180746a70a8d9..fc878f99c977f 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -74,7 +74,6 @@ specify the appropriate qemu binary for ARCH-run. EOF } -echo > test.log while getopts "g:hv" opt; do case $opt in g) @@ -93,11 +92,17 @@ while getopts "g:hv" opt; do esac done +MAX_SMP=$(getconf _NPROCESSORS_CONF) # -# Probe for MAX_SMP +# Probe for MAX_SMP, in case it's less than the number of host cpus. # -MAX_SMP=$(getconf _NPROCESSORS_CONF) -while ./$TEST_DIR-run _NO_FILE_4Uhere_ -smp $MAX_SMP \ - |& grep -q 'exceeds max cpus'; do +# This probing currently only works for ARM, as x86 bails on another +# error first. Also, this probing isn't necessary for any ARM hosts +# running kernels later than v4.3, i.e. those including ef748917b52 +# "arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS'". So, at some +# point when maintaining the while loop gets too tiresome, we can +# just remove it... +while $RUNTIME_arch_run _NO_FILE_4Uhere_ -smp $MAX_SMP \ + |& grep -qi 'exceeds max CPUs'; do ((--MAX_SMP)) done -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html