diff mbox

[2/3] raisin: check for invalid initrds

Message ID 1495575783-23675-2-git-send-email-sstabellini@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stefano Stabellini May 23, 2017, 9:43 p.m. UTC
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tests/busybox-pv b/tests/busybox-pv
index a7ae976..7ad4f7a 100755
--- a/tests/busybox-pv
+++ b/tests/busybox-pv
@@ -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