[libvirt] [PATCH v2] tests: Add more complex domain scheme test data

--- diff to v1: -move from tests/domainschemadata/ to tests/qemuxml2argvdata/ -add .args .../qemuxml2argv-graphics-spice-timeout.args | 14 +++ .../qemuxml2argv-graphics-spice-timeout.xml | 86 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 5 + tests/qemuxml2xmltest.c | 3 +- 4 files changed, 107 insertions(+), 1 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args new file mode 100644 index 0000000..7c30e43 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu-kvm -S -M pc-0.13 -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds \ +-m 1024 -smp 2 -nodefaults -monitor unix:/tmp/test-monitor,server,nowait \ +-boot dc -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \ +-drive file=/var/lib/libvirt/images/f14.img,if=none,id=drive-virtio-disk0 \ +-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 \ +-drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,if=none,media=cdrom,id=drive-ide0-1-0 \ +-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \ +-device rtl8139,vlan=0,id=net0,mac=52:54:00:71:70:89,bus=pci.0,addr=0x7 \ +-net tap,script=/etc/qemu-ifup,vlan=0,name=hostnet0 -serial pty \ +-usb -device usb-tablet,id=input0 \ +-spice port=5900,tls-port=0,x509-dir=/etc/pki/libvirt-spice -vga std \ +-device AC97,id=sound0,bus=pci.0,addr=0x3 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml new file mode 100644 index 0000000..aaa4469 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -0,0 +1,86 @@ +<domain type='qemu'> + <name>f14</name> + <uuid>553effab-b5e1-2d80-dfe3-da4344826c43</uuid> + <memory>1048576</memory> + <currentMemory>1048576</currentMemory> + <vcpu>2</vcpu> + <os> + <type arch='x86_64' machine='pc-0.13'>hvm</type> + <boot dev='cdrom'/> + <boot dev='hd'/> + <bootmenu enable='yes'/> + </os> + <features> + <acpi/> + <apic/> + <pae/> + </features> + <cpu match='exact'> + <model>core2duo</model> + <vendor>Intel</vendor> + <topology sockets='1' cores='2' threads='1'/> + <feature policy='require' name='lahf_lm'/> + <feature policy='require' name='xtpr'/> + <feature policy='require' name='cx16'/> + <feature policy='require' name='tm2'/> + <feature policy='require' name='est'/> + <feature policy='require' name='vmx'/> + <feature policy='require' name='ds_cpl'/> + <feature policy='require' name='pbe'/> + <feature policy='require' name='tm'/> + <feature policy='require' name='ht'/> + <feature policy='require' name='ss'/> + <feature policy='require' name='acpi'/> + <feature policy='require' name='ds'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <emulator>/usr/bin/qemu-kvm</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='/var/lib/libvirt/images/f14.img'/> + <target dev='vda' bus='virtio'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> + </disk> + <disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso'/> + <target dev='hdc' bus='ide'/> + <readonly/> + <address type='drive' controller='0' bus='1' unit='0'/> + </disk> + <controller type='ide' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> + </controller> + <controller type='virtio-serial' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> + </controller> + <interface type='ethernet'> + <mac address='52:54:00:71:70:89'/> + <script path='/etc/qemu-ifup'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </interface> + <serial type='pty'> + <target port='0'/> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <input type='tablet' bus='usb'/> + <input type='mouse' bus='ps2'/> + <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22'/> + <sound model='ac97'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </sound> + <video> + <model type='vga' vram='9216' heads='1'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> + </video> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 33cc58f..c9076e1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -357,6 +357,11 @@ mymain(void) DO_TEST("graphics-spice-compression", false, QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE); + DO_TEST("graphics-spice-timeout", false, + QEMU_CAPS_DRIVE, + QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL, + QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE, + QEMU_CAPS_DEVICE_QXL_VGA); DO_TEST("graphics-spice-qxl-vga", false, QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE, diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 1574cae..64a833f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -35,7 +35,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml) VIR_DOMAIN_XML_INACTIVE))) goto fail; - if (!(actual = virDomainDefFormat(def, 0))) + if (!(actual = virDomainDefFormat(def, VIR_DOMAIN_XML_SECURE))) goto fail; @@ -144,6 +144,7 @@ mymain(void) DO_TEST("graphics-sdl-fullscreen"); DO_TEST("graphics-spice"); DO_TEST("graphics-spice-compression"); + DO_TEST("graphics-spice-timeout"); DO_TEST("graphics-spice-qxl-vga"); DO_TEST("input-usbmouse"); DO_TEST("input-usbtablet"); -- 1.7.5.rc3

On 05/31/2011 08:59 AM, Michal Privoznik wrote:
--- diff to v1: -move from tests/domainschemadata/ to tests/qemuxml2argvdata/ -add .args
.../qemuxml2argv-graphics-spice-timeout.args | 14 +++ .../qemuxml2argv-graphics-spice-timeout.xml | 86 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 5 + tests/qemuxml2xmltest.c | 3 +- 4 files changed, 107 insertions(+), 1 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args new file mode 100644 index 0000000..7c30e43 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu-kvm -S -M pc-0.13 -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds \
You can additionally add backslash-newline pairs in the middle of this line, rather than only breaking lines after spaces, if it helps fit the file into 80 columns. But that's stylistic, and not a showstopper to have a long line. So ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 31.05.2011 17:06, Eric Blake wrote:
On 05/31/2011 08:59 AM, Michal Privoznik wrote:
--- diff to v1: -move from tests/domainschemadata/ to tests/qemuxml2argvdata/ -add .args
.../qemuxml2argv-graphics-spice-timeout.args | 14 +++ .../qemuxml2argv-graphics-spice-timeout.xml | 86 ++++++++++++++++++++ tests/qemuxml2argvtest.c | 5 + tests/qemuxml2xmltest.c | 3 +- 4 files changed, 107 insertions(+), 1 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args new file mode 100644 index 0000000..7c30e43 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu-kvm -S -M pc-0.13 -cpu core2duo,+lahf_lm,+xtpr,+cx16,+tm2,+est,+vmx,+ds_cpl,+pbe,+tm,+ht,+ss,+acpi,+ds \
You can additionally add backslash-newline pairs in the middle of this line, rather than only breaking lines after spaces, if it helps fit the file into 80 columns. But that's stylistic, and not a showstopper to have a long line. So
ACK.
Fixed and pushed. Thanks Michal

On 05/31/2011 08:59 AM, Michal Privoznik wrote:
--- diff to v1: -move from tests/domainschemadata/ to tests/qemuxml2argvdata/ -add .args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu-kvm
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -0,0 +1,86 @@ +<domain type='qemu'>
+ <devices> + <emulator>/usr/bin/qemu-kvm</emulator>
Phooey - this test is now failing on a RHEL 6.1 machine: 54) QEMU XML-2-ARGV graphics-spice-timeout ... libvir: QEMU error : Cannot find QEMU binary /usr/bin/qemu-kvm: No such file or directory FAILED This is the first test in qemuxml2argvdata that insists on /usr/bin/qemu-kvm instead of /usr/bin/qemu. I was about to push the "obvious" fix of s/qemu-kvm/qemu/, but that just papers over the real bug, which is that our testsuite depends on what is installed on the test machine. We need to figure out the root cause and make the test work even when the <emulator> tag requested by the tag does not exist on the machine running the test. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/31/2011 11:28 AM, Eric Blake wrote:
This is the first test in qemuxml2argvdata that insists on /usr/bin/qemu-kvm instead of /usr/bin/qemu.
I was about to push the "obvious" fix of s/qemu-kvm/qemu/, but that just papers over the real bug, which is that our testsuite depends on what is installed on the test machine. We need to figure out the root cause and make the test work even when the <emulator> tag requested by the tag does not exist on the machine running the test.
Perhaps using <emulator>/./qemu.sh</emulator> is the way to go for this test (see qemuxml2argv-cpu-exact1.xml, for precedence). On the other hand, it looks like qemuxml2argvtest is only run if qemu was detected, which is why we have been getting away with calling the /usr/bin/qemu binary in so many tests already, but it seems like a nicer solution would be one where we don't have to use the external binary at all. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Tue, May 31, 2011 at 11:28:39AM -0600, Eric Blake wrote:
On 05/31/2011 08:59 AM, Michal Privoznik wrote:
--- diff to v1: -move from tests/domainschemadata/ to tests/qemuxml2argvdata/ -add .args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.args @@ -0,0 +1,14 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ +/usr/bin/qemu-kvm
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -0,0 +1,86 @@ +<domain type='qemu'>
+ <devices> + <emulator>/usr/bin/qemu-kvm</emulator>
Phooey - this test is now failing on a RHEL 6.1 machine:
54) QEMU XML-2-ARGV graphics-spice-timeout ... libvir: QEMU error : Cannot find QEMU binary /usr/bin/qemu-kvm: No such file or directory FAILED
This is the first test in qemuxml2argvdata that insists on /usr/bin/qemu-kvm instead of /usr/bin/qemu.
I was about to push the "obvious" fix of s/qemu-kvm/qemu/, but that just papers over the real bug, which is that our testsuite depends on what is installed on the test machine. We need to figure out the root cause and make the test work even when the <emulator> tag requested by the tag does not exist on the machine running the test.
The existing tests don't depend on the host OS install. We setup capabilities data in testutilsqemu.c for them. The problem is that this test file used a binary that isn't in the capabilities data we provide to tests, so we fallback to trying to extract the data for it. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Michal Privoznik
-
Michal Prívozník