Skip to content
Snippets Groups Projects
Commit 90ec8ff9 authored by Guido Günther's avatar Guido Günther
Browse files

Add lxc:/// smoke test

parent afaf26b5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
#!/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
<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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment