Skip to contentSkip to conversation

raisin: introduce tests

PATCH Superseded Stefano Stabellini 3 participants 12 messages May 1, 2015 – May 6, 2015 Library code

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover raisin: introduce tests

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

Changes in v2:

- use found as a boolean
- print error to stderr
- use "$@" instead of $* in error_echo and verbose_echo
- small stlye improvement in for_each_component

Stefano Stabellini (4):
raisin: introduce tests
raisin: add an hvm test
raisin: improve output
raisin: small stlye improvement in for_each_component

 README                      |   14 ++++
 components/grub             |    4 +-
 components/libvirt          |    4 +-
 components/linux            |    2 +-
 components/ovmf             |    6 +-
 components/qemu             |    2 +-
 components/qemu_traditional |    2 +-
 components/seabios          |    6 +-
 components/xen              |    8 +-
 defconfig                   |    5 ++
 lib/commands.sh             |   22 +++---
 lib/common-functions.sh     |  144 +++++++++++++++++++++++++++++------
 lib/common-tests.sh         |  174 +++++++++++++++++++++++++++++++++++++++++++
 raise                       |    8 +-
 scripts/lopartsetup         |   67 +++++++++++++++++
 tests/busybox-hvm           |   44 +++++++++++
 tests/busybox-pv            |   38 ++++++++++
 tests/series                |    2 +
 18 files changed, 502 insertions(+), 50 deletions(-)
 create mode 100644 lib/common-tests.sh
 create mode 100755 scripts/lopartsetup
 create mode 100755 tests/busybox-hvm
 create mode 100755 tests/busybox-pv
 create mode 100644 tests/series

Cheers,

Stefano

#1 lore raw

PATCH v2 1/4 raisin: introduce tests

Introduce a new command to run functional tests and unit tests. Introduce a generic infrastrucutre to run tests on the local machine. Add a library of common functions that can be used by the test scripts to setup guest VMs.

Add a simple test script that boots a single busybox based PV guest.

---

Changes in v2:

- use found as a boolean
- print error to stderr

---
 README                  |   14 ++++++
 defconfig               |    5 +++
 lib/commands.sh         |    4 ++
 lib/common-functions.sh |   74 +++++++++++++++++++++++++++++++
 lib/common-tests.sh     |  112 +++++++++++++++++++++++++++++++++++++++++++++++
 raise                   |    8 ++--
 tests/busybox-pv        |   38 ++++++++++++++++
 tests/series            |    1 +
 8 files changed, 253 insertions(+), 3 deletions(-)
 create mode 100644 lib/common-tests.sh
 create mode 100755 tests/busybox-pv
 create mode 100644 tests/series
README +14 -0
index b7832da..42c0f4d 100644
@@ -102,3 +102,17 @@ check-package
 
 If your component comes with additional data, maybe a config script or
 anything else, place it under "data".
+
+
+= Testing =
+
+Raisin can also be used for testing. Make sure to have Xen already up
+and running (raise build, raise install and host reboot).
+Ask Raisin to run tests like this:
+
+./raise test
+
+You can specify a subset of tests to run with ENABLED_TESTS in the
+config file, or the TESTS environmental variable:
+
+TESTS="busybox-pv" ./raise test
defconfig +5 -0
index b4ed94d..e88f3d3 100644
@@ -39,3 +39,8 @@ GRUB_REVISION="master"
 LIBVIRT_REVISION="master"
 OVMF_REVISION="master"
 LINUX_REVISION="master"
+
+# Tests
+## All tests: busybox-pv
+## ENABLED_TESTS is the list of test run by raise test
+ENABLED_TESTS="busybox-pv"
lib/commands.sh +4 -0
index 801341b..ffbadb4 100755
@@ -103,3 +103,7 @@ function configure() {
     for_each_component configure
 }
 
+function test() {
+    init_tests
+    run_tests
+}
lib/common-functions.sh +74 -0

92 lines not on this page · raw message

lib/common-tests.sh new file +112 -0

112 lines not on this page · raw message

raise +5 -3
index 68dbfd8..dd275ad 100755
@@ -3,7 +3,7 @@
 set -e
 
 _help() {
-    echo "Usage: ./build.sh <options> <command>"
+    echo "Usage: ./raise <options> <command>"
     echo "where options are:"
     echo "    -v | --verbose       Verbose"
     echo "    -y | --yes           Do not ask questions and continue"
@@ -14,6 +14,7 @@ _help() {
     echo "    install              Install binaries under /  (requires sudo)"
     echo "    configure            Configure the system  (requires sudo)"
     echo "    unraise              Uninstall and unconfigure the system  (requires sudo)"
+    echo "    test                 Runs tests on the system (requires sudo, Xen must be running)"
 }
 
 # Include your defaults
@@ -25,10 +26,11 @@ fi
 source ./config
 
 # To use this as a library, set RAISIN_PATH appropriately
-[[ -z "$RAISIN_PATH" ]] && RAISIN_PATH="$PWD/lib"
+[[ -z "$RAISIN_PATH" ]] && export RAISIN_PATH="$PWD/lib"
 
 # Then as many as the sub-libraries as you need
 source ${RAISIN_PATH}/common-functions.sh
+source ${RAISIN_PATH}/common-tests.sh
 source ${RAISIN_PATH}/git-checkout.sh
 source ${RAISIN_PATH}/commands.sh
 
@@ -59,7 +61,7 @@ do
 done
 
 case "$1" in
-    "install-builddep" | "build" | "install" | "configure" | "unraise" )
+    "install-builddep" | "build" | "install" | "configure" | "unraise" | "test" )
         COMMAND=$1
         ;;
     *)
tests/busybox-pv new file +38 -0
new file mode 100755
index 0000000..941c739
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+set -e
+
+source $BASEDIR/lib/common-tests.sh
+
+function cleanup() {
+    $SUDO xl destroy raisin-test || true
+    umount $LOOP || true
+    cd "$BASEDIR"
+    $SUDO losetup -d $LOOP
+    rm -rf $TMPDIR
+}
+
+trap cleanup EXIT
+TMPDIR=`mktemp -d`
+cd $TMPDIR
+
+allocate_disk busybox-vm-disk $((20*1024*1024))
+LOOP=`create_loop busybox-vm-disk`
+busybox_rootfs $LOOP
+busybox_network_init $LOOP
+
+cat >busybox-pv <<EOF
+kernel = "`get_host_kernel`"
+ramdisk = "`get_host_initrd`"
+extra = "root=/dev/xvda console=hvc0"
+memory = 512
+name = "raisin-test"
+vcpus = 2
+disk = [ '$LOOP,raw,xvda,w' ]
+serial="pty"
+boot="c"
+vif=['bridge=xenbr1']
+EOF
+
+$SUDO xl create busybox-pv
+check_guest_alive
tests/series new file +1 -0
new file mode 100644
index 0000000..a5ec626
@@ -0,0 +1 @@
+busybox-pv
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 2/4 raisin: add an hvm test

In reply to Stefano Stabellini

Add a few functions to create partitions, install and configure grub in the VM disk. Introduce a script to loopmount a partition within a VM disk.

Add a new test that creates a local HVM guest, boots it and check the network.

---
 defconfig           |    4 +--
 lib/common-tests.sh |   62 +++++++++++++++++++++++++++++++++++++++++++++++
 scripts/lopartsetup |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/busybox-hvm   |   44 +++++++++++++++++++++++++++++++++
 tests/series        |    1 +
 5 files changed, 176 insertions(+), 2 deletions(-)
 create mode 100755 scripts/lopartsetup
 create mode 100755 tests/busybox-hvm
defconfig +2 -2
index e88f3d3..664aee6 100644
@@ -41,6 +41,6 @@ OVMF_REVISION="master"
 LINUX_REVISION="master"
 
 # Tests
-## All tests: busybox-pv
+## All tests: busybox-pv busybox-hvm
 ## ENABLED_TESTS is the list of test run by raise test
-ENABLED_TESTS="busybox-pv"
+ENABLED_TESTS="busybox-pv busybox-hvm"
lib/common-tests.sh +62 -0

74 lines not on this page · raw message

scripts/lopartsetup new file +67 -0

67 lines not on this page · raw message

tests/busybox-hvm new file +44 -0

44 lines not on this page · raw message

tests/series +1 -0
index a5ec626..1f5f5c6 100644
@@ -1 +1,2 @@
 busybox-pv
+busybox-hvm
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH v2 3/4 raisin: improve output

In reply to Stefano Stabellini

Introduce an error_echo function that prints to stderr. Call error_echo or verbose_echo, instead of echo, when possible and appropriate.
Redirect build and tests output to /dev/null unless VERBOSE==1. Redirect apt-get and yum output to /dev/null.
Fix echo arguments in check-package-deb.

---

Changes in v2:

- use "$@" instead of $* in error_echo and verbose_echo

---
 components/grub             |    4 +--
 components/libvirt          |    4 +--
 components/linux            |    2 +-
 components/ovmf             |    6 ++--
 components/qemu             |    2 +-
 components/qemu_traditional |    2 +-
 components/seabios          |    6 ++--
 components/xen              |    8 ++---
 lib/commands.sh             |   18 +++++------
 lib/common-functions.sh     |   72 ++++++++++++++++++++++++++++++-------------
 lib/common-tests.sh         |    6 ++--
 tests/busybox-hvm           |    2 +-
 12 files changed, 80 insertions(+), 52 deletions(-)
components/grub +2 -2
index fa72b99..3bb5254 100644
@@ -19,10 +19,10 @@ function grub_check_package() {
 
     if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
-        echo grub is only supported on x86_32 and x86_64
+        verbose_echo grub is only supported on x86_32 and x86_64
         return
     fi
-    echo Checking Grub dependencies
+    verbose_echo Checking Grub dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
components/libvirt +2 -2
index a554643..20405ae 100644
@@ -22,7 +22,7 @@ function libvirt_check_package() {
     local DEP_CentOS_x86_32="$DEP_Fedora_x86_32"
     local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
 
-    echo Checking Libvirt dependencies
+    verbose_echo Checking Libvirt dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
@@ -52,7 +52,7 @@ function libvirt_build() {
         cp daemon/libvirtd.init "$INST_DIR"/etc/rc.d/init.d/libvirtd
         chmod +x "$INST_DIR"/etc/rc.d/init.d/libvirtd
     else
-        echo "I don't know how write an init script for Libvirt on $DISTRO"
+        error_echo "I don't know how write an init script for Libvirt on $DISTRO"
     fi
     cd ..
 }
components/linux +1 -1
index f90a894..9ae6955 100644
@@ -15,7 +15,7 @@ function linux_check_package() {
     local DEP_CentOS_x86_32="$DEP_Fedora_x86_32"
     local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
 
-    echo Checking Linux dependencies
+    verbose_echo Checking Linux dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
components/ovmf +3 -3
index a59a771..387044a 100644
@@ -14,10 +14,10 @@ function ovmf_check_package() {
 
     if [[ $RAISIN_ARCH != "x86_64" ]]
     then
-        echo ovmf is only supported on x86_64
+        verbose_echo ovmf is only supported on x86_64
         return
     fi
-    echo Checking OVMF dependencies
+    verbose_echo Checking OVMF dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
@@ -25,7 +25,7 @@ function ovmf_check_package() {
 function ovmf_build() {
     if [[ $RAISIN_ARCH != "x86_64" ]]
     then
-        echo ovmf is only supported on x86_64
+        verbose_echo ovmf is only supported on x86_64
         return
     fi
 
components/qemu +1 -1
index 72cfec1..dce4ce0 100644
@@ -11,7 +11,7 @@ function qemu_check_package() {
     local DEP_Fedora_x86_32="$DEP_Fedora_common"
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-    echo Checking QEMU dependencies
+    verbose_echo Checking QEMU dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
components/qemu_traditional +1 -1
index b338007..a9609b1 100644
@@ -12,7 +12,7 @@ function qemu_traditional_check_package() {
     local DEP_Fedora_x86_32="$DEP_Fedora_common"
     local DEP_Fedora_x86_64="$DEP_Fedora_common"
 
-    echo Checking QEMU dependencies
+    verbose_echo Checking QEMU dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
components/seabios +3 -3
index ed2c7d2..8fea193 100644
@@ -14,10 +14,10 @@ function seabios_check_package() {
 
     if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
-        echo seabios is only supported on x86_32 and x86_64
+        verbose_echo seabios is only supported on x86_32 and x86_64
         return
     fi
-    echo Checking SeaBIOS dependencies
+    verbose_echo Checking SeaBIOS dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
@@ -25,7 +25,7 @@ function seabios_check_package() {
 function seabios_build() {
     if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
     then
-        echo seabios is only supported on x86_32 and x86_64
+        verbose_echo seabios is only supported on x86_32 and x86_64
         return
     fi
 
components/xen +4 -4
index add8136..6b700e5 100644
@@ -19,7 +19,7 @@ function xen_check_package() {
     local DEP_CentOS_x86_32="$DEP_CentOS_common dev86 texinfo iasl"
     local DEP_CentOS_x86_64="$DEP_CentOS_x86_32 glibc-devel.i686"
 
-    echo Checking Xen dependencies
+    verbose_echo Checking Xen dependencies
     eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
 }
 
@@ -62,13 +62,13 @@ function _xen_create_bridge_Debian() {
 
     if [[ -z "$IFACE" ]]
     then
-        echo "Please refer to the following page to setup networking:"
-        echo "http://wiki.xenproject.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)"
+        error_echo "Please refer to the following page to setup networking:"
+        error_echo "http://wiki.xenproject.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)"
         return 1
     fi
     if [[ "`grep $BRIDGE /etc/network/interfaces`" ]]
     then
-        echo "a network bridge seems to be already setup"
+        verbose_echo "a network bridge seems to be already setup"
         return 0
     fi
 
lib/commands.sh +9 -9
index ffbadb4..a79611e 100755
@@ -17,29 +17,29 @@ function check-builddep() {
 
     if [[ -n "${missing[@]}" ]]
     then
-        echo "Missing packages: ${missing[@]}"
+        echo "$PREPEND Missing packages: ${missing[@]}"
         if [[ "$YES" = "n" ]]
         then
             return
         elif [[ "$YES" != "y" ]]
         then
-            echo "Do you want Raisin to automatically install them for you? (y/n)"
+            echo "$PREPEND Do you want Raisin to automatically install them for you? (y/n)"
             while read answer
             do
                 if [[ "$answer" = "n" ]]
                 then
-                    echo "Please install, or run ./raise install-builddep"
+                    echo "$PREPEND Please install, or run ./raise install-builddep"
                     exit 1
                 elif [[ "$answer" = "y" ]]
                 then
                     break
                 else
-                    echo "Reply y or n"
+                    echo "$PREPEND Reply y or n"
                 fi
             done
         fi
 
-        echo "Installing..."
+        echo "$PREPEND Installing..."
         install-package "${missing[@]}"
     fi
 }
@@ -72,7 +72,7 @@ function install() {
     # need single braces for filename matching expansion
     if [ ! -f xen-sytem*rpm ] && [ ! -f xen-system*deb ]
     then
-        echo You need to raise build first.
+        error_echo You need to raise build first.
         exit 1
     fi
     install_package xen-system
@@ -84,8 +84,8 @@ function configure() {
         return
     elif [[ "$YES" != "y" ]]
     then
-        echo "Proceeding we'll make changes to the running system,"
-        echo "are you sure that you want to continue? (y/n)"
+        echo "$PREPEND Proceeding we'll make changes to the running system,"
+        echo "$PREPEND are you sure that you want to continue? (y/n)"
         while read answer
         do
             if [[ "$answer" = "n" ]]
@@ -95,7 +95,7 @@ function configure() {
             then
                 break
             else
-                echo "Reply y or n"
+                echo "$PREPEND Reply y or n"
             fi
         done
     fi
lib/common-functions.sh +50 -22

172 lines not on this page · raw message

lib/common-tests.sh +3 -3
index abbc91a..0e51539 100644
@@ -133,7 +133,7 @@ EOF
             --grub-mkdevicemap=$tmpdir/boot/grub/device.map \
             --root-directory=$tmpdir $dev
     else
-        echo "I don't know how to install grub on $DISTRO"
+        echo "$PREPEND I don't know how to install grub on $DISTRO"
     fi
 
     $SUDO umount $tmpdir
@@ -149,7 +149,7 @@ function check_guest_alive() {
         i=$((i+1))
         if [[ $i -gt 60 ]]
         then
-            echo Timeout connecting to guest
+            echo $PREPEND Timeout connecting to guest
             return 1
         fi
     done
@@ -168,7 +168,7 @@ function get_host_initrd() {
     then
         echo "/boot/initramfs-`uname -r`".img
     else
-        echo "I don't know how to find the initrd" >&2
+        echo "$PREPEND I don't know how to find the initrd" >&2
         exit 1
     fi
 }
tests/busybox-hvm +1 -1
index b97ae34..c8024e5 100755
@@ -14,7 +14,7 @@ function cleanup() {
 
 if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
 then
-    echo busybox hvm test only valid on x86
+    echo $PREPEND busybox hvm test only valid on x86
     exit 0
 fi
 
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH v2 4/4 raisin: small stlye improvement in for_each_component

In reply to Stefano Stabellini

Use the found variable as a boolean.

---
 lib/common-functions.sh |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/common-functions.sh +3 -3
index cbb658e..5ee4816 100644
@@ -281,16 +281,16 @@ function for_each_component () {
 
     for component in `cat "$BASEDIR"/components/series`
     do
-        found=0
+        found=false
         for enabled in $COMPONENTS
         do
             if [[ $enabled = $component ]]
             then
-                found=1
+                found=true
                 break
             fi
         done
-        if [[ $found -eq 0 ]]
+        if ! $found
         then
             verbose_echo "$component" is disabled
             continue
Signature · 1 line
1.7.10.4
#5 lore raw
In reply to Stefano Stabellini
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest? Do you eventually plan to have an osstest job which executes the raisin tests?

Ian.

#6 lore raw
Quoted 11 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

Quoted 2 lines

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

Quoted 2 lines

Do you eventually plan to have an osstest job which executes the raisin tests?

Yes, that is the goal. We should be able to get the bisector running and all the usual osstest goodness.

#7 lore raw
Quoted 12 lines · Stefano Stabellini
Quoted 11 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

Quoted 7 lines
Quoted 2 lines

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

So a sort of BVT (build verification test), such that that we could be reasonably annoyed at if an experienced developer submitted a patch that broke said functionality?

-George

#8 lore raw
Quoted 17 lines · George Dunlap
Quoted 15 lines · Stefano Stabellini
Quoted 13 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Quoted 8 lines
Quoted 4 lines

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

So a sort of BVT (build verification test), such that that we could be reasonably annoyed at if an experienced developer submitted a patch that broke said functionality?

That's right.

In general any functionality tests, that can be added without introducing too much complexity, should be in raisin. osstest will be able to run these tests via raisin.

More complex tests, involving more than one host, or specific guest/host OS combinations, should only be in osstest.

#9 lore raw
Quoted 27 lines · Stefano Stabellini
Quoted 17 lines · George Dunlap
Quoted 15 lines · Stefano Stabellini
Quoted 13 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Quoted 8 lines
Quoted 4 lines

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

So a sort of BVT (build verification test), such that that we could be reasonably annoyed at if an experienced developer submitted a patch that broke said functionality?

Quoted 5 lines

That's right.

In general any functionality tests, that can be added without introducing too much complexity, should be in raisin. osstest will be able to run these tests via raisin.

I think if it is intended as a BVT which I'll get shouted out for not having run then it needs to be time bound as much as functionality bound.

Ian.

Quoted 2 lines

More complex tests, involving more than one host, or specific guest/host OS combinations, should only be in osstest.

#10 lore raw
Quoted 30 lines · Ian Campbell
Quoted 29 lines · Stefano Stabellini
Quoted 17 lines · George Dunlap
Quoted 15 lines · Stefano Stabellini
Quoted 13 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Quoted 8 lines
Quoted 4 lines

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

So a sort of BVT (build verification test), such that that we could be reasonably annoyed at if an experienced developer submitted a patch that broke said functionality?

That's right.

Quoted 7 lines
Quoted 3 lines

In general any functionality tests, that can be added without introducing too much complexity, should be in raisin. osstest will be able to run these tests via raisin.

I think if it is intended as a BVT which I'll get shouted out for not having run then it needs to be time bound as much as functionality bound.

If we start to use raisin as the repository for a lot of the actual basic functionality tests which are now in osstest, then yeah, there should be a smallish subset that we might expect people to run.

OTOH, do we really have a problem with people breaking things accidentally at the moment? Does it make sense to impose the cultural expectation of running the BVT before every submission, when in the vast majority of cases developers are able to decide for themselves what testing needs to be done?

Maybe reviewers / maintainers might decide require assurance of having run a certain subset of the tests, based on the particular complexity of the patch / code being modified?

-George

#11 lore raw
Quoted 39 lines · George Dunlap
Quoted 30 lines · Ian Campbell
Quoted 29 lines · Stefano Stabellini
Quoted 17 lines · George Dunlap
Quoted 15 lines · Stefano Stabellini
Quoted 13 lines · Ian Campbell
Quoted 9 lines · Stefano Stabellini

Hi all,

this patch series introduces a framework to execute simple unit and functional tests in raisin. It can be used by developers to validate their changes before submitting a patch series to xen-devel. It can also be used by OSSTest to test for regressions on one particular functionality. This patch series only introduces two tests: a PV guest creation test and an HVM guest creation test. They are both based on busybox. More tests will follow.

What is the intended scope of these tests? e.g. when should a test be added here rather than to osstest?

Quoted 8 lines
Quoted 4 lines

Small functional tests that can be easily run on a single host, without requiring a specific host or guest operating system. Tests that every developer should run on their test machine before submitting a patch series.

So a sort of BVT (build verification test), such that that we could be reasonably annoyed at if an experienced developer submitted a patch that broke said functionality?

That's right.

Quoted 7 lines
Quoted 3 lines

In general any functionality tests, that can be added without introducing too much complexity, should be in raisin. osstest will be able to run these tests via raisin.

I think if it is intended as a BVT which I'll get shouted out for not having run then it needs to be time bound as much as functionality bound.

Quoted 6 lines

If we start to use raisin as the repository for a lot of the actual basic functionality tests which are now in osstest, then yeah, there should be a smallish subset that we might expect people to run.

OTOH, do we really have a problem with people breaking things accidentally at the moment?

I don't think we do really.

Quoted 10 lines

Does it make sense to impose the cultural
expectation of running the BVT before every submission, when in the vast majority of cases developers are able to decide for themselves what testing needs to be done?

Maybe reviewers / maintainers might decide require assurance of having run a certain subset of the tests, based on the particular complexity of the patch / code being modified?

-George