]> xenbits.xensource.com Git - raisin.git/commitdiff
Introduce cirros-pvgrub2-pv test
authorGéza Gémes <geza.gemes@gmail.com>
Sat, 25 Mar 2017 19:28:57 +0000 (20:28 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 27 Mar 2017 18:44:27 +0000 (11:44 -0700)
This test verifies booting the cirros image using pvgrub2

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
tests/cirros-pvgrub2-pv [new file with mode: 0644]
tests/series

diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
new file mode 100644 (file)
index 0000000..4994ea9
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-pvgrub2-pv-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-pvgrub2-pv-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    # Need to install grub.cfg
+    local cirros_disk_loop=`$SUDO $BASEDIR/scripts/lopartsetup $testdir/$CIRROS_DISK_FILE | head -1 | cut -d ":" -f 1`
+    local cirros_disk_mntpt=`mktemp -d`
+    $SUDO mount $cirros_disk_loop $cirros_disk_mntpt
+    cirros_grub_cfg $cirros_disk_mntpt
+    $SUDO umount $cirros_disk_mntpt
+    $SUDO rmdir $cirros_disk_mntpt
+    $SUDO losetup -d $cirros_disk_loop
+    cat >$testdir/cirros-pvgrub2-pv.cfg <<EOF
+name = "raisin-test"
+memory = 128
+vcpus = 2
+kernel = "$PVGRUB"
+disk = [ '${testdir}/${CIRROS_DISK_FILE},raw,xvda,rw' ]
+extra = "$CIRROS_GRUB_CFG"
+vif = [ 'bridge=xenbr1' ]
+EOF
+
+    $SUDO xl create $testdir/cirros-pvgrub2-pv.cfg
+    check_guest_alive
+}
index 372fafba6de9637f6564f3a2c5cefe42b6141790..1fec245a624755bfdc34a882630a865f204afa2a 100644 (file)
@@ -3,3 +3,4 @@ busybox-hvm
 busybox-hvm-migrate
 cirros-separate-kernel-pv
 cirros-pygrub-pv
+cirros-pvgrub2-pv