[Pkg-libvirt-commits] [libvirt] 02/07: Add lxc:/// 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 90ec8ff9d39c580ef0b212d4058579f177692d9d
Author: Guido Günther <agx at sigxcpu.org>
Date: Fri Jun 3 14:42:31 2016 +0200
Add lxc:/// smoke test
---
debian/tests/control | 4 ++++
debian/tests/smoke-lxc | 30 ++++++++++++++++++++++++++++++
debian/tests/smoke-lxc.xml | 25 +++++++++++++++++++++++++
3 files changed, 59 insertions(+)
diff --git a/debian/tests/control b/debian/tests/control
index 7cf74b7..6ed6183 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -6,6 +6,10 @@ Tests: smoke-qemu-session
Depends: libvirt-daemon
Restrictions: allow-stderr, isolation-container
+Tests: smoke-lxc
+Depends: libvirt-daemon
+Restrictions: allow-stderr, needs-root
+
Tests: build-test
Depends: libvirt-dev
Restrictions: allow-stderr
diff --git a/debian/tests/smoke-lxc b/debian/tests/smoke-lxc
new file mode 100755
index 0000000..235bb49
--- /dev/null
+++ b/debian/tests/smoke-lxc
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+set -x
+
+export LIBVIRT_DEFAULT_URI='lxc:///'
+
+DOMAIN=sl
+
+cleanup()
+{
+ if [ -z "$CLEANED_UP" ]; then
+ virsh destroy ${DOMAIN} || true
+ virsh undefine ${DOMAIN} || true
+ CLEANED_UP=1
+ fi
+}
+
+trap cleanup EXIT
+
+virsh define debian/tests/smoke-lxc.xml
+virsh start ${DOMAIN}
+virsh list | grep -qs "${DOMAIN}[[:space:]]\+running"
+virsh -c lxc:/// lxc-enter-namespace --noseclabel ${DOMAIN} /bin/ls /bin/ls
+virsh destroy ${DOMAIN}
+virsh undefine ${DOMAIN}
+CLEANED_UP=1
+
+echo 'Smoke test of lxc:/// succesful'
+exit 0
diff --git a/debian/tests/smoke-lxc.xml b/debian/tests/smoke-lxc.xml
new file mode 100644
index 0000000..1c6539f
--- /dev/null
+++ b/debian/tests/smoke-lxc.xml
@@ -0,0 +1,25 @@
+<domain type='lxc'>
+ <name>sl</name>
+ <memory unit='KiB'>256000</memory>
+ <currentMemory unit='KiB'>256000</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type>exe</type>
+ <init>/bin/bash</init>
+ </os>
+ <features>
+ <privnet/>
+ </features>
+ <clock offset='utc'/>
+ <devices>
+ <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/'/>
+ <target dir='/'/>
+ </filesystem>
+ <console type='pty'>
+ <target type='lxc' port='0'/>
+ </console>
+ </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