diff mbox

hwsim tests: allow setting KERNEL and KVMARGS

Message ID 1383225740-16334-1-git-send-email-johannes@sipsolutions.net
State Accepted
Headers show

Commit Message

Johannes Berg Oct. 31, 2013, 1:22 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Rather than just having KERNELDIR, allow setting KERNEL directly.
Also remove the -s option that prevents running multiple machines
at the same time, but add a KVMARGS= variable that can be used to
restore that if needed.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/vm/vm-run.sh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Jouni Malinen Nov. 2, 2013, 9:06 a.m. UTC | #1
On Thu, Oct 31, 2013 at 02:22:20PM +0100, Johannes Berg wrote:
> Rather than just having KERNELDIR, allow setting KERNEL directly.
> Also remove the -s option that prevents running multiple machines
> at the same time, but add a KVMARGS= variable that can be used to
> restore that if needed.

Thanks, applied these:

Johannes Berg (5):
      hwsim tests: Allow setting KERNEL and KVMARGS
      hwsim tests: Refactor test results reporting
      hwsim tests: Create results database in VM tests
      hwsim tests: Prefill database in VM tests
      hwsim tests: Add build script

Waiting for an update for 'hwsim tests: check kernel messages for
warnings/bugs'.
diff mbox

Patch

diff --git a/tests/hwsim/vm/vm-run.sh b/tests/hwsim/vm/vm-run.sh
index dfd8267..805fced 100755
--- a/tests/hwsim/vm/vm-run.sh
+++ b/tests/hwsim/vm/vm-run.sh
@@ -22,13 +22,18 @@  KVMOUT=ttyS1
 # you can set EPATH if you need anything extra in $PATH inside the VM
 #EPATH=/some/dir
 
+# extra KVM arguments, e.g. -s for gdbserver
+#KVMARGS=-s
+
 test -f vm-config && . vm-config
 
-if [ -z "$KERNELDIR" ] ; then
-	echo "You need to set a KERNELDIR (in the environment or vm-config)"
+if [ -z "$KERNEL" ] && [ -z "$KERNELDIR" ] ; then
+	echo "You need to set a KERNEL or KERNELDIR (in the environment or vm-config)"
 	exit 2
 fi
-KERNEL=$KERNELDIR/arch/x86_64/boot/bzImage
+if [ -z "$KERNEL" ] ; then
+	KERNEL=$KERNELDIR/arch/x86_64/boot/bzImage
+fi
 
 
 CMD=$TESTDIR/vm/inside.sh
@@ -37,7 +42,7 @@  mkdir -p $LOGDIR
 
 exec kvm \
 	-kernel $KERNEL -smp 4 \
-	-s -m $MEMORY -nographic \
+	$KVMARGS -m $MEMORY -nographic \
 	-fsdev local,security_model=none,id=fsdev-root,path=/$ROTAG \
 	-device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \
 	-fsdev local,security_model=none,id=fsdev-logs,path="$LOGDIR",writeout=immediate \