render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c313de
From 37dbf9fd0da8345ad03948543b9ae64954d219e1 Mon Sep 17 00:00:00 2001
c313de
Message-Id: <37dbf9fd0da8345ad03948543b9ae64954d219e1@dist-git>
c313de
From: Michal Privoznik <mprivozn@redhat.com>
c313de
Date: Thu, 27 Jun 2019 14:44:48 +0200
c313de
Subject: [PATCH] qemuhotplugtest: Test guestfwd attach and detach
c313de
c313de
Previous two commits demonstrate a hole in our test scenario.
c313de
Fix that.
c313de
c313de
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c313de
Reviewed-by: John Ferlan <jferlan@redhat.com>
c313de
(cherry picked from commit 17ddfd420a0dbcdd3f76fbecf7428acb301db188)
c313de
c313de
https://bugzilla.redhat.com/show_bug.cgi?id=1624204
c313de
c313de
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c313de
Message-Id: <08fcf2bbdefa193065ecb3c28f8d5a5a61cfeb69.1561639408.git.mprivozn@redhat.com>
c313de
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
c313de
---
c313de
 tests/qemuhotplugtest.c                       |  6 ++
c313de
 .../qemuhotplug-guestfwd.xml                  |  4 ++
c313de
 .../qemuhotplug-base-live+guestfwd.xml        | 55 +++++++++++++++++++
c313de
 3 files changed, 65 insertions(+)
c313de
 create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
c313de
 create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
c313de
c313de
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
c313de
index 8e0086a269..aaa3492d4c 100644
c313de
--- a/tests/qemuhotplugtest.c
c313de
+++ b/tests/qemuhotplugtest.c
c313de
@@ -836,6 +836,12 @@ mymain(void)
c313de
     DO_TEST_DETACH("base-live", "watchdog-user-alias-full", false, false,
c313de
                    "device_del", QMP_OK);
c313de
 
c313de
+    DO_TEST_ATTACH("base-live", "guestfwd", false, true,
c313de
+                   "chardev-add", QMP_OK,
c313de
+                   "netdev_add", QMP_OK);
c313de
+    DO_TEST_DETACH("base-live", "guestfwd", false, false,
c313de
+                   "netdev_del", QMP_OK);
c313de
+
c313de
 #define DO_TEST_CPU_GROUP(prefix, vcpus, modernhp, expectfail) \
c313de
     do { \
c313de
         cpudata.test = prefix; \
c313de
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml b/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
c313de
new file mode 100644
c313de
index 0000000000..c67dbdb8df
c313de
--- /dev/null
c313de
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-guestfwd.xml
c313de
@@ -0,0 +1,4 @@
c313de
+<channel type='unix'>
c313de
+  <source mode='bind' path='/tmp/guestfwd'/>
c313de
+  <target type='guestfwd' address='10.0.2.1' port='4600'/>
c313de
+</channel>
c313de
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
c313de
new file mode 100644
c313de
index 0000000000..8d7294123b
c313de
--- /dev/null
c313de
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-live+guestfwd.xml
c313de
@@ -0,0 +1,55 @@
c313de
+<domain type='kvm' id='7'>
c313de
+  <name>hotplug</name>
c313de
+  <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
c313de
+  <memory unit='KiB'>4194304</memory>
c313de
+  <currentMemory unit='KiB'>4194304</currentMemory>
c313de
+  <vcpu placement='static'>4</vcpu>
c313de
+  <os>
c313de
+    <type arch='x86_64' machine='pc'>hvm</type>
c313de
+    <boot dev='hd'/>
c313de
+  </os>
c313de
+  <features>
c313de
+    <acpi/>
c313de
+    <apic/>
c313de
+    <pae/>
c313de
+  </features>
c313de
+  <clock offset='utc'/>
c313de
+  <on_poweroff>destroy</on_poweroff>
c313de
+  <on_reboot>restart</on_reboot>
c313de
+  <on_crash>restart</on_crash>
c313de
+  <devices>
c313de
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
c313de
+    <controller type='usb' index='0'>
c313de
+      <alias name='usb'/>
c313de
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
c313de
+    </controller>
c313de
+    <controller type='ide' index='0'>
c313de
+      <alias name='ide'/>
c313de
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
c313de
+    </controller>
c313de
+    <controller type='scsi' index='0' model='virtio-scsi'>
c313de
+      <alias name='scsi0'/>
c313de
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
c313de
+    </controller>
c313de
+    <controller type='pci' index='0' model='pci-root'>
c313de
+      <alias name='pci'/>
c313de
+    </controller>
c313de
+    <controller type='virtio-serial' index='0'>
c313de
+      <alias name='virtio-serial0'/>
c313de
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
c313de
+    </controller>
c313de
+    <channel type='unix'>
c313de
+      <source mode='bind' path='/tmp/guestfwd'/>
c313de
+      <target type='guestfwd' address='10.0.2.1' port='4600'/>
c313de
+      <alias name='channel0'/>
c313de
+    </channel>
c313de
+    <input type='mouse' bus='ps2'>
c313de
+      <alias name='input0'/>
c313de
+    </input>
c313de
+    <input type='keyboard' bus='ps2'>
c313de
+      <alias name='input1'/>
c313de
+    </input>
c313de
+    <memballoon model='none'/>
c313de
+  </devices>
c313de
+  <seclabel type='none' model='none'/>
c313de
+</domain>
c313de
-- 
c313de
2.22.0
c313de