diff options
author | Hongbo Zhang <hongbo.zhang@linaro.org> | 2014-04-09 18:10:50 +0800 |
---|---|---|
committer | Hongbo Zhang <hongbo.zhang@linaro.org> | 2014-04-09 18:27:45 +0800 |
commit | 23fb593175859e15dc2576f8472cf6827a9d94bb (patch) | |
tree | e3479772f789bdb5439386593fe218221229e620 | |
parent | 19cea9a628b0a9d719282cd0dd842006f5063a32 (diff) |
kvm: add sanity check for kvm test
If success of former step is precondition of later step, when the former step
fails, the later step should be skiped, e.g. if the kvm initialization fails,
or the kvm.qcow2.gz isn't downloaded correctly, all the following tests should
be skipped, otherwise more failures are generated meanlessly, thus bug reporter
and analyzer aren't clear easily about which test fails.
Change-Id: Iaaa5c6842f8c6864b309cc6e7716a966986b03ef
Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
-rwxr-xr-x | common/scripts/kvm/test-kvm.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/common/scripts/kvm/test-kvm.sh b/common/scripts/kvm/test-kvm.sh index 37f4e29..de0d2a2 100755 --- a/common/scripts/kvm/test-kvm.sh +++ b/common/scripts/kvm/test-kvm.sh @@ -11,7 +11,14 @@ if [ "x$1" = "xbenchmark" ]; then KVM_BOOT="$KVM_BOOT 0 none" fi -dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT 0 pc pass" || echo "$KVM_INIT 0 pc fail" +dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT 0 pc pass" || \ +{ + echo "$KVM_INIT 0 pc fail" + echo "$KVM_HOST_NET 0 pc skip" + echo "$KVM_BOOT 0 pc skip" + echo "$KVM_GUEST_NET 0 pc skip" + exit 0 +} if hash curl 2>/dev/null; then EXTRACT_BUILD_NUMBER="curl -sk" @@ -28,6 +35,13 @@ $DOWNLOAD_FILE http://snapshots.linaro.org/ubuntu/images/kvm/$BUILD_NUMBER/zImag $DOWNLOAD_FILE http://snapshots.linaro.org/ubuntu/images/kvm/$BUILD_NUMBER/vexpress-v2p-ca15-tc1.dtb gunzip kvm.qcow2.gz +if [ $? -ne 0 ]; then + echo "$KVM_HOST_NET 0 pc skip" + echo "$KVM_BOOT 0 pc skip" + echo "$KVM_GUEST_NET 0 pc skip" + exit 0 +fi + modprobe nbd max_part=16 qemu-nbd -c /dev/nbd0 kvm.qcow2 mount /dev/nbd0p2 /mnt/ |