[Pkg-libvirt-commits] [libvirt] 01/07: Add qemu:///session smoke test

Guido Guenther agx at moszumanska.debian.org
Sun Jun 5 12:39:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch debian/sid
in repository libvirt.

commit afaf26b5f5d29bd63ed3609e4bf51a7fed5b620f
Author: Guido Günther <agx at sigxcpu.org>
Date:   Fri Jun 3 12:42:06 2016 +0200

    Add qemu:///session smoke test
---
 debian/tests/control                |  5 +++++
 debian/tests/smoke-qemu-session     | 37 +++++++++++++++++++++++++++++++++++++
 debian/tests/smoke-qemu-session.xml | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+)

diff --git a/debian/tests/control b/debian/tests/control
index e9693af..7cf74b7 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -2,6 +2,11 @@ Tests: smoke
 Depends: @
 Restrictions: allow-stderr
 
+Tests: smoke-qemu-session
+Depends: libvirt-daemon
+Restrictions: allow-stderr, isolation-container
+
 Tests: build-test
 Depends: libvirt-dev
 Restrictions: allow-stderr
+
diff --git a/debian/tests/smoke-qemu-session b/debian/tests/smoke-qemu-session
new file mode 100755
index 0000000..00875e3
--- /dev/null
+++ b/debian/tests/smoke-qemu-session
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+set -x
+
+export LIBVIRT_DEFAULT_URI='qemu:///session'
+
+cleanup()
+{
+   if [ -z "$CLEANED_UP" ]; then
+     virsh destroy sqs  || true
+     virsh undefine sqs || true
+     CLEANED_UP=1
+   fi
+}
+
+trap cleanup EXIT
+
+if [ ! -f /vmlinuz ] || [ ! -f /initrd.img ]; then
+   echo "Kernel or initrd not found...skipping".
+   exit 0
+fi
+
+if [ $(uname -m) != "x86_64" ]; then
+   echo "Not on x86_64...skipping"
+   exit 0
+fi
+
+virsh define debian/tests/smoke-qemu-session.xml
+virsh start sqs
+virsh list | grep -qs 'sqs[[:space:]]\+running'
+virsh destroy sqs
+virsh undefine sqs
+CLEANED_UP=1
+
+echo 'Smoke test of qemu session:/// succesful'
+exit 0
diff --git a/debian/tests/smoke-qemu-session.xml b/debian/tests/smoke-qemu-session.xml
new file mode 100644
index 0000000..47b33d5
--- /dev/null
+++ b/debian/tests/smoke-qemu-session.xml
@@ -0,0 +1,33 @@
+<domain type='kvm'>
+  <name>sqs</name>
+  <memory unit='KiB'>256000</memory>
+  <currentMemory unit='KiB'>256000</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
+    <kernel>/vmlinuz</kernel>
+    <initrd>/initrd.img</initrd>
+    <cmdline> console=ttyS0 quiet loglevel=0 edd=off printk.time=1 noreplace-smp cgroup_disable=memory pci=noearly noapic panic=-1 selinux=0</cmdline>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>destroy</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/kvm</emulator>
+    <controller type='virtio-serial' index='0'>
+      <alias name='virtio-serial0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </controller>
+    <filesystem type='mount' accessmode='squash'>
+      <source dir='/'/>
+      <target dir='sqs:root'/>
+      <readonly/>
+    </filesystem>
+  </devices>
+</domain>
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list