Re: [libvirt] [PATCH 4/4] tests: Add separate tests for 'xres' and 'yres'

2019-08-05 Thread Ján Tomko

On Sun, Aug 04, 2019 at 10:21:21PM -0300, jcfara...@gmail.com wrote:

From: Julio Faracco 

New tests to verify resolution properties of a simple qxl video.

Signed-off-by: Julio Faracco 
---
.../video-qxl-resolution.args | 32 +++


xml->argv test should be introduced along with the qemu_command changes.


.../qemuxml2argvdata/video-qxl-resolution.xml | 40 +++
tests/qemuxml2argvtest.c  |  4 ++
.../video-qxl-resolution.xml  | 40 +++
tests/qemuxml2xmltest.c   |  1 +
5 files changed, 117 insertions(+)
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.args
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.xml
create mode 100644 tests/qemuxml2xmloutdata/video-qxl-resolution.xml

diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.args 
b/tests/qemuxml2argvdata/video-qxl-resolution.args
new file mode 100644
index 00..71370ff735
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.xml 
b/tests/qemuxml2argvdata/video-qxl-resolution.xml
new file mode 100644
index 00..c6275c1bc5
--- /dev/null
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.xml
@@ -0,0 +1,40 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+hvm
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-i686
+
+  
+  
+  
+  
+


No need for a disk for testing graphics devices.


+
+  
+
+
+  
+
+
+
+
+
+  


I'm not a fan of blindly copying qemu's laconic arguments.
Also, for other devices, we'd put such arguments into the 
element, not .

So I propose either:

 


or


 


+  
+
+
+  
+
+  
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c166fd18d6..b67ba8f135 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2003,6 +2003,10 @@ mymain(void)
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_DEVICE_QXL,
QEMU_CAPS_QXL_MAX_OUTPUTS);
+DO_TEST("video-qxl-resolution",
+QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+QEMU_CAPS_DEVICE_QXL,
+QEMU_CAPS_QXL_MAX_OUTPUTS);


Please use DO_TEST_CAPS_LATEST which runs the test with the latest QEMU
capabilities we have collected from a real QEMU instance. With manually
enumerating the capabilities there's a risk of missing some.

If you want to test it against an older QEMU version which lacked some
capability, there's DO_TEST_CAPS_VER

Jano


DO_TEST("video-virtio-gpu-device",
QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY);


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 4/4] tests: Add separate tests for 'xres' and 'yres'

2019-08-04 Thread jcfaracco
From: Julio Faracco 

New tests to verify resolution properties of a simple qxl video.

Signed-off-by: Julio Faracco 
---
 .../video-qxl-resolution.args | 32 +++
 .../qemuxml2argvdata/video-qxl-resolution.xml | 40 +++
 tests/qemuxml2argvtest.c  |  4 ++
 .../video-qxl-resolution.xml  | 40 +++
 tests/qemuxml2xmltest.c   |  1 +
 5 files changed, 117 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.args
 create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.xml
 create mode 100644 tests/qemuxml2xmloutdata/video-qxl-resolution.xml

diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.args 
b/tests/qemuxml2argvdata/video-qxl-resolution.args
new file mode 100644
index 00..71370ff735
--- /dev/null
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.args
@@ -0,0 +1,32 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,\
+xres=1280,yres=720,bus=pci.0,addr=0x2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/video-qxl-resolution.xml 
b/tests/qemuxml2argvdata/video-qxl-resolution.xml
new file mode 100644
index 00..c6275c1bc5
--- /dev/null
+++ b/tests/qemuxml2argvdata/video-qxl-resolution.xml
@@ -0,0 +1,40 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+hvm
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-i686
+
+  
+  
+  
+  
+
+
+  
+
+
+  
+
+
+
+
+
+  
+  
+
+
+  
+
+  
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c166fd18d6..b67ba8f135 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2003,6 +2003,10 @@ mymain(void)
 QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
 QEMU_CAPS_DEVICE_QXL,
 QEMU_CAPS_QXL_MAX_OUTPUTS);
+DO_TEST("video-qxl-resolution",
+QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
+QEMU_CAPS_DEVICE_QXL,
+QEMU_CAPS_QXL_MAX_OUTPUTS);
 DO_TEST("video-virtio-gpu-device",
 QEMU_CAPS_DEVICE_VIRTIO_GPU,
 QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
diff --git a/tests/qemuxml2xmloutdata/video-qxl-resolution.xml 
b/tests/qemuxml2xmloutdata/video-qxl-resolution.xml
new file mode 100644
index 00..c6275c1bc5
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/video-qxl-resolution.xml
@@ -0,0 +1,40 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+hvm
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-i686
+
+  
+  
+  
+  
+
+
+  
+
+
+  
+
+
+
+
+
+  
+  
+
+
+  
+
+  
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 525eb9a740..62485e89d9 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1189,6 +1189,7 @@ mymain(void)
 QEMU_CAPS_DEVICE_QXL);
 DO_TEST("video-qxl-heads", NONE);
 DO_TEST("video-qxl-noheads", NONE);
+DO_TEST("video-qxl-resolution", NONE);
 DO_TEST("video-virtio-gpu-secondary", NONE);
 DO_TEST("video-virtio-gpu-ccw",
 QEMU_CAPS_CCW,
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list