diff options
author | Cole Robinson <crobinso@redhat.com> | 2020-09-18 15:45:47 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2020-09-19 13:46:22 -0400 |
commit | 4c4753d910ea430869d020028dae82059c5c2694 (patch) | |
tree | af14e4a53545594ddb1c5b37b408bf04630fcb2e /tests/test_xmlparse.py | |
parent | 0ac9ff3488f5f7052124e43cba74c43372a24dee (diff) | |
download | virt-manager-4c4753d910ea430869d020028dae82059c5c2694.tar.gz |
tests: break out test_disk.py
Move a bunch of misc disk/diskbackend tests to this file
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'tests/test_xmlparse.py')
-rw-r--r-- | tests/test_xmlparse.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/test_xmlparse.py b/tests/test_xmlparse.py index 7eb0f5f0..0d817035 100644 --- a/tests/test_xmlparse.py +++ b/tests/test_xmlparse.py @@ -1050,7 +1050,6 @@ class XMLParseTest(unittest.TestCase): assert guest.devices.disk[1].get_xml_id() == "./devices/disk[2]" assert guest.devices.disk[1].get_xml_idx() == 1 - def testReplaceChildParse(self): buildfile = DATADIR + "replace-child-build.xml" parsefile = DATADIR + "replace-child-parse.xml" @@ -1079,52 +1078,6 @@ class XMLParseTest(unittest.TestCase): guest.devices.replace_child(guest.devices.disk[4], newdisk) utils.diff_compare(guest.get_xml(), parsefile) - def testDiskBackend(self): - # Test that calling validate() on parsed disk XML doesn't attempt - # to verify the path exists. Assume it's a working config - xml = ("<disk type='file' device='disk'>" - "<source file='/A/B/C/D/NOPE'/>" - "</disk>") - disk = virtinst.DeviceDisk(self.conn, parsexml=xml) - disk.validate() - disk.is_size_conflict() - disk.build_storage(None) - assert getattr(disk, "_storage_backend").is_stub() is True - - # Stub backend coverage testing - backend = getattr(disk, "_storage_backend") - assert disk.get_parent_pool() is None - assert disk.get_vol_object() is None - assert disk.get_vol_install() is None - assert disk.get_size() == 0 - assert backend.get_vol_xml() is None - assert backend.get_dev_type() == "file" - assert backend.get_driver_type() is None - assert backend.get_parent_pool() is None - - disk.set_backend_for_existing_path() - assert getattr(disk, "_storage_backend").is_stub() is False - - with pytest.raises(ValueError): - disk.validate() - - # Ensure set_backend_for_existing_path resolves a path - # to its existing storage volume - xml = ("<disk type='file' device='disk'>" - "<source file='/dev/default-pool/default-vol'/>" - "</disk>") - conn = utils.URIs.open_testdriver_cached() - disk = virtinst.DeviceDisk(conn, parsexml=xml) - disk.set_backend_for_existing_path() - assert disk.get_vol_object() - - # Verify set_backend_for_existing_path doesn't error - # for a variety of disks - dom = conn.lookupByName("test-many-devices") - guest = virtinst.Guest(conn, parsexml=dom.XMLDesc(0)) - for disk in guest.devices.disk: - disk.set_backend_for_existing_path() - def testGuestXMLDeviceMatch(self): """ Test Guest.find_device and Device.compare_device |