From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com
Subject: [kvm-unit-tests PATCH 1/6] run_tests.sh: a few rewrite fixups
Date: Fri, 22 Jan 2016 15:58:24 +0100 [thread overview]
Message-ID: <1453474709-10679-2-git-send-email-drjones@redhat.com> (raw)
In-Reply-To: <1453474709-10679-1-git-send-email-drjones@redhat.com>
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@redhat.com>
---
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
next prev parent reply other threads:[~2016-01-22 14:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-22 14:58 [kvm-unit-tests PATCH 0/6] run_tests fixes and new functionality prep Andrew Jones
2016-01-22 14:58 ` Andrew Jones [this message]
2016-01-22 14:58 ` [kvm-unit-tests PATCH 2/6] mkstandalone: fix generation for arm Andrew Jones
2016-01-26 11:01 ` Paolo Bonzini
2016-01-26 12:21 ` Andrew Jones
2016-01-22 14:58 ` [kvm-unit-tests PATCH 3/6] arch-run: DRYRUN is no longer needed, kill it Andrew Jones
2016-01-22 14:58 ` [kvm-unit-tests PATCH 4/6] arm/run: allow tests to run in AArch32 mode Andrew Jones
2016-01-22 14:58 ` [kvm-unit-tests PATCH 5/6] runtime: move getopts to run_tests.sh Andrew Jones
2016-01-26 11:06 ` Paolo Bonzini
2016-01-26 12:24 ` Andrew Jones
2016-01-22 14:58 ` [kvm-unit-tests PATCH 6/6] runtime: make the MAX_SMP loop a function Andrew Jones
2016-01-26 11:08 ` Paolo Bonzini
2016-01-26 12:28 ` Andrew Jones
2016-01-26 12:38 ` Paolo Bonzini
2016-01-22 15:29 ` [kvm-unit-tests PATCH 0/6] run_tests fixes and new functionality prep Radim Krčmář
2016-01-26 11:09 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453474709-10679-2-git-send-email-drjones@redhat.com \
--to=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).