diff options
author | Cole Robinson <crobinso@redhat.com> | 2020-11-10 15:49:24 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2020-11-11 19:06:32 -0500 |
commit | 6a6c1c13d74cc31e9d581b74bd7101c141a94a02 (patch) | |
tree | fe1643c2a6fca35ca7912741818ab22d94475ee0 /tests/test_disk.py | |
parent | 3d07b28a360eb1ba1507c5713b99954eb226751f (diff) | |
download | virt-manager-6a6c1c13d74cc31e9d581b74bd7101c141a94a02.tar.gz |
diskbackend: Fix volume lookup for existing rbd disk
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'tests/test_disk.py')
-rw-r--r-- | tests/test_disk.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_disk.py b/tests/test_disk.py index 6e6c0b43..c5d2c3c3 100644 --- a/tests/test_disk.py +++ b/tests/test_disk.py @@ -208,3 +208,21 @@ def test_disk_diskbackend_parse(): guest = virtinst.Guest(conn, parsexml=dom.XMLDesc(0)) for disk in guest.devices.disk: disk.set_backend_for_existing_path() + + +def test_disk_rbd_path(): + conn = utils.URIs.open_testdriver_cached() + diskxml1 = """ + <disk type="network" device="disk"> + <source protocol="rbd" name="rbd-sourcename/some-rbd-vol"> + <host name="ceph-mon-1.example.com" port="6789"/> + <host name="ceph-mon-2.example.com" port="6789"/> + <host name="ceph-mon-3.example.com" port="6789"/> + </source> + <target dev="vdag" bus="virtio"/> + </disk> + """ + + disk1 = virtinst.DeviceDisk(conn, parsexml=diskxml1) + disk1.set_backend_for_existing_path() + assert disk1.get_vol_object().name() == "some-rbd-vol" |