[virt-tools-list] [virt-manager PATCH 3/6] tests: cli: Add simple guests with graphics

Andrea Bolognani abologna at redhat.com
Wed Mar 20 15:52:32 UTC 2019


These cover the use case "I want to get an existing guest
image running in the cloud, and I need graphics".

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 .../compare/virt-install-aarch64-graphics.xml | 47 +++++++++++++++
 .../compare/virt-install-ppc64-graphics.xml   | 43 ++++++++++++++
 .../compare/virt-install-s390x-graphics.xml   | 40 +++++++++++++
 .../compare/virt-install-x86_64-graphics.xml  | 57 +++++++++++++++++++
 tests/clitest.py                              |  8 +++
 5 files changed, 195 insertions(+)
 create mode 100644 tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
 create mode 100644 tests/cli-test-xml/compare/virt-install-ppc64-graphics.xml
 create mode 100644 tests/cli-test-xml/compare/virt-install-s390x-graphics.xml
 create mode 100644 tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml

diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml b/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
new file mode 100644
index 00000000..da533806
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
@@ -0,0 +1,47 @@
+<domain type="kvm">
+  <name>foobar</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <metadata>
+    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+      <libosinfo:os id="http://fedoraproject.org/fedora/29"/>
+    </libosinfo:libosinfo>
+  </metadata>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch="aarch64" machine="virt">hvm</type>
+    <loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+    <boot dev="hd"/>
+  </os>
+  <cpu mode="host-passthrough"/>
+  <clock offset="utc"/>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="qcow2"/>
+      <source file="/dev/default-pool/testvol1.img"/>
+      <target dev="vda" bus="virtio"/>
+    </disk>
+    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+    <interface type="bridge">
+      <source bridge="eth0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty"/>
+    <channel type="unix">
+      <source mode="bind"/>
+      <target type="virtio" name="org.qemu.guest_agent.0"/>
+    </channel>
+    <input type="tablet" bus="usb"/>
+    <input type="keyboard" bus="usb"/>
+    <graphics type="vnc" port="-1"/>
+    <video>
+      <model type="virtio"/>
+    </video>
+    <rng model="virtio">
+      <backend model="random">/dev/urandom</backend>
+    </rng>
+  </devices>
+</domain>
diff --git a/tests/cli-test-xml/compare/virt-install-ppc64-graphics.xml b/tests/cli-test-xml/compare/virt-install-ppc64-graphics.xml
new file mode 100644
index 00000000..5b27017b
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-ppc64-graphics.xml
@@ -0,0 +1,43 @@
+<domain type="kvm">
+  <name>foobar</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <metadata>
+    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+      <libosinfo:os id="http://fedoraproject.org/fedora/29"/>
+    </libosinfo:libosinfo>
+  </metadata>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch="ppc64le" machine="pseries">hvm</type>
+    <boot dev="hd"/>
+  </os>
+  <clock offset="utc"/>
+  <devices>
+    <emulator>/usr/libexec/qemu-kvm</emulator>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="qcow2"/>
+      <source file="/dev/default-pool/testvol1.img"/>
+      <target dev="vda" bus="virtio"/>
+    </disk>
+    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+    <interface type="bridge">
+      <source bridge="eth0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty"/>
+    <channel type="unix">
+      <source mode="bind"/>
+      <target type="virtio" name="org.qemu.guest_agent.0"/>
+    </channel>
+    <graphics type="vnc" port="-1"/>
+    <video>
+      <model type="vga"/>
+    </video>
+    <rng model="virtio">
+      <backend model="random">/dev/urandom</backend>
+    </rng>
+  </devices>
+</domain>
diff --git a/tests/cli-test-xml/compare/virt-install-s390x-graphics.xml b/tests/cli-test-xml/compare/virt-install-s390x-graphics.xml
new file mode 100644
index 00000000..beee2136
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-s390x-graphics.xml
@@ -0,0 +1,40 @@
+<domain type="kvm">
+  <name>foobar</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <metadata>
+    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+      <libosinfo:os id="http://fedoraproject.org/fedora/29"/>
+    </libosinfo:libosinfo>
+  </metadata>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch="s390x" machine="s390-ccw-virtio">hvm</type>
+    <boot dev="hd"/>
+  </os>
+  <clock offset="utc"/>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="qcow2"/>
+      <source file="/dev/default-pool/testvol1.img"/>
+      <target dev="vda" bus="virtio"/>
+    </disk>
+    <interface type="bridge">
+      <source bridge="eth0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty">
+      <target type="sclp"/>
+    </console>
+    <graphics type="vnc" port="-1"/>
+    <video>
+      <model type="virtio"/>
+    </video>
+    <rng model="virtio">
+      <backend model="random">/dev/urandom</backend>
+    </rng>
+  </devices>
+</domain>
diff --git a/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml b/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml
new file mode 100644
index 00000000..517ac1bd
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-x86_64-graphics.xml
@@ -0,0 +1,57 @@
+<domain type="kvm">
+  <name>foobar</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <metadata>
+    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+      <libosinfo:os id="http://fedoraproject.org/fedora/29"/>
+    </libosinfo:libosinfo>
+  </metadata>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch="x86_64" machine="q35">hvm</type>
+    <boot dev="hd"/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+  </features>
+  <cpu mode="host-model"/>
+  <clock offset="utc">
+    <timer name="rtc" tickpolicy="catchup"/>
+    <timer name="pit" tickpolicy="delay"/>
+    <timer name="hpet" present="no"/>
+  </clock>
+  <pm>
+    <suspend-to-mem enabled="no"/>
+    <suspend-to-disk enabled="no"/>
+  </pm>
+  <devices>
+    <emulator>/usr/bin/qemu-kvm</emulator>
+    <disk type="file" device="disk">
+      <driver name="qemu" type="qcow2"/>
+      <source file="/dev/default-pool/testvol1.img"/>
+      <target dev="vda" bus="virtio"/>
+    </disk>
+    <controller type="usb" index="0" model="qemu-xhci" ports="15"/>
+    <interface type="bridge">
+      <source bridge="eth0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="virtio"/>
+    </interface>
+    <console type="pty"/>
+    <channel type="unix">
+      <source mode="bind"/>
+      <target type="virtio" name="org.qemu.guest_agent.0"/>
+    </channel>
+    <input type="tablet" bus="usb"/>
+    <graphics type="vnc" port="-1"/>
+    <video>
+      <model type="qxl"/>
+    </video>
+    <rng model="virtio">
+      <backend model="random">/dev/urandom</backend>
+    </rng>
+  </devices>
+</domain>
diff --git a/tests/clitest.py b/tests/clitest.py
index b84e7fa9..ba1d5682 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -812,6 +812,14 @@ c.add_compare("--connect %(URI-KVM-S390X)s --arch s390x", "s390x-headless")
 c.add_compare("--connect %(URI-KVM)s --arch x86_64", "x86_64-headless")
 
 
+# Simple guests with graphics for various architectures
+c = vinst.add_category("kvm-graphics", "--os-variant fedora29 --import --disk %(EXISTIMG1)s --network default --rng /dev/urandom --graphics vnc")
+c.add_compare("--connect %(URI-KVM-AARCH64)s --arch aarch64", "aarch64-graphics")
+c.add_compare("--connect %(URI-KVM-PPC64LE)s --arch ppc64le", "ppc64-graphics")
+c.add_compare("--connect %(URI-KVM-S390X)s --arch s390x", "s390x-graphics")
+c.add_compare("--connect %(URI-KVM)s --arch x86_64", "x86_64-graphics")
+
+
 
 ######################
 # LXC specific tests #
-- 
2.20.1




More information about the virt-tools-list mailing list