From a274cc97cd128d923d4f3cc547cbf014c8fd7a63 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 10 May 2019 17:57:04 -0400 Subject: [PATCH] tests: clitest: Add explicit coverage for virt-xml unsetting For example, '--edit --disk path=' can be used to unset a disk path. Internally we map empty string to None --- .../compare/virt-xml-edit-disk-unset.xml | 14 ++++++++++++++ tests/clitest.py | 1 + 2 files changed, 15 insertions(+) create mode 100644 tests/cli-test-xml/compare/virt-xml-edit-disk-unset.xml diff --git a/tests/cli-test-xml/compare/virt-xml-edit-disk-unset.xml b/tests/cli-test-xml/compare/virt-xml-edit-disk-unset.xml new file mode 100644 index 000000000..32d1d9c90 --- /dev/null +++ b/tests/cli-test-xml/compare/virt-xml-edit-disk-unset.xml @@ -0,0 +1,14 @@ + + /usr/lib/xen/bin/qemu-dm + +- +- +- ++ ++ +
+ + + +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 b1d293663..2df2f9bb3 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -990,6 +990,7 @@ c.add_compare("--edit target=hda --disk /dev/null", "edit-select-disk-target") c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-select-disk-path") 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 = 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")