aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@linaro.org>2013-10-05 14:52:38 -0500
committerKim Phillips <kim.phillips@linaro.org>2013-10-15 18:06:40 -0500
commit28a4d8d6d079301ab1442ef62e9a5d18e445b1d7 (patch)
tree988e93f7f04233253631f8e446e89c26eb0051ce
parent0c1245bf98ee11dd124711e0afa8f5e425c10f3a (diff)
kvm: add simple networking test - ping -c 10 192.168.1.10
- clean up qemu command line - add virtio-net enablement flags to qemu command line - add host bridge for guest networking - simple ping -c 10 Change-Id: I7de29c349e10649045acba5b21aad221574d479a Signed-off-by: Kim Phillips <kim.phillips@linaro.org>
-rw-r--r--common/scripts/kvm/kvm-lava.conf2
-rwxr-xr-xcommon/scripts/kvm/test-kvm.sh19
2 files changed, 20 insertions, 1 deletions
diff --git a/common/scripts/kvm/kvm-lava.conf b/common/scripts/kvm/kvm-lava.conf
index a86f1bae..f296121a 100644
--- a/common/scripts/kvm/kvm-lava.conf
+++ b/common/scripts/kvm/kvm-lava.conf
@@ -4,6 +4,8 @@ stop on runlevel [!23]
console output
script
echo "kvm-boot-1: pass"
+ echo "Test networking on guest"
+ ping -W 4 -c 10 192.168.1.10 && echo "kvm-guest-net-1: pass" || echo "kvm-guest-net-1: fail"
echo "Test hackbench on guest"
sh /root/test-rt-tests.sh
poweroff
diff --git a/common/scripts/kvm/test-kvm.sh b/common/scripts/kvm/test-kvm.sh
index 87c4d8ed..aa5625ce 100755
--- a/common/scripts/kvm/test-kvm.sh
+++ b/common/scripts/kvm/test-kvm.sh
@@ -19,7 +19,24 @@ umount /mnt
sync
qemu-nbd -d /dev/nbd0
-qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 -kernel ./zImage -dtb ./vexpress-v2p-ca15-tc1.dtb -append 'root=/dev/mmcblk0p2 rw rootwait mem=1024M console=ttyAMA0,38400n8' -drive if=sd,cache=writeback,file=kvm.qcow2 -redir tcp:5022::22 -nographic -enable-kvm 2>&1|tee kvm-log.txt
+echo setting up and testing networking bridge for guest
+brctl addbr br0
+tunctl -u root
+ifconfig eth0 0.0.0.0 up
+ifconfig tap0 0.0.0.0 up
+brctl addif br0 eth0
+brctl addif br0 tap0
+udhcpc -t 10 -i br0
+ping -W 4 -c 10 192.168.1.10 && echo "kvm-host-net-1: pass" || echo "kvm-host-net-1: fail"
+
+qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \
+ -kernel ./zImage -dtb ./vexpress-v2p-ca15-tc1.dtb \
+ -append 'root=/dev/mmcblk0p2 rw rootwait mem=1024M console=ttyAMA0,38400n8' \
+ -drive if=sd,cache=writeback,file=kvm.qcow2 \
+ -netdev tap,id=tap0,script=no,downscript=no,ifname="tap0" \
+ -device virtio-net-device,netdev=tap0 \
+ -nographic -enable-kvm \
+ 2>&1|tee kvm-log.txt
if ! grep -q "kvm-boot-1:" kvm-log.txt
then