summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_disk.py18
-rw-r--r--tests/uitests/test_addhardware.py2
2 files changed, 19 insertions, 1 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"
diff --git a/tests/uitests/test_addhardware.py b/tests/uitests/test_addhardware.py
index c1b02ee2..22852601 100644
--- a/tests/uitests/test_addhardware.py
+++ b/tests/uitests/test_addhardware.py
@@ -130,7 +130,7 @@ def testAddCephDisk(app):
tab = details.find("disk-tab")
lib.utils.check(lambda: tab.showing)
disk_path = tab.find("disk-source-path")
- lib.utils.check(lambda: "rbd://" in disk_path.text)
+ lib.utils.check(lambda: "rbd-sourcename/some-rbd-vol" in disk_path.text)
def testAddDisks(app):