diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2013-10-18 13:53:03 +0200 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2013-11-22 10:47:54 +0100 |
commit | 7f3be206af198cebee10720bc59d7392164cdedf (patch) | |
tree | f5b46f2a6a869f443cdc7d47439c9e395eb03a57 /common | |
parent | 751be8e82a104ad60e7fa67227cff2bc6e10a01a (diff) |
added lmbench to kvm-benchmark.yaml test for OE
simplified kvm-lava.conf, and construct tests in test-guest.sh
to be called from both kvm.yaml and kvm-benchmark.yaml
Using common/scripts/lmbench.sh to run inside the guest
parse_lmbench.sh: had to add --text to the grep command because
kvm-log.txt becomes in data and not text format.
Modifications by Riku: keep kvm-lava.conf around
Change-Id: Icfb5ae1ebe46400f018cd591aa4ba97aed56a044
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/scripts/kvm/kvm-lava.conf | 6 | ||||
-rwxr-xr-x | common/scripts/kvm/test-kvm.sh | 41 | ||||
-rwxr-xr-x | common/scripts/parse_lmbench.sh | 4 |
3 files changed, 38 insertions, 13 deletions
diff --git a/common/scripts/kvm/kvm-lava.conf b/common/scripts/kvm/kvm-lava.conf index f296121..f2f3dad 100644 --- a/common/scripts/kvm/kvm-lava.conf +++ b/common/scripts/kvm/kvm-lava.conf @@ -3,10 +3,6 @@ start on runlevel [23] 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 + sh /usr/bin/test-guest.sh poweroff end script diff --git a/common/scripts/kvm/test-kvm.sh b/common/scripts/kvm/test-kvm.sh index aa5625c..8d2c578 100755 --- a/common/scripts/kvm/test-kvm.sh +++ b/common/scripts/kvm/test-kvm.sh @@ -1,6 +1,17 @@ #!/bin/sh -dmesg|grep 'Hyp mode initialized successfully' && echo kvm-init-1: pass || echo kvm-init-1: fail +KVM_HOST_NET="kvm-host-net-1:" +KVM_GUEST_NET="kvm-guest-net-1:" +KVM_INIT="kvm-init-1:" +KVM_BOOT="kvm-boot-1:" +if [ $1 = "benchmark" ]; then + KVM_HOST_NET="$KVM_HOST_NET 0 none" + KVM_GUEST_NET="$KVM_GUEST_NET 0 none" + KVM_INIT="$KVM_INIT 0 none" + KVM_BOOT="$KVM_BOOT 0 none" +fi + +dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT pass" || echo "$KVM_INIT fail" wget --no-check-certificate http://snapshots.linaro.org/kernel-hwpack/linux-vexpress-kvm/linux-vexpress-kvm/kvm.qcow2.gz gunzip kvm.qcow2.gz @@ -12,9 +23,26 @@ mount /dev/nbd0p2 /mnt/ cp /mnt/boot/vmlinuz-*-linaro-vexpress ./zImage cp /mnt/lib/firmware/*-linaro-vexpress/device-tree/vexpress-v2p-ca15-tc1.dtb . cp common/scripts/kvm/kvm-lava.conf /mnt/etc/init/kvm-lava.conf -cp /usr/bin/hackbench /mnt/usr/bin/hackbench -cp common/scripts/kvm/test-rt-tests.sh /mnt/root/test-rt-tests.sh -chmod 777 /mnt/root/test-rt-tests.sh + +# Build up file test-guest.sh +if [ $1 = "benchmark" ]; then + cp /usr/bin/lat_ctx /mnt/usr/bin/lat_ctx + cp common/scripts/lmbench.sh /mnt/root/lmbench.sh + TEST_SCRIPT=/root/lmbench.sh +else + cp /usr/bin/hackbench /mnt/usr/bin/hackbench + cp common/scripts/kvm/test-rt-tests.sh /mnt/root/test-rt-tests.sh + TEST_SCRIPT=/root/test-rt-tests.sh +fi + +cat >> /mnt/usr/bin/test-guest.sh <<EOF +#!/bin/sh + echo "$KVM_BOOT pass" + ping -W 4 -c 10 192.168.1.10 && echo "$KVM_GUEST_NET pass" || echo "$KVM_GUEST_NET fail" + sh $TEST_SCRIPT +EOF +chmod a+x /mnt/usr/bin/test-guest.sh + umount /mnt sync qemu-nbd -d /dev/nbd0 @@ -27,7 +55,8 @@ 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" + +ping -W 4 -c 10 192.168.1.10 && echo "$KVM_HOST_NET pass" || echo "$KVM_HOST_NET fail" qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \ -kernel ./zImage -dtb ./vexpress-v2p-ca15-tc1.dtb \ @@ -40,5 +69,5 @@ qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \ if ! grep -q "kvm-boot-1:" kvm-log.txt then - echo "kvm-boot-1: fail" + echo "$KVM_BOOT fail" fi diff --git a/common/scripts/parse_lmbench.sh b/common/scripts/parse_lmbench.sh index 1036b69..a2df97f 100755 --- a/common/scripts/parse_lmbench.sh +++ b/common/scripts/parse_lmbench.sh @@ -3,8 +3,8 @@ LOG_FILE=$1 OUTPUT_FILE=$3 TMP_FILE="$1.$$" -BEGIN=$(grep -n "^BEGIN LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') -END=$(grep -n "^END LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') +BEGIN=$(grep --text -n "^BEGIN LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') +END=$(grep --text -n "^END LMBENCH" $LOG_FILE | awk -F ':' '{print $1}') BEGINNING=$(expr $(expr $END - $BEGIN) + 1) head -n $END $LOG_FILE | tail -n $BEGINNING >$TMP_FILE |