From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [kvm-unit-tests PATCH 1/6] run_tests.sh: a few rewrite fixups Date: Fri, 22 Jan 2016 15:58:24 +0100 Message-ID: <1453474709-10679-2-git-send-email-drjones@redhat.com> References: <1453474709-10679-1-git-send-email-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36323 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbcAVO6h (ORCPT ); Fri, 22 Jan 2016 09:58:37 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id A90F1C0AC911 for ; Fri, 22 Jan 2016 14:58:37 +0000 (UTC) In-Reply-To: <1453474709-10679-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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