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
This commit is contained in:
Cole Robinson 2019-05-10 17:57:04 -04:00
parent 76d5113941
commit a274cc97cd
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,14 @@
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type="block" device="floppy">
- <source dev="/dev/null"/>
- <target dev="fda" bus="fdc"/>
- <boot order="5"/>
+ <target dev="fdb" bus="fdc"/>
+ <boot order="12"/>
<address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>
<disk type="file" device="disk">
Domain 'test-for-virtxml' defined successfully.
Changes will take effect after the domain is fully powered off.

View File

@ -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")