[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/4] tests: Add tests for configuration of HPT resizing



Signed-off-by: Andrea Bolognani <abologna redhat com>
---
 ...qemuxml2argv-pseries-hpt-resizing-disabled.args | 20 ++++++++++++++++
 .../qemuxml2argv-pseries-hpt-resizing-disabled.xml | 19 +++++++++++++++
 .../qemuxml2argv-pseries-hpt-resizing-enabled.args | 20 ++++++++++++++++
 .../qemuxml2argv-pseries-hpt-resizing-enabled.xml  | 19 +++++++++++++++
 ...l2argv-pseries-hpt-resizing-invalid-machine.xml | 18 ++++++++++++++
 ...qemuxml2argv-pseries-hpt-resizing-required.args | 20 ++++++++++++++++
 .../qemuxml2argv-pseries-hpt-resizing-required.xml | 19 +++++++++++++++
 tests/qemuxml2argvtest.c                           | 20 ++++++++++++++++
 ...emuxml2xmlout-pseries-hpt-resizing-disabled.xml | 28 ++++++++++++++++++++++
 ...qemuxml2xmlout-pseries-hpt-resizing-enabled.xml | 28 ++++++++++++++++++++++
 ...emuxml2xmlout-pseries-hpt-resizing-required.xml | 28 ++++++++++++++++++++++
 tests/qemuxml2xmltest.c                            | 13 ++++++++++
 12 files changed, 252 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-invalid-machine.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-disabled.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-enabled.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-required.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.args
new file mode 100644
index 000000000..795d7cb60
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.args
@@ -0,0 +1,20 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 \
+-name guest \
+-S \
+-machine pseries,accel=tcg,resize-hpt=disabled \
+-m 512 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.xml
new file mode 100644
index 000000000..4429f55ec
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.xml
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <features>
+    <!-- Explicitly disable HPT resizing instead of leaving its
+         status up to host-guest negotiation -->
+    <hpt resizing='disabled'/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.args
new file mode 100644
index 000000000..56b860cf0
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.args
@@ -0,0 +1,20 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 \
+-name guest \
+-S \
+-machine pseries,accel=tcg,resize-hpt=enabled \
+-m 512 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.xml
new file mode 100644
index 000000000..2ac2ae4b2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.xml
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <features>
+    <!-- Explicitly enable HPT resizing instead of leaving its
+         status up to host-guest negotiation -->
+    <hpt resizing='enabled'/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-invalid-machine.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-invalid-machine.xml
new file mode 100644
index 000000000..757fcc70e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-invalid-machine.xml
@@ -0,0 +1,18 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+  </os>
+  <features>
+    <!-- HPT resizing can't be enabled for non-pSeries guests -->
+    <hpt resizing='enabled'/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.args
new file mode 100644
index 000000000..994789a5e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.args
@@ -0,0 +1,20 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 \
+-name guest \
+-S \
+-machine pseries,accel=tcg,resize-hpt=required \
+-m 512 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.xml
new file mode 100644
index 000000000..f9dc9cac9
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.xml
@@ -0,0 +1,19 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+  </os>
+  <features>
+    <!-- Explicitly enable HPT resizing. The guest will not start
+         at all unless HPT resizing can be arranged -->
+    <hpt resizing='required'/>
+  </features>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2e07b85aa..cb15b5229 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1848,6 +1848,26 @@ mymain(void)
             QEMU_CAPS_VIRTIO_SCSI,
             QEMU_CAPS_DEVICE_VFIO_PCI);
 
+    DO_TEST("pseries-hpt-resizing-enabled",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+    DO_TEST("pseries-hpt-resizing-disabled",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+    DO_TEST("pseries-hpt-resizing-required",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+    DO_TEST_FAILURE("pseries-hpt-resizing-enabled",
+                    QEMU_CAPS_NODEFCONFIG,
+                    QEMU_CAPS_MACHINE_OPT);
+    DO_TEST_PARSE_ERROR("pseries-hpt-resizing-invalid-machine",
+                        QEMU_CAPS_NODEFCONFIG,
+                        QEMU_CAPS_MACHINE_OPT,
+                        QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+
     DO_TEST("disk-ide-drive-split",
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_IDE_CD);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-disabled.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-disabled.xml
new file mode 100644
index 000000000..80cd73555
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-disabled.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <hpt resizing='disabled'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
+    <memballoon model='none'/>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-enabled.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-enabled.xml
new file mode 100644
index 000000000..cb46fadcf
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-enabled.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <hpt resizing='enabled'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
+    <memballoon model='none'/>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-required.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-required.xml
new file mode 100644
index 000000000..5dd0dbd0b
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-required.xml
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>guest</name>
+  <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <hpt resizing='required'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-ppc64</emulator>
+    <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pci-root'>
+      <model name='spapr-pci-host-bridge'/>
+      <target index='0'/>
+    </controller>
+    <memballoon model='none'/>
+    <panic model='pseries'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 5a282e5ff..0f8527aab 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -761,6 +761,19 @@ mymain(void)
             QEMU_CAPS_VIRTIO_SCSI,
             QEMU_CAPS_DEVICE_VFIO_PCI);
 
+    DO_TEST("pseries-hpt-resizing-enabled",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+    DO_TEST("pseries-hpt-resizing-disabled",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+    DO_TEST("pseries-hpt-resizing-required",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+
     DO_TEST("balloon-device-auto", NONE);
     DO_TEST("balloon-device-period", NONE);
     DO_TEST("channel-virtio-auto", NONE);
-- 
2.13.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]