[virt-tools-list] [virt-manager PATCH 1/4] tests: Add a couple of virt-xml memballoon tests

Andrea Bolognani abologna at redhat.com
Thu Jun 13 10:55:07 UTC 2019


We're going to slightly change how the device is handled in
a minute, and we want to make sure we don't break existing
functionality while doing so.

Note that the existing singleton-config-* test cases already
provide coverage for both enabling and disabling the memory
balloon in virt-install.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
 .../compare/virt-xml-edit-disable-memballoon.xml      | 11 +++++++++++
 .../compare/virt-xml-remove-memballoon.xml            | 10 ++++++++++
 tests/clitest.py                                      |  2 ++
 3 files changed, 23 insertions(+)
 create mode 100644 tests/cli-test-xml/compare/virt-xml-edit-disable-memballoon.xml
 create mode 100644 tests/cli-test-xml/compare/virt-xml-remove-memballoon.xml

diff --git a/tests/cli-test-xml/compare/virt-xml-edit-disable-memballoon.xml b/tests/cli-test-xml/compare/virt-xml-edit-disable-memballoon.xml
new file mode 100644
index 00000000..e40396c2
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-edit-disable-memballoon.xml
@@ -0,0 +1,11 @@
+     </redirfilter>
+     <hub type="usb"/>
+     <watchdog model="ib700" action="poweroff"/>
+-    <memballoon model="virtio"/>
++    <memballoon model="none"/>
+     <rng model="virtio">
+       <rate bytes="1234" period="2000"/>
+       <backend model="egd" type="tcp">
+
+Domain 'test-for-virtxml' defined successfully.
+Changes will take effect after the domain is fully powered off.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-remove-memballoon.xml b/tests/cli-test-xml/compare/virt-xml-remove-memballoon.xml
new file mode 100644
index 00000000..42ed467b
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-remove-memballoon.xml
@@ -0,0 +1,10 @@
+     </redirfilter>
+     <hub type="usb"/>
+     <watchdog model="ib700" action="poweroff"/>
+-    <memballoon model="virtio"/>
+     <rng model="virtio">
+       <rate bytes="1234" period="2000"/>
+       <backend model="egd" type="tcp">
+
+Domain 'test-for-virtxml' defined successfully.
+Changes will take effect after the domain is fully powered off.
\ No newline at end of file
diff --git a/tests/clitest.py b/tests/clitest.py
index 4d2eff3b..b3fcd604 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -1144,6 +1144,7 @@ c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-sele
 c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-select-network-mac")
 c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder")
 c.add_compare("--edit path=/dev/null --disk path=,target=fdb,boot_order=12", "edit-disk-unset")  # --disk matching, using empty value to unset path
+c.add_compare("--edit --memballoon none", "edit-disable-memballoon")
 
 c = vixml.add_category("edit and start selection", "test-state-shutoff --print-diff --start")
 c.add_compare("--define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder")
@@ -1177,6 +1178,7 @@ c.add_compare("--remove-device --disk 3", "remove-disk-index")
 c.add_compare("--remove-device --disk /dev/null", "remove-disk-path")
 c.add_compare("--remove-device --video all", "remove-video-all")
 c.add_compare("--remove-device --host-device 0x04b3:0x4485", "remove-hostdev-name")
+c.add_compare("--remove-device --memballoon all", "remove-memballoon")
 
 c = vixml.add_category("add/rm devices and start", "test-state-shutoff --print-diff --start")
 c.add_invalid("--add-device --pm suspend_to_disk=yes")  # --add-device without a device
-- 
2.21.0




More information about the virt-tools-list mailing list