2009-01-16 18:06:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Exercise a bug whereby defining a valid domain could kill libvirtd.
|
|
|
|
# The bug can also be exercised with a simple define/dumpxml pair to virsh.
|
|
|
|
|
2009-09-23 07:32:10 +00:00
|
|
|
test -z "$srcdir" && srcdir=$(pwd)
|
|
|
|
test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
|
|
|
|
test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/..
|
|
|
|
|
2009-01-16 18:06:33 +00:00
|
|
|
if test "$VERBOSE" = yes; then
|
|
|
|
set -x
|
2009-09-23 07:32:10 +00:00
|
|
|
$abs_top_builddir/tools/virsh --version
|
2009-01-16 18:06:33 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
. "$srcdir/test-lib.sh"
|
|
|
|
|
|
|
|
fail=0
|
|
|
|
|
|
|
|
# Domain definition from Cole Robinson.
|
|
|
|
cat <<\EOF > D.xml || fail=1
|
2011-07-11 17:29:09 +00:00
|
|
|
<domain type='test'>
|
2009-01-16 18:06:33 +00:00
|
|
|
<name>D</name>
|
|
|
|
<uuid>aaa3ae22-fed2-bfbd-ac02-3bea3bcfad82</uuid>
|
2012-02-23 00:48:38 +00:00
|
|
|
<memory unit='KiB'>262144</memory>
|
|
|
|
<currentMemory unit='KiB'>262144</currentMemory>
|
2009-01-16 18:06:33 +00:00
|
|
|
<vcpu>1</vcpu>
|
|
|
|
<os>
|
|
|
|
<type arch='i686' machine='pc'>hvm</type>
|
|
|
|
<boot dev='cdrom'/>
|
|
|
|
</os>
|
|
|
|
<features>
|
|
|
|
<acpi/>
|
|
|
|
</features>
|
|
|
|
<clock offset='utc'/>
|
|
|
|
<on_poweroff>destroy</on_poweroff>
|
|
|
|
<on_reboot>restart</on_reboot>
|
|
|
|
<on_crash>destroy</on_crash>
|
|
|
|
<devices>
|
|
|
|
<emulator>/usr/bin/qemu-kvm</emulator>
|
2012-02-08 00:48:25 +00:00
|
|
|
<controller type='usb' index='0'/>
|
2009-01-16 18:06:33 +00:00
|
|
|
<serial type='pty'>
|
|
|
|
<target port='0'/>
|
|
|
|
</serial>
|
|
|
|
<serial type='pty'>
|
|
|
|
<target port='1'/>
|
|
|
|
</serial>
|
|
|
|
<serial type='pty'>
|
|
|
|
<target port='2'/>
|
|
|
|
</serial>
|
|
|
|
<parallel type='pty'>
|
|
|
|
<target port='0'/>
|
|
|
|
</parallel>
|
|
|
|
<parallel type='pty'>
|
|
|
|
<target port='1'/>
|
|
|
|
</parallel>
|
|
|
|
<parallel type='pty'>
|
|
|
|
<target port='2'/>
|
|
|
|
</parallel>
|
|
|
|
<console type='pty'>
|
2010-07-22 17:56:21 +00:00
|
|
|
<target type='serial' port='0'/>
|
2009-01-16 18:06:33 +00:00
|
|
|
</console>
|
|
|
|
<sound model='pcspk'/>
|
|
|
|
<sound model='es1370'/>
|
2010-07-15 13:02:42 +00:00
|
|
|
<memballoon model='virtio'/>
|
2009-01-16 18:06:33 +00:00
|
|
|
</devices>
|
|
|
|
</domain>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
url=test:///default
|
2009-09-23 07:32:10 +00:00
|
|
|
$abs_top_builddir/tools/virsh --connect "$url" 'define D.xml; dumpxml D' > out 2>&1 || fail=1
|
2009-01-16 18:06:33 +00:00
|
|
|
|
|
|
|
cat > exp <<EOF || fail=1
|
|
|
|
Domain D defined from D.xml
|
|
|
|
|
|
|
|
$(cat D.xml)
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
compare exp out || fail=1
|
|
|
|
|
|
|
|
exit $fail
|