]> xenbits.xensource.com Git - raisin.git/commitdiff
raisin: check for invalid initrds
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 23 May 2017 21:39:55 +0000 (14:39 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 23 May 2017 21:39:55 +0000 (14:39 -0700)
get_host_initrd can return an invalid or null initrd. Do not set the
ramdisk option in the VM config file to an invalid value.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
tests/busybox-pv

index a7ae976894b18aa812970c9e2739e650590110d0..7ad4f7aa5ddd45670efdfc876575dfdd85089661 100755 (executable)
@@ -21,7 +21,6 @@ function busybox-pv-test() {
 
     cat >busybox-pv <<EOF
 kernel = "`get_host_kernel`"
-ramdisk = "`get_host_initrd`"
 extra = "root=/dev/xvda console=hvc0"
 memory = 512
 name = "raisin-test"
@@ -31,6 +30,10 @@ serial="pty"
 boot="c"
 vif=['bridge=xenbr1']
 EOF
+    if [[ -e "`get_host_initrd`" ]]
+    then
+        echo "ramdisk = \"`get_host_initrd`\"" >> busybox-pv
+    fi
 
     $SUDO xl create busybox-pv
     check_guest_alive