diff options
author | Simon Kobyda <skobyda@redhat.com> | 2021-10-13 14:56:35 +0200 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-01-19 14:09:47 -0500 |
commit | 59e24f6bb9b9a1b8f34c17de837106135851c69e (patch) | |
tree | 79caa36b14892e2b7f3b0d733d6f1c5eed711269 | |
parent | 45eb83f93a67c6a67b57c912405bd34bd0eeeb25 (diff) | |
download | virt-manager-59e24f6bb9b9a1b8f34c17de837106135851c69e.tar.gz |
tests: Introduce disk attachment from pool of type 'disk'
-rw-r--r-- | tests/data/cli/compare/virt-xml-build-disk-pool-disk.xml | 5 | ||||
-rw-r--r-- | tests/data/testdriver/testdriver.xml | 39 | ||||
-rw-r--r-- | tests/test_cli.py | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/tests/data/cli/compare/virt-xml-build-disk-pool-disk.xml b/tests/data/cli/compare/virt-xml-build-disk-pool-disk.xml new file mode 100644 index 00000000..130904dc --- /dev/null +++ b/tests/data/cli/compare/virt-xml-build-disk-pool-disk.xml @@ -0,0 +1,5 @@ +<disk type="volume" device="disk"> + <driver name="qemu" type="none"/> + <source volume="sdfg1" pool="pool-disk"/> + <target dev="vdag" bus="virtio"/> +</disk> diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml index e4880936..1bccc368 100644 --- a/tests/data/testdriver/testdriver.xml +++ b/tests/data/testdriver/testdriver.xml @@ -2017,6 +2017,45 @@ ba</description> </volume> </pool> +<pool type='disk'> + <name>pool-disk</name> + <uuid>f426a5fe-d5b7-4086-a30d-95e32731cbb7</uuid> + <capacity unit='bytes'>2088960</capacity> + <allocation unit='bytes'>1304576</allocation> + <available unit='bytes'>783360</available> + <source> + <device path='/dev/sdfg'> + <freeExtent start='1305600' end='2088960'/> + </device> + <format type='dos'/> + </source> + <target> + <path>/dev/pool-disk</path> + </target> + + <volume type='block'> + <name>sdfg1</name> + <key>/dev/sdfg1</key> + <source> + <device path='/dev/sdfg'> + <extent start='1024' end='1305600'/> + </device> + </source> + <capacity unit='bytes'>1304576</capacity> + <allocation unit='bytes'>1304576</allocation> + <physical unit='bytes'>1304576</physical> + <target> + <path>/dev/sda1</path> + <format type='none'/> + <permissions> + <mode>0660</mode> + <owner>0</owner> + <group>6</group> + <label>system_u:object_r:fixed_disk_device_t:s0</label> + </permissions> + </target> + </volume> +</pool> <pool type='logical'> <name>disk-pool</name> diff --git a/tests/test_cli.py b/tests/test_cli.py index 2d56a943..2a5aaecd 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1268,6 +1268,7 @@ c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clear c.add_compare("--print-diff --remove-device --serial 1", "remove-console-dup", input_file=(_VIRTXMLDIR + "virtxml-console-dup.xml")) c.add_compare("--connect %(URI-KVM)s test-hyperv-uefi --edit --boot uefi", "hyperv-uefi-collision") c.add_compare("--connect %(URI-KVM)s test-many-devices --edit --cpu host-copy", "edit-cpu-host-copy") +c.add_compare("--connect %(URI-KVM)s test-many-devices --build-xml --disk source.pool=pool-disk,source.volume=sdfg1", "build-disk-pool-disk") c.add_compare("test --add-device --network default --update --confirm", "update-succeed", env={"VIRTXML_TESTSUITE_UPDATE_IGNORE_FAIL": "1", "VIRTINST_TEST_SUITE_INCREMENT_MACADDR": "1"}, input_text="yes\nyes\n") # test hotplug success c.add_compare("test --add-device --network default --update --confirm --no-define", "update-nodefine-succeed", env={"VIRTXML_TESTSUITE_UPDATE_IGNORE_FAIL": "1"}, input_text="yes\n") # test hotplug success without define |