xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/10] Enable cirros tests in the default config
  2017-03-18 14:00 [raisin][PATCH 00/10] Introduce usage of cirros images Géza Gémes
@ 2017-03-18 14:00 ` Géza Gémes
  0 siblings, 0 replies; 24+ messages in thread
From: Géza Gémes @ 2017-03-18 14:00 UTC (permalink / raw)
  To: xen-devel; +Cc: sstabellini, george.dunlap, Géza Gémes

The existing cirros tests are enabled, with the following
exceptions:

cirros-pygrub-pv skipped as raisin installed pygrub has missing
imports

cirros-minios-stubdom-hvm and cirros-minios-stubdom-pvhvm are
skipped as raisin does not install the stubdom

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/defconfig b/defconfig
index 111554e..8f6122b 100644
--- a/defconfig
+++ b/defconfig
@@ -31,6 +31,6 @@ GIT_TRANSPORT="git"
 # Tests
 ## All tests: busybox-pv busybox-hvm
 ## ENABLED_TESTS is the list of test run by raise test
-ENABLED_TESTS="busybox-pv busybox-hvm"
+ENABLED_TESTS="busybox-pv busybox-hvm cirros-separate-kernel-pv cirros-pvgrub2-pv cirros-qemu-hvm cirros-qemu-pvhvm"
 
 . configs/config-cirros
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [raisin][PATCH 00/10] pygrub fix + cirros tests
@ 2017-03-25 19:28 Géza Gémes
  2017-03-25 19:28 ` [PATCH 01/10] Fix installation of python libs Géza Gémes
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

First patch moves python2.7/site-packages/* to python2.7/dist-packages/
at debian package build, this fixes pygrub imports.

Cirros tests are also introduced by this series of patches.
Changes since the previous patchsets:
 - Downloaded cirros components are kept in a separate folder
 - Each test sets up its own images, keeping the downloaded
parts intact
 - qemu-img and pvgrub detection moved to common-functions

Géza Gémes (10):
  Fix installation of python libs
  Introduce cirros tests
  Introduce cirros-separate-kernel-pv test
  Introduce cirros-pygrub-pv test
  Introduce cirros-pvgrub2-pv test
  Introduce cirros-qemu-hvm test
  Introduce cirros-minios-stubdom-hvm test
  Introduce cirros-qemu-pvhvm test
  Introduce cirros-minios-stubdom-pvhvm test
  Enable cirros tests in the default config

 defconfig                          |   2 +-
 lib/common-functions.sh            |  33 +++++++++++
 lib/common-tests.sh                | 109 +++++++++++++++++++++++++++++++++++++
 scripts/mkdeb                      |   4 ++
 tests-configs/config-cirros_x86_32 |  13 +++++
 tests-configs/config-cirros_x86_64 |  13 +++++
 tests/cirros-minios-stubdom-hvm    |  27 +++++++++
 tests/cirros-minios-stubdom-pvhvm  |  28 ++++++++++
 tests/cirros-pvgrub2-pv            |  33 +++++++++++
 tests/cirros-pygrub-pv             |  25 +++++++++
 tests/cirros-qemu-hvm              |  26 +++++++++
 tests/cirros-qemu-pvhvm            |  27 +++++++++
 tests/cirros-separate-kernel-pv    |  28 ++++++++++
 tests/series                       |   7 +++
 14 files changed, 374 insertions(+), 1 deletion(-)
 create mode 100644 tests-configs/config-cirros_x86_32
 create mode 100644 tests-configs/config-cirros_x86_64
 create mode 100644 tests/cirros-minios-stubdom-hvm
 create mode 100644 tests/cirros-minios-stubdom-pvhvm
 create mode 100644 tests/cirros-pvgrub2-pv
 create mode 100644 tests/cirros-pygrub-pv
 create mode 100644 tests/cirros-qemu-hvm
 create mode 100644 tests/cirros-qemu-pvhvm
 create mode 100644 tests/cirros-separate-kernel-pv

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 01/10] Fix installation of python libs
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:08   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 02/10] Introduce cirros tests Géza Gémes
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

Change deb package build in order to move content of the
site-packages folder to dist-packages in this way having
the libs inluded in the default PYTHONPATH

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 scripts/mkdeb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/mkdeb b/scripts/mkdeb
index 3796300..d7ddace 100755
--- a/scripts/mkdeb
+++ b/scripts/mkdeb
@@ -46,6 +46,10 @@ then
     rm -rf deb/usr/lib64
 fi
 
+# Make sure that python libs will be in the path
+mkdir -p deb/usr/lib/python2.7/dist-packages
+mv deb/usr/lib/python2.7/site-packages/* deb/usr/lib/python2.7/dist-packages
+
 # Fill in the debian boilerplate
 mkdir -p deb/DEBIAN
 cat >deb/DEBIAN/control <<EOF
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 02/10] Introduce cirros tests
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
  2017-03-25 19:28 ` [PATCH 01/10] Fix installation of python libs Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:11   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 03/10] Introduce cirros-separate-kernel-pv test Géza Gémes
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

Add support for using cirros images in raisin tests

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 lib/common-functions.sh            |  33 +++++++++++
 lib/common-tests.sh                | 109 +++++++++++++++++++++++++++++++++++++
 tests-configs/config-cirros_x86_32 |  13 +++++
 tests-configs/config-cirros_x86_64 |  13 +++++
 4 files changed, 168 insertions(+)
 create mode 100644 tests-configs/config-cirros_x86_32
 create mode 100644 tests-configs/config-cirros_x86_64

diff --git a/lib/common-functions.sh b/lib/common-functions.sh
index d4476f3..efc92ff 100644
--- a/lib/common-functions.sh
+++ b/lib/common-functions.sh
@@ -439,3 +439,36 @@ function uninstall_package() {
         error_echo "Don't know how to uninstall packages on $DISTRO"
     fi
 }
+
+function get-qemu-img() {
+    set +e
+    QEMU_IMG=`which qemu-img`
+    set -e
+    if [[ -z "$QEMU_IMG" ]]
+    then
+        QEMU_IMG="/usr/lib/xen/bin/qemu-img"
+    fi
+    if [[ -x $QEMU_IMG ]]
+    then
+        export QEMU_IMG
+    else
+        error_echo "No working qemu-img found! Some tests may fail!"
+    fi
+}
+
+function get-pvgrub() {
+    local arch=$1
+    set +e
+    PVGRUB=`which grub-${arch}-xen`
+    set -e
+    if [[ -z "$PVGRUB" ]]
+    then
+        PVGRUB="/usr/lib/xen/boot/grub-${arch}-xen"
+    fi
+    if [[ -f $PVGRUB ]]
+    then
+        export PVGRUB
+    else
+        error_echo "No working pvgrub found! Some tests may fail!"
+    fi
+}
diff --git a/lib/common-tests.sh b/lib/common-tests.sh
index d346af4..c07bb18 100644
--- a/lib/common-tests.sh
+++ b/lib/common-tests.sh
@@ -178,3 +178,112 @@ function get_host_initrd() {
         exit 1
     fi
 }
+
+function cirros_network_init() {
+    rootdir=$1
+    ifile=`mktemp`
+    # Create static network config
+    cat >$ifile <<EOF
+auto lo
+iface lo inet loopback
+
+auto eth0
+iface eth0 inet static
+    address 169.254.0.2
+    network 169.254.0.0
+    broadcast 169.254.0.255
+    netmask 255.255.255.0
+EOF
+    $SUDO mv -f $ifile $rootdir/etc/network/interfaces
+    # Disable cloud-init
+    $SUDO rm -f ${rootdir}/etc/rc3.d/S*cirros*ds*
+    $SUDO rm -f ${rootdir}/etc/rc3.d/S*-cirros-userdata
+}
+
+function get_cirros_kernel() {
+    bootdir=$1
+    basename `find $bootdir -name vmlinuz* 2>/dev/null | head -1`
+}
+
+function get_cirros_initrd() {
+    bootdir=$1
+    basename `find $bootdir -name initrd* 2>/dev/null | head -1`
+}
+
+function cirros_grub_cfg() {
+    rootdir=$1
+    get-pvgrub $CIRROS_ARCH
+    grubroot="`echo $CIRROS_GRUB_CFG | cut -d ')' -f 1`)"
+    grubcfg="`echo $CIRROS_GRUB_CFG | cut -d ')' -f 2`"
+    grubdir=`dirname $grubcfg`
+    bootdir=`dirname $grubdir`
+    tmpgrubcfg=`mktemp`
+    cat > $tmpgrubcfg <<EOF
+root="$grubroot"
+insmod xzio
+insmod gzio
+insmod btrfs
+insmod ext2
+set timeout=1
+set default=0
+menuentry Cirros {
+    linux `echo $bootdir`/`get_cirros_kernel ${rootdir}/${bootdir}` root=/dev/xvda1 ro
+    initrd `echo $bootdir`/`get_cirros_initrd ${rootdir}/${bootdir}`
+}
+EOF
+    $SUDO mv -f $tmpgrubcfg ${rootdir}/${grubcfg}
+}
+
+function download_cirros_components() {
+    . tests-configs/config-cirros_$RAISIN_ARCH
+    mkdir -p $CIRROS_DOWNLOADS
+    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_KERNEL_FILE ]]
+    then
+        verbose_echo "Downloading cirros kernel"
+        wget -q $CIRROS_KERNEL_URL -P $CIRROS_DOWNLOADS
+    fi
+    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_INITRD_FILE ]]
+    then
+        verbose_echo "Downloading cirros initrd"
+        wget -q $CIRROS_INITRD_URL -P $CIRROS_DOWNLOADS
+    fi
+    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE ]]
+    then
+        verbose_echo "Downloading cirros rootfs"
+        wget -q $CIRROS_ROOTFS_URL -P $CIRROS_DOWNLOADS
+        gunzip $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE.gz
+        local cirros_rootfs_loop=`create_loop $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE`
+        local cirros_rootfs_mntpt=`mktemp -d`
+        $SUDO mount $cirros_rootfs_loop $cirros_rootfs_mntpt
+        cirros_network_init $cirros_rootfs_mntpt
+        $SUDO umount $cirros_rootfs_mntpt
+        $SUDO rmdir $cirros_rootfs_mntpt
+        $SUDO losetup -d $cirros_rootfs_loop
+    fi
+    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE ]]
+    then
+        verbose_echo "Downloading cirros disk"
+        wget -q $CIRROS_DISK_URL -P $CIRROS_DOWNLOADS
+        mv $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE.qcow2
+        get-qemu-img
+        $QEMU_IMG convert -f qcow2 -O raw $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE.qcow2 $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE
+        local cirros_disk_loop=`$SUDO $BASEDIR/scripts/lopartsetup $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE | head -1 |
+                                cut -d ":" -f 1`
+        local cirros_disk_mntpt=`mktemp -d`
+        $SUDO mount $cirros_disk_loop $cirros_disk_mntpt
+        cirros_network_init $cirros_disk_mntpt
+        $SUDO umount $cirros_disk_mntpt
+        $SUDO rmdir $cirros_disk_mntpt
+        $SUDO losetup -d $cirros_disk_loop
+    fi
+}
+
+function tear_down_cirros_test() {
+    testdir=$1
+    if [[ `$SUDO xl vm-list | grep "raisin-test" | wc -l` -gt 0 ]]
+    then
+        $SUDO xl destroy "raisin-test"
+    fi
+    verbose_echo "$PREPEND deleting environment of cirros test"
+    $SUDO rm -rf $testdir
+}
diff --git a/tests-configs/config-cirros_x86_32 b/tests-configs/config-cirros_x86_32
new file mode 100644
index 0000000..628e568
--- /dev/null
+++ b/tests-configs/config-cirros_x86_32
@@ -0,0 +1,13 @@
+CIRROS_ARCH=i386
+CIRROS_BASE_URL="https://download.cirros-cloud.net/"
+CIRROS_VERSION="0.3.5"
+CIRROS_DOWNLOADS=$BASEDIR/downloads
+CIRROS_KERNEL_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-kernel
+CIRROS_INITRD_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-initramfs
+CIRROS_ROOTFS_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-rootfs.img
+CIRROS_DISK_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img
+CIRROS_KERNEL_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_KERNEL_FILE
+CIRROS_INITRD_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_INITRD_FILE
+CIRROS_ROOTFS_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_ROOTFS_FILE.gz
+CIRROS_DISK_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_DISK_FILE
+CIRROS_GRUB_CFG="(xen/xvda,msdos1)/boot/grub/grub.cfg"
diff --git a/tests-configs/config-cirros_x86_64 b/tests-configs/config-cirros_x86_64
new file mode 100644
index 0000000..7b78316
--- /dev/null
+++ b/tests-configs/config-cirros_x86_64
@@ -0,0 +1,13 @@
+CIRROS_ARCH=x86_64
+CIRROS_BASE_URL="https://download.cirros-cloud.net/"
+CIRROS_VERSION="0.3.5"
+CIRROS_DOWNLOADS=$BASEDIR/downloads
+CIRROS_KERNEL_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-kernel
+CIRROS_INITRD_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-initramfs
+CIRROS_ROOTFS_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-rootfs.img
+CIRROS_DISK_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img
+CIRROS_KERNEL_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_KERNEL_FILE
+CIRROS_INITRD_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_INITRD_FILE
+CIRROS_ROOTFS_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_ROOTFS_FILE.gz
+CIRROS_DISK_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_DISK_FILE
+CIRROS_GRUB_CFG="(xen/xvda,msdos1)/boot/grub/grub.cfg"
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 03/10] Introduce cirros-separate-kernel-pv test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
  2017-03-25 19:28 ` [PATCH 01/10] Fix installation of python libs Géza Gémes
  2017-03-25 19:28 ` [PATCH 02/10] Introduce cirros tests Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:12   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 04/10] Introduce cirros-pygrub-pv test Géza Gémes
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test is the cirros equivalent of the busybox-pv test

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-separate-kernel-pv | 28 ++++++++++++++++++++++++++++
 tests/series                    |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 tests/cirros-separate-kernel-pv

diff --git a/tests/cirros-separate-kernel-pv b/tests/cirros-separate-kernel-pv
new file mode 100644
index 0000000..fab5856
--- /dev/null
+++ b/tests/cirros-separate-kernel-pv
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-separate-kernel-pv-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-separate-kernel-pv-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_KERNEL_FILE $testdir
+    cp $CIRROS_DOWNLOADS/$CIRROS_INITRD_FILE $testdir
+    cp $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE $testdir
+    cat >$testdir/cirros-separate-kernel-pv.cfg <<EOF
+name = "raisin-test"
+memory = 128
+vcpus = 2
+kernel = "$testdir/$CIRROS_KERNEL_FILE"
+ramdisk = "$testdir/$CIRROS_INITRD_FILE"
+disk = [ '$testdir/$CIRROS_ROOTFS_FILE,raw,xvda,rw' ]
+extra = "root=/dev/xvda"
+vif = [ 'bridge=xenbr1' ]
+EOF
+
+    $SUDO xl create $testdir/cirros-separate-kernel-pv.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index a2f4b34..38ee35a 100644
--- a/tests/series
+++ b/tests/series
@@ -1,3 +1,4 @@
 busybox-pv
 busybox-hvm
 busybox-hvm-migrate
+cirros-separate-kernel-pv
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 04/10] Introduce cirros-pygrub-pv test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (2 preceding siblings ...)
  2017-03-25 19:28 ` [PATCH 03/10] Introduce cirros-separate-kernel-pv test Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:13   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 05/10] Introduce cirros-pvgrub2-pv test Géza Gémes
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test verifies booting the cirros image using pygrub

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-pygrub-pv | 25 +++++++++++++++++++++++++
 tests/series           |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 tests/cirros-pygrub-pv

diff --git a/tests/cirros-pygrub-pv b/tests/cirros-pygrub-pv
new file mode 100644
index 0000000..37e288c
--- /dev/null
+++ b/tests/cirros-pygrub-pv
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-pygrub-pv-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-pygrub-pv-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    cat >$testdir/cirros-pygrub-pv.cfg <<EOF
+name = "raisin-test"
+memory = 128
+vcpus = 2
+bootloader = "pygrub"
+disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
+extra = "root=/dev/xvda1"
+vif = [ 'bridge=xenbr1' ]
+EOF
+
+    $SUDO xl create $testdir/cirros-pygrub-pv.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index 38ee35a..372fafb 100644
--- a/tests/series
+++ b/tests/series
@@ -2,3 +2,4 @@ busybox-pv
 busybox-hvm
 busybox-hvm-migrate
 cirros-separate-kernel-pv
+cirros-pygrub-pv
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 05/10] Introduce cirros-pvgrub2-pv test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (3 preceding siblings ...)
  2017-03-25 19:28 ` [PATCH 04/10] Introduce cirros-pygrub-pv test Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:13   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 06/10] Introduce cirros-qemu-hvm test Géza Gémes
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test verifies booting the cirros image using pvgrub2

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-pvgrub2-pv | 33 +++++++++++++++++++++++++++++++++
 tests/series            |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 tests/cirros-pvgrub2-pv

diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
new file mode 100644
index 0000000..4994ea9
--- /dev/null
+++ b/tests/cirros-pvgrub2-pv
@@ -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
+}
diff --git a/tests/series b/tests/series
index 372fafb..1fec245 100644
--- a/tests/series
+++ b/tests/series
@@ -3,3 +3,4 @@ busybox-hvm
 busybox-hvm-migrate
 cirros-separate-kernel-pv
 cirros-pygrub-pv
+cirros-pvgrub2-pv
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 06/10] Introduce cirros-qemu-hvm test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (4 preceding siblings ...)
  2017-03-25 19:28 ` [PATCH 05/10] Introduce cirros-pvgrub2-pv test Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:16   ` Stefano Stabellini
  2017-03-25 19:28 ` [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test Géza Gémes
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test is the cirros equivalent of the busybox-hvm test

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-qemu-hvm | 26 ++++++++++++++++++++++++++
 tests/series          |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 tests/cirros-qemu-hvm

diff --git a/tests/cirros-qemu-hvm b/tests/cirros-qemu-hvm
new file mode 100644
index 0000000..2e4ec2a
--- /dev/null
+++ b/tests/cirros-qemu-hvm
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-qemu-hvm-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-qemu-hvm-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    cat >$testdir/cirros-qemu-hvm.cfg <<EOF
+name = "raisin-test"
+builder = "hvm"
+memory = 128
+vcpus = 2
+disk = [ '$testdir/$CIRROS_DISK_FILE,raw,hda,rw' ]
+vif = [ 'bridge=xenbr1' ]
+serial="pty"
+boot="c"
+EOF
+
+    $SUDO xl create $testdir/cirros-qemu-hvm.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index 1fec245..49a9257 100644
--- a/tests/series
+++ b/tests/series
@@ -4,3 +4,4 @@ busybox-hvm-migrate
 cirros-separate-kernel-pv
 cirros-pygrub-pv
 cirros-pvgrub2-pv
+cirros-qemu-hvm
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (5 preceding siblings ...)
  2017-03-25 19:28 ` [PATCH 06/10] Introduce cirros-qemu-hvm test Géza Gémes
@ 2017-03-25 19:28 ` Géza Gémes
  2017-03-27 17:16   ` Stefano Stabellini
  2017-03-25 19:29 ` [PATCH 08/10] Introduce cirros-qemu-pvhvm test Géza Gémes
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:28 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test verifies a cirros based hvm domain using a minios based
stubdom as its device model

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-minios-stubdom-hvm | 27 +++++++++++++++++++++++++++
 tests/series                    |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 tests/cirros-minios-stubdom-hvm

diff --git a/tests/cirros-minios-stubdom-hvm b/tests/cirros-minios-stubdom-hvm
new file mode 100644
index 0000000..43dc568
--- /dev/null
+++ b/tests/cirros-minios-stubdom-hvm
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-minios-stubdom-hvm-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-minios-stubdom-hvm-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    cat >$testdir/cirros-minios-stubdom-hvm.cfg <<EOF
+name = "raisin-test"
+builder = "hvm"
+device_model_stubdomain_override = 1
+memory = 128
+vcpus = 2
+disk = [ '$testdir/$CIRROS_DISK_FILE,raw,hda,rw' ]
+vif = [ 'bridge=xenbr1' ]
+serial="pty"
+boot="c"
+EOF
+
+    $SUDO xl create $testdir/cirros-minios-stubdom-hvm.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index 49a9257..7b1ad8e 100644
--- a/tests/series
+++ b/tests/series
@@ -5,3 +5,4 @@ cirros-separate-kernel-pv
 cirros-pygrub-pv
 cirros-pvgrub2-pv
 cirros-qemu-hvm
+cirros-minios-stubdom-hvm
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 08/10] Introduce cirros-qemu-pvhvm test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (6 preceding siblings ...)
  2017-03-25 19:28 ` [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test Géza Gémes
@ 2017-03-25 19:29 ` Géza Gémes
  2017-03-27 17:17   ` Stefano Stabellini
  2017-03-25 19:29 ` [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test Géza Gémes
  2017-03-25 19:29 ` [PATCH 10/10] Enable cirros tests in the default config Géza Gémes
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:29 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test is similar to cirros-qemu-hvm test, differing by
explicitly exposing the xen netfront and blockfront drivers

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-qemu-pvhvm | 27 +++++++++++++++++++++++++++
 tests/series            |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 tests/cirros-qemu-pvhvm

diff --git a/tests/cirros-qemu-pvhvm b/tests/cirros-qemu-pvhvm
new file mode 100644
index 0000000..6cf33e0
--- /dev/null
+++ b/tests/cirros-qemu-pvhvm
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-qemu-pvhvm-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-qemu-pvhvm-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    cat >$testdir/cirros-qemu-pvhvm.cfg <<EOF
+name = "raisin-test"
+builder = "hvm"
+xen_platform_pci = 1
+memory = 128
+vcpus = 2
+disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
+vif = [ 'bridge=xenbr1' ]
+serial="pty"
+boot="c"
+EOF
+
+    $SUDO xl create $testdir/cirros-qemu-pvhvm.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index 7b1ad8e..51dbe17 100644
--- a/tests/series
+++ b/tests/series
@@ -6,3 +6,4 @@ cirros-pygrub-pv
 cirros-pvgrub2-pv
 cirros-qemu-hvm
 cirros-minios-stubdom-hvm
+cirros-qemu-pvhvm
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (7 preceding siblings ...)
  2017-03-25 19:29 ` [PATCH 08/10] Introduce cirros-qemu-pvhvm test Géza Gémes
@ 2017-03-25 19:29 ` Géza Gémes
  2017-03-27 17:17   ` Stefano Stabellini
  2017-03-25 19:29 ` [PATCH 10/10] Enable cirros tests in the default config Géza Gémes
  9 siblings, 1 reply; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:29 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

This test is similar to cirros-minios-stubdom-hvm test, differing by
explicitly exposing the xen netfront and blockfront drivers

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
---
 tests/cirros-minios-stubdom-pvhvm | 28 ++++++++++++++++++++++++++++
 tests/series                      |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 tests/cirros-minios-stubdom-pvhvm

diff --git a/tests/cirros-minios-stubdom-pvhvm b/tests/cirros-minios-stubdom-pvhvm
new file mode 100644
index 0000000..719b78d
--- /dev/null
+++ b/tests/cirros-minios-stubdom-pvhvm
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+set -e
+
+function cirros-minios-stubdom-pvhvm-cleanup() {
+    tear_down_cirros_test $testdir
+}
+
+function cirros-minios-stubdom-pvhvm-test() {
+    download_cirros_components
+    testdir=`mktemp -d`
+    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
+    cat >$testdir/cirros-minios-stubdom-pvhvm.cfg <<EOF
+name = "raisin-test"
+builder = "hvm"
+device_model_stubdomain_override = 1
+xen_platform_pci = 1
+memory = 128
+vcpus = 2
+disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
+vif = [ 'bridge=xenbr1' ]
+serial="pty"
+boot="c"
+EOF
+
+    $SUDO xl create $testdir/cirros-minios-stubdom-pvhvm.cfg
+    check_guest_alive
+}
diff --git a/tests/series b/tests/series
index 51dbe17..ffa8e69 100644
--- a/tests/series
+++ b/tests/series
@@ -7,3 +7,4 @@ cirros-pvgrub2-pv
 cirros-qemu-hvm
 cirros-minios-stubdom-hvm
 cirros-qemu-pvhvm
+cirros-minios-stubdom-pvhvm
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 10/10] Enable cirros tests in the default config
  2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
                   ` (8 preceding siblings ...)
  2017-03-25 19:29 ` [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test Géza Gémes
@ 2017-03-25 19:29 ` Géza Gémes
  9 siblings, 0 replies; 24+ messages in thread
From: Géza Gémes @ 2017-03-25 19:29 UTC (permalink / raw)
  To: xen-devel, sstabellini; +Cc: george.dunlap, Géza Gémes

The existing cirros tests are enabled, with the following
exceptions:
cirros-minios-stubdom-hvm and cirros-minios-stubdom-pvhvm are
skipped as raisin does not install the stubdom

Signed-off-by: Géza Gémes <geza.gemes@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/defconfig b/defconfig
index f8ef398..bdacc7e 100644
--- a/defconfig
+++ b/defconfig
@@ -31,4 +31,4 @@ GIT_TRANSPORT="git"
 # Tests
 ## All tests: busybox-pv busybox-hvm
 ## ENABLED_TESTS is the list of test run by raise test
-ENABLED_TESTS="busybox-pv busybox-hvm"
+ENABLED_TESTS="busybox-pv busybox-hvm cirros-separate-kernel-pv cirros-pygrub-pv cirros-pvgrub2-pv cirros-qemu-hvm cirros-qemu-pvhvm"
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 01/10] Fix installation of python libs
  2017-03-25 19:28 ` [PATCH 01/10] Fix installation of python libs Géza Gémes
@ 2017-03-27 17:08   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:08 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 866 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> Change deb package build in order to move content of the
> site-packages folder to dist-packages in this way having
> the libs inluded in the default PYTHONPATH
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  scripts/mkdeb | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/mkdeb b/scripts/mkdeb
> index 3796300..d7ddace 100755
> --- a/scripts/mkdeb
> +++ b/scripts/mkdeb
> @@ -46,6 +46,10 @@ then
>      rm -rf deb/usr/lib64
>  fi
>  
> +# Make sure that python libs will be in the path
> +mkdir -p deb/usr/lib/python2.7/dist-packages
> +mv deb/usr/lib/python2.7/site-packages/* deb/usr/lib/python2.7/dist-packages
> +
>  # Fill in the debian boilerplate
>  mkdir -p deb/DEBIAN
>  cat >deb/DEBIAN/control <<EOF
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 02/10] Introduce cirros tests
  2017-03-25 19:28 ` [PATCH 02/10] Introduce cirros tests Géza Gémes
@ 2017-03-27 17:11   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:11 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 7732 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> Add support for using cirros images in raisin tests
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

It looks good to me, thanks!

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  lib/common-functions.sh            |  33 +++++++++++
>  lib/common-tests.sh                | 109 +++++++++++++++++++++++++++++++++++++
>  tests-configs/config-cirros_x86_32 |  13 +++++
>  tests-configs/config-cirros_x86_64 |  13 +++++
>  4 files changed, 168 insertions(+)
>  create mode 100644 tests-configs/config-cirros_x86_32
>  create mode 100644 tests-configs/config-cirros_x86_64
> 
> diff --git a/lib/common-functions.sh b/lib/common-functions.sh
> index d4476f3..efc92ff 100644
> --- a/lib/common-functions.sh
> +++ b/lib/common-functions.sh
> @@ -439,3 +439,36 @@ function uninstall_package() {
>          error_echo "Don't know how to uninstall packages on $DISTRO"
>      fi
>  }
> +
> +function get-qemu-img() {
> +    set +e
> +    QEMU_IMG=`which qemu-img`
> +    set -e
> +    if [[ -z "$QEMU_IMG" ]]
> +    then
> +        QEMU_IMG="/usr/lib/xen/bin/qemu-img"
> +    fi
> +    if [[ -x $QEMU_IMG ]]
> +    then
> +        export QEMU_IMG
> +    else
> +        error_echo "No working qemu-img found! Some tests may fail!"
> +    fi
> +}
> +
> +function get-pvgrub() {
> +    local arch=$1
> +    set +e
> +    PVGRUB=`which grub-${arch}-xen`
> +    set -e
> +    if [[ -z "$PVGRUB" ]]
> +    then
> +        PVGRUB="/usr/lib/xen/boot/grub-${arch}-xen"
> +    fi
> +    if [[ -f $PVGRUB ]]
> +    then
> +        export PVGRUB
> +    else
> +        error_echo "No working pvgrub found! Some tests may fail!"
> +    fi
> +}
> diff --git a/lib/common-tests.sh b/lib/common-tests.sh
> index d346af4..c07bb18 100644
> --- a/lib/common-tests.sh
> +++ b/lib/common-tests.sh
> @@ -178,3 +178,112 @@ function get_host_initrd() {
>          exit 1
>      fi
>  }
> +
> +function cirros_network_init() {
> +    rootdir=$1
> +    ifile=`mktemp`
> +    # Create static network config
> +    cat >$ifile <<EOF
> +auto lo
> +iface lo inet loopback
> +
> +auto eth0
> +iface eth0 inet static
> +    address 169.254.0.2
> +    network 169.254.0.0
> +    broadcast 169.254.0.255
> +    netmask 255.255.255.0
> +EOF
> +    $SUDO mv -f $ifile $rootdir/etc/network/interfaces
> +    # Disable cloud-init
> +    $SUDO rm -f ${rootdir}/etc/rc3.d/S*cirros*ds*
> +    $SUDO rm -f ${rootdir}/etc/rc3.d/S*-cirros-userdata
> +}
> +
> +function get_cirros_kernel() {
> +    bootdir=$1
> +    basename `find $bootdir -name vmlinuz* 2>/dev/null | head -1`
> +}
> +
> +function get_cirros_initrd() {
> +    bootdir=$1
> +    basename `find $bootdir -name initrd* 2>/dev/null | head -1`
> +}
> +
> +function cirros_grub_cfg() {
> +    rootdir=$1
> +    get-pvgrub $CIRROS_ARCH
> +    grubroot="`echo $CIRROS_GRUB_CFG | cut -d ')' -f 1`)"
> +    grubcfg="`echo $CIRROS_GRUB_CFG | cut -d ')' -f 2`"
> +    grubdir=`dirname $grubcfg`
> +    bootdir=`dirname $grubdir`
> +    tmpgrubcfg=`mktemp`
> +    cat > $tmpgrubcfg <<EOF
> +root="$grubroot"
> +insmod xzio
> +insmod gzio
> +insmod btrfs
> +insmod ext2
> +set timeout=1
> +set default=0
> +menuentry Cirros {
> +    linux `echo $bootdir`/`get_cirros_kernel ${rootdir}/${bootdir}` root=/dev/xvda1 ro
> +    initrd `echo $bootdir`/`get_cirros_initrd ${rootdir}/${bootdir}`
> +}
> +EOF
> +    $SUDO mv -f $tmpgrubcfg ${rootdir}/${grubcfg}
> +}
> +
> +function download_cirros_components() {
> +    . tests-configs/config-cirros_$RAISIN_ARCH
> +    mkdir -p $CIRROS_DOWNLOADS
> +    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_KERNEL_FILE ]]
> +    then
> +        verbose_echo "Downloading cirros kernel"
> +        wget -q $CIRROS_KERNEL_URL -P $CIRROS_DOWNLOADS
> +    fi
> +    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_INITRD_FILE ]]
> +    then
> +        verbose_echo "Downloading cirros initrd"
> +        wget -q $CIRROS_INITRD_URL -P $CIRROS_DOWNLOADS
> +    fi
> +    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE ]]
> +    then
> +        verbose_echo "Downloading cirros rootfs"
> +        wget -q $CIRROS_ROOTFS_URL -P $CIRROS_DOWNLOADS
> +        gunzip $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE.gz
> +        local cirros_rootfs_loop=`create_loop $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE`
> +        local cirros_rootfs_mntpt=`mktemp -d`
> +        $SUDO mount $cirros_rootfs_loop $cirros_rootfs_mntpt
> +        cirros_network_init $cirros_rootfs_mntpt
> +        $SUDO umount $cirros_rootfs_mntpt
> +        $SUDO rmdir $cirros_rootfs_mntpt
> +        $SUDO losetup -d $cirros_rootfs_loop
> +    fi
> +    if [[ ! -f $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE ]]
> +    then
> +        verbose_echo "Downloading cirros disk"
> +        wget -q $CIRROS_DISK_URL -P $CIRROS_DOWNLOADS
> +        mv $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE.qcow2
> +        get-qemu-img
> +        $QEMU_IMG convert -f qcow2 -O raw $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE.qcow2 $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE
> +        local cirros_disk_loop=`$SUDO $BASEDIR/scripts/lopartsetup $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE | head -1 |
> +                                cut -d ":" -f 1`
> +        local cirros_disk_mntpt=`mktemp -d`
> +        $SUDO mount $cirros_disk_loop $cirros_disk_mntpt
> +        cirros_network_init $cirros_disk_mntpt
> +        $SUDO umount $cirros_disk_mntpt
> +        $SUDO rmdir $cirros_disk_mntpt
> +        $SUDO losetup -d $cirros_disk_loop
> +    fi
> +}
> +
> +function tear_down_cirros_test() {
> +    testdir=$1
> +    if [[ `$SUDO xl vm-list | grep "raisin-test" | wc -l` -gt 0 ]]
> +    then
> +        $SUDO xl destroy "raisin-test"
> +    fi
> +    verbose_echo "$PREPEND deleting environment of cirros test"
> +    $SUDO rm -rf $testdir
> +}
> diff --git a/tests-configs/config-cirros_x86_32 b/tests-configs/config-cirros_x86_32
> new file mode 100644
> index 0000000..628e568
> --- /dev/null
> +++ b/tests-configs/config-cirros_x86_32
> @@ -0,0 +1,13 @@
> +CIRROS_ARCH=i386
> +CIRROS_BASE_URL="https://download.cirros-cloud.net/"
> +CIRROS_VERSION="0.3.5"
> +CIRROS_DOWNLOADS=$BASEDIR/downloads
> +CIRROS_KERNEL_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-kernel
> +CIRROS_INITRD_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-initramfs
> +CIRROS_ROOTFS_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-rootfs.img
> +CIRROS_DISK_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img
> +CIRROS_KERNEL_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_KERNEL_FILE
> +CIRROS_INITRD_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_INITRD_FILE
> +CIRROS_ROOTFS_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_ROOTFS_FILE.gz
> +CIRROS_DISK_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_DISK_FILE
> +CIRROS_GRUB_CFG="(xen/xvda,msdos1)/boot/grub/grub.cfg"
> diff --git a/tests-configs/config-cirros_x86_64 b/tests-configs/config-cirros_x86_64
> new file mode 100644
> index 0000000..7b78316
> --- /dev/null
> +++ b/tests-configs/config-cirros_x86_64
> @@ -0,0 +1,13 @@
> +CIRROS_ARCH=x86_64
> +CIRROS_BASE_URL="https://download.cirros-cloud.net/"
> +CIRROS_VERSION="0.3.5"
> +CIRROS_DOWNLOADS=$BASEDIR/downloads
> +CIRROS_KERNEL_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-kernel
> +CIRROS_INITRD_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-initramfs
> +CIRROS_ROOTFS_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-rootfs.img
> +CIRROS_DISK_FILE=cirros-$CIRROS_VERSION-$CIRROS_ARCH-disk.img
> +CIRROS_KERNEL_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_KERNEL_FILE
> +CIRROS_INITRD_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_INITRD_FILE
> +CIRROS_ROOTFS_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_ROOTFS_FILE.gz
> +CIRROS_DISK_URL=$CIRROS_BASE_URL/$CIRROS_VERSION/$CIRROS_DISK_FILE
> +CIRROS_GRUB_CFG="(xen/xvda,msdos1)/boot/grub/grub.cfg"
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 03/10] Introduce cirros-separate-kernel-pv test
  2017-03-25 19:28 ` [PATCH 03/10] Introduce cirros-separate-kernel-pv test Géza Gémes
@ 2017-03-27 17:12   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:12 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1694 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> This test is the cirros equivalent of the busybox-pv test
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  tests/cirros-separate-kernel-pv | 28 ++++++++++++++++++++++++++++
>  tests/series                    |  1 +
>  2 files changed, 29 insertions(+)
>  create mode 100644 tests/cirros-separate-kernel-pv
> 
> diff --git a/tests/cirros-separate-kernel-pv b/tests/cirros-separate-kernel-pv
> new file mode 100644
> index 0000000..fab5856
> --- /dev/null
> +++ b/tests/cirros-separate-kernel-pv
> @@ -0,0 +1,28 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-separate-kernel-pv-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-separate-kernel-pv-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_KERNEL_FILE $testdir
> +    cp $CIRROS_DOWNLOADS/$CIRROS_INITRD_FILE $testdir
> +    cp $CIRROS_DOWNLOADS/$CIRROS_ROOTFS_FILE $testdir
> +    cat >$testdir/cirros-separate-kernel-pv.cfg <<EOF
> +name = "raisin-test"
> +memory = 128
> +vcpus = 2
> +kernel = "$testdir/$CIRROS_KERNEL_FILE"
> +ramdisk = "$testdir/$CIRROS_INITRD_FILE"
> +disk = [ '$testdir/$CIRROS_ROOTFS_FILE,raw,xvda,rw' ]
> +extra = "root=/dev/xvda"
> +vif = [ 'bridge=xenbr1' ]
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-separate-kernel-pv.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index a2f4b34..38ee35a 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -1,3 +1,4 @@
>  busybox-pv
>  busybox-hvm
>  busybox-hvm-migrate
> +cirros-separate-kernel-pv
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 04/10] Introduce cirros-pygrub-pv test
  2017-03-25 19:28 ` [PATCH 04/10] Introduce cirros-pygrub-pv test Géza Gémes
@ 2017-03-27 17:13   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:13 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1439 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> This test verifies booting the cirros image using pygrub
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  tests/cirros-pygrub-pv | 25 +++++++++++++++++++++++++
>  tests/series           |  1 +
>  2 files changed, 26 insertions(+)
>  create mode 100644 tests/cirros-pygrub-pv
> 
> diff --git a/tests/cirros-pygrub-pv b/tests/cirros-pygrub-pv
> new file mode 100644
> index 0000000..37e288c
> --- /dev/null
> +++ b/tests/cirros-pygrub-pv
> @@ -0,0 +1,25 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-pygrub-pv-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-pygrub-pv-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
> +    cat >$testdir/cirros-pygrub-pv.cfg <<EOF
> +name = "raisin-test"
> +memory = 128
> +vcpus = 2
> +bootloader = "pygrub"
> +disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
> +extra = "root=/dev/xvda1"
> +vif = [ 'bridge=xenbr1' ]
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-pygrub-pv.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index 38ee35a..372fafb 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -2,3 +2,4 @@ busybox-pv
>  busybox-hvm
>  busybox-hvm-migrate
>  cirros-separate-kernel-pv
> +cirros-pygrub-pv
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 05/10] Introduce cirros-pvgrub2-pv test
  2017-03-25 19:28 ` [PATCH 05/10] Introduce cirros-pvgrub2-pv test Géza Gémes
@ 2017-03-27 17:13   ` Stefano Stabellini
  2017-03-27 17:24     ` Stefano Stabellini
  0 siblings, 1 reply; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:13 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1883 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> 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 | 33 +++++++++++++++++++++++++++++++++
>  tests/series            |  1 +
>  2 files changed, 34 insertions(+)
>  create mode 100644 tests/cirros-pvgrub2-pv
> 
> diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
> new file mode 100644
> index 0000000..4994ea9
> --- /dev/null
> +++ b/tests/cirros-pvgrub2-pv
> @@ -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
> +}
> diff --git a/tests/series b/tests/series
> index 372fafb..1fec245 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -3,3 +3,4 @@ busybox-hvm
>  busybox-hvm-migrate
>  cirros-separate-kernel-pv
>  cirros-pygrub-pv
> +cirros-pvgrub2-pv
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 06/10] Introduce cirros-qemu-hvm test
  2017-03-25 19:28 ` [PATCH 06/10] Introduce cirros-qemu-hvm test Géza Gémes
@ 2017-03-27 17:16   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:16 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1435 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> This test is the cirros equivalent of the busybox-hvm test
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  tests/cirros-qemu-hvm | 26 ++++++++++++++++++++++++++
>  tests/series          |  1 +
>  2 files changed, 27 insertions(+)
>  create mode 100644 tests/cirros-qemu-hvm
> 
> diff --git a/tests/cirros-qemu-hvm b/tests/cirros-qemu-hvm
> new file mode 100644
> index 0000000..2e4ec2a
> --- /dev/null
> +++ b/tests/cirros-qemu-hvm
> @@ -0,0 +1,26 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-qemu-hvm-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-qemu-hvm-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
> +    cat >$testdir/cirros-qemu-hvm.cfg <<EOF
> +name = "raisin-test"
> +builder = "hvm"
> +memory = 128
> +vcpus = 2
> +disk = [ '$testdir/$CIRROS_DISK_FILE,raw,hda,rw' ]
> +vif = [ 'bridge=xenbr1' ]
> +serial="pty"
> +boot="c"
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-qemu-hvm.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index 1fec245..49a9257 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -4,3 +4,4 @@ busybox-hvm-migrate
>  cirros-separate-kernel-pv
>  cirros-pygrub-pv
>  cirros-pvgrub2-pv
> +cirros-qemu-hvm
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test
  2017-03-25 19:28 ` [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test Géza Gémes
@ 2017-03-27 17:16   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:16 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1619 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> This test verifies a cirros based hvm domain using a minios based
> stubdom as its device model
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  tests/cirros-minios-stubdom-hvm | 27 +++++++++++++++++++++++++++
>  tests/series                    |  1 +
>  2 files changed, 28 insertions(+)
>  create mode 100644 tests/cirros-minios-stubdom-hvm
> 
> diff --git a/tests/cirros-minios-stubdom-hvm b/tests/cirros-minios-stubdom-hvm
> new file mode 100644
> index 0000000..43dc568
> --- /dev/null
> +++ b/tests/cirros-minios-stubdom-hvm
> @@ -0,0 +1,27 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-minios-stubdom-hvm-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-minios-stubdom-hvm-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
> +    cat >$testdir/cirros-minios-stubdom-hvm.cfg <<EOF
> +name = "raisin-test"
> +builder = "hvm"
> +device_model_stubdomain_override = 1
> +memory = 128
> +vcpus = 2
> +disk = [ '$testdir/$CIRROS_DISK_FILE,raw,hda,rw' ]
> +vif = [ 'bridge=xenbr1' ]
> +serial="pty"
> +boot="c"
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-minios-stubdom-hvm.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index 49a9257..7b1ad8e 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -5,3 +5,4 @@ cirros-separate-kernel-pv
>  cirros-pygrub-pv
>  cirros-pvgrub2-pv
>  cirros-qemu-hvm
> +cirros-minios-stubdom-hvm
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 08/10] Introduce cirros-qemu-pvhvm test
  2017-03-25 19:29 ` [PATCH 08/10] Introduce cirros-qemu-pvhvm test Géza Gémes
@ 2017-03-27 17:17   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:17 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1541 bytes --]

On Sat, 24 Mar 2017, Géza Gémes wrote:
> This test is similar to cirros-qemu-hvm test, differing by
> explicitly exposing the xen netfront and blockfront drivers
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  tests/cirros-qemu-pvhvm | 27 +++++++++++++++++++++++++++
>  tests/series            |  1 +
>  2 files changed, 28 insertions(+)
>  create mode 100644 tests/cirros-qemu-pvhvm
> 
> diff --git a/tests/cirros-qemu-pvhvm b/tests/cirros-qemu-pvhvm
> new file mode 100644
> index 0000000..6cf33e0
> --- /dev/null
> +++ b/tests/cirros-qemu-pvhvm
> @@ -0,0 +1,27 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-qemu-pvhvm-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-qemu-pvhvm-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
> +    cat >$testdir/cirros-qemu-pvhvm.cfg <<EOF
> +name = "raisin-test"
> +builder = "hvm"
> +xen_platform_pci = 1
> +memory = 128
> +vcpus = 2
> +disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
> +vif = [ 'bridge=xenbr1' ]
> +serial="pty"
> +boot="c"
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-qemu-pvhvm.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index 7b1ad8e..51dbe17 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -6,3 +6,4 @@ cirros-pygrub-pv
>  cirros-pvgrub2-pv
>  cirros-qemu-hvm
>  cirros-minios-stubdom-hvm
> +cirros-qemu-pvhvm
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test
  2017-03-25 19:29 ` [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test Géza Gémes
@ 2017-03-27 17:17   ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:17 UTC (permalink / raw)
  To: Géza Gémes; +Cc: xen-devel, sstabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1703 bytes --]

On Sat, 25 Mar 2017, Géza Gémes wrote:
> This test is similar to cirros-minios-stubdom-hvm test, differing by
> explicitly exposing the xen netfront and blockfront drivers
> 
> Signed-off-by: Géza Gémes <geza.gemes@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  tests/cirros-minios-stubdom-pvhvm | 28 ++++++++++++++++++++++++++++
>  tests/series                      |  1 +
>  2 files changed, 29 insertions(+)
>  create mode 100644 tests/cirros-minios-stubdom-pvhvm
> 
> diff --git a/tests/cirros-minios-stubdom-pvhvm b/tests/cirros-minios-stubdom-pvhvm
> new file mode 100644
> index 0000000..719b78d
> --- /dev/null
> +++ b/tests/cirros-minios-stubdom-pvhvm
> @@ -0,0 +1,28 @@
> +#!/usr/bin/env bash
> +
> +set -e
> +
> +function cirros-minios-stubdom-pvhvm-cleanup() {
> +    tear_down_cirros_test $testdir
> +}
> +
> +function cirros-minios-stubdom-pvhvm-test() {
> +    download_cirros_components
> +    testdir=`mktemp -d`
> +    cp $CIRROS_DOWNLOADS/$CIRROS_DISK_FILE $testdir
> +    cat >$testdir/cirros-minios-stubdom-pvhvm.cfg <<EOF
> +name = "raisin-test"
> +builder = "hvm"
> +device_model_stubdomain_override = 1
> +xen_platform_pci = 1
> +memory = 128
> +vcpus = 2
> +disk = [ '$testdir/$CIRROS_DISK_FILE,raw,xvda,rw' ]
> +vif = [ 'bridge=xenbr1' ]
> +serial="pty"
> +boot="c"
> +EOF
> +
> +    $SUDO xl create $testdir/cirros-minios-stubdom-pvhvm.cfg
> +    check_guest_alive
> +}
> diff --git a/tests/series b/tests/series
> index 51dbe17..ffa8e69 100644
> --- a/tests/series
> +++ b/tests/series
> @@ -7,3 +7,4 @@ cirros-pvgrub2-pv
>  cirros-qemu-hvm
>  cirros-minios-stubdom-hvm
>  cirros-qemu-pvhvm
> +cirros-minios-stubdom-pvhvm
> -- 
> 2.7.4
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 05/10] Introduce cirros-pvgrub2-pv test
  2017-03-27 17:13   ` Stefano Stabellini
@ 2017-03-27 17:24     ` Stefano Stabellini
  2017-03-27 18:38       ` Gémes Géza
  0 siblings, 1 reply; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 17:24 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, george.dunlap, Géza Gémes

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2527 bytes --]

On Mon, 27 Mar 2017, Stefano Stabellini wrote:
> On Sat, 25 Mar 2017, Géza Gémes wrote:
> > 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 | 33 +++++++++++++++++++++++++++++++++
> >  tests/series            |  1 +
> >  2 files changed, 34 insertions(+)
> >  create mode 100644 tests/cirros-pvgrub2-pv
> > 
> > diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
> > new file mode 100644
> > index 0000000..4994ea9
> > --- /dev/null
> > +++ b/tests/cirros-pvgrub2-pv
> > @@ -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

Actually, one more comment before I commit the series: would it be
possible to call cirros_grub_cfg from download_cirros_components as we
do for cirros_network_init?

If we did that, would the other tests that rely on the grub config file
(for example cirros-qemu-hvm) continue to work properly? I think they
must work properly, otherwise even today with the series as is, they
would fail if they get executed after cirros-pvgrub2-pv, which calls
cirros_grub_cfg.


> > +    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
> > +}
> > diff --git a/tests/series b/tests/series
> > index 372fafb..1fec245 100644
> > --- a/tests/series
> > +++ b/tests/series
> > @@ -3,3 +3,4 @@ busybox-hvm
> >  busybox-hvm-migrate
> >  cirros-separate-kernel-pv
> >  cirros-pygrub-pv
> > +cirros-pvgrub2-pv
> > -- 
> > 2.7.4
> > 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 05/10] Introduce cirros-pvgrub2-pv test
  2017-03-27 17:24     ` Stefano Stabellini
@ 2017-03-27 18:38       ` Gémes Géza
  2017-03-27 18:42         ` Stefano Stabellini
  0 siblings, 1 reply; 24+ messages in thread
From: Gémes Géza @ 2017-03-27 18:38 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, george.dunlap

2017-03-27 19:24 keltezéssel, Stefano Stabellini írta:
> On Mon, 27 Mar 2017, Stefano Stabellini wrote:
>> On Sat, 25 Mar 2017, Géza Gémes wrote:
>>> 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 | 33 +++++++++++++++++++++++++++++++++
>>>   tests/series            |  1 +
>>>   2 files changed, 34 insertions(+)
>>>   create mode 100644 tests/cirros-pvgrub2-pv
>>>
>>> diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
>>> new file mode 100644
>>> index 0000000..4994ea9
>>> --- /dev/null
>>> +++ b/tests/cirros-pvgrub2-pv
>>> @@ -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
> Actually, one more comment before I commit the series: would it be
> possible to call cirros_grub_cfg from download_cirros_components as we
> do for cirros_network_init?
>
> If we did that, would the other tests that rely on the grub config file
> (for example cirros-qemu-hvm) continue to work properly? I think they
> must work properly, otherwise even today with the series as is, they
> would fail if they get executed after cirros-pvgrub2-pv, which calls
> cirros_grub_cfg.
>
As each test runs in its own private testdir, they all run with their 
almost (except the static ip address) verbatim copy of vanilla cirros.
However pvgrub requires a grub2 config file, which is missing from 
cirros, having only a menu.lst.
Modifying the downloaded image to have a grub.cfg by default has no 
effect on the majority of the tests, with the exception of the pygrub 
test, which cannot interpret the grub.cfg needed by pvgrub. Because of 
this incompatibility I've chosen to add grub.cfg only in the case of the 
pvgrub test, which needs it and run the other tests with a cirros image 
as close to the original as possible.
>>> +    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
>>> +}
>>> diff --git a/tests/series b/tests/series
>>> index 372fafb..1fec245 100644
>>> --- a/tests/series
>>> +++ b/tests/series
>>> @@ -3,3 +3,4 @@ busybox-hvm
>>>   busybox-hvm-migrate
>>>   cirros-separate-kernel-pv
>>>   cirros-pygrub-pv
>>> +cirros-pvgrub2-pv
>>> -- 
>>> 2.7.4

Cheers,

Geza


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 05/10] Introduce cirros-pvgrub2-pv test
  2017-03-27 18:38       ` Gémes Géza
@ 2017-03-27 18:42         ` Stefano Stabellini
  0 siblings, 0 replies; 24+ messages in thread
From: Stefano Stabellini @ 2017-03-27 18:42 UTC (permalink / raw)
  To: Gémes Géza; +Cc: xen-devel, Stefano Stabellini, george.dunlap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3667 bytes --]

On Mon, 27 Mar 2017, Gémes Géza wrote:
> 2017-03-27 19:24 keltezéssel, Stefano Stabellini írta:
> > On Mon, 27 Mar 2017, Stefano Stabellini wrote:
> > > On Sat, 25 Mar 2017, Géza Gémes wrote:
> > > > 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 | 33 +++++++++++++++++++++++++++++++++
> > > >   tests/series            |  1 +
> > > >   2 files changed, 34 insertions(+)
> > > >   create mode 100644 tests/cirros-pvgrub2-pv
> > > > 
> > > > diff --git a/tests/cirros-pvgrub2-pv b/tests/cirros-pvgrub2-pv
> > > > new file mode 100644
> > > > index 0000000..4994ea9
> > > > --- /dev/null
> > > > +++ b/tests/cirros-pvgrub2-pv
> > > > @@ -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
> > Actually, one more comment before I commit the series: would it be
> > possible to call cirros_grub_cfg from download_cirros_components as we
> > do for cirros_network_init?
> > 
> > If we did that, would the other tests that rely on the grub config file
> > (for example cirros-qemu-hvm) continue to work properly? I think they
> > must work properly, otherwise even today with the series as is, they
> > would fail if they get executed after cirros-pvgrub2-pv, which calls
> > cirros_grub_cfg.
> > 
> As each test runs in its own private testdir, they all run with their almost
> (except the static ip address) verbatim copy of vanilla cirros.
> However pvgrub requires a grub2 config file, which is missing from cirros,
> having only a menu.lst.
> Modifying the downloaded image to have a grub.cfg by default has no effect on
> the majority of the tests, with the exception of the pygrub test, which cannot
> interpret the grub.cfg needed by pvgrub. Because of this incompatibility I've
> chosen to add grub.cfg only in the case of the pvgrub test, which needs it and
> run the other tests with a cirros image as close to the original as possible.

OK, I think you made the right choice. I'll commit shortly.


> > > > +    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
> > > > +}
> > > > diff --git a/tests/series b/tests/series
> > > > index 372fafb..1fec245 100644
> > > > --- a/tests/series
> > > > +++ b/tests/series
> > > > @@ -3,3 +3,4 @@ busybox-hvm
> > > >   busybox-hvm-migrate
> > > >   cirros-separate-kernel-pv
> > > >   cirros-pygrub-pv
> > > > +cirros-pvgrub2-pv
> > > > -- 
> > > > 2.7.4
> 
> Cheers,
> 
> Geza
> 

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-03-27 18:42 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-25 19:28 [raisin][PATCH 00/10] pygrub fix + cirros tests Géza Gémes
2017-03-25 19:28 ` [PATCH 01/10] Fix installation of python libs Géza Gémes
2017-03-27 17:08   ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 02/10] Introduce cirros tests Géza Gémes
2017-03-27 17:11   ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 03/10] Introduce cirros-separate-kernel-pv test Géza Gémes
2017-03-27 17:12   ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 04/10] Introduce cirros-pygrub-pv test Géza Gémes
2017-03-27 17:13   ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 05/10] Introduce cirros-pvgrub2-pv test Géza Gémes
2017-03-27 17:13   ` Stefano Stabellini
2017-03-27 17:24     ` Stefano Stabellini
2017-03-27 18:38       ` Gémes Géza
2017-03-27 18:42         ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 06/10] Introduce cirros-qemu-hvm test Géza Gémes
2017-03-27 17:16   ` Stefano Stabellini
2017-03-25 19:28 ` [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test Géza Gémes
2017-03-27 17:16   ` Stefano Stabellini
2017-03-25 19:29 ` [PATCH 08/10] Introduce cirros-qemu-pvhvm test Géza Gémes
2017-03-27 17:17   ` Stefano Stabellini
2017-03-25 19:29 ` [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test Géza Gémes
2017-03-27 17:17   ` Stefano Stabellini
2017-03-25 19:29 ` [PATCH 10/10] Enable cirros tests in the default config Géza Gémes
  -- strict thread matches above, loose matches on Subject: below --
2017-03-18 14:00 [raisin][PATCH 00/10] Introduce usage of cirros images Géza Gémes
2017-03-18 14:00 ` [PATCH 10/10] Enable cirros tests in the default config Géza Gémes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).