]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix broken rbd-mirror dashboard API test case
authorJason Dillaman <dillaman@redhat.com>
Wed, 30 Oct 2019 20:42:16 +0000 (16:42 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 5 Dec 2019 14:32:41 +0000 (09:32 -0500)
Fixes: https://tracker.ceph.com/issues/42512
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/suites/rados/dashboard/tasks/dashboard.yaml
qa/tasks/mgr/dashboard/test_rbd_mirroring.py
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py

index 342df3f66be644af6553c1bd82f280c7f2b8f5c7..9b0e5ca1f9198435bd8f5e156d45c53d7f5e62f9 100644 (file)
@@ -44,6 +44,7 @@ tasks:
         # - tasks.mgr.dashboard.test_perf_counters
         - tasks.mgr.dashboard.test_pool
         - tasks.mgr.dashboard.test_rbd
+        - tasks.mgr.dashboard.test_rbd_mirroring
         - tasks.mgr.dashboard.test_requests
         - tasks.mgr.dashboard.test_rgw
         - tasks.mgr.dashboard.test_role
index 08d793c2db4f73f28480cd6fb65677733d18ceb8..df719a72601c5a00436252170d23a6759e70653b 100644 (file)
@@ -140,9 +140,12 @@ class RbdMirroringTest(DashboardTestCase):
         expected_peer = {
             'uuid': uuid,
             'cluster_name': 'remote',
+            'site_name': 'remote',
             'client_id': 'admin',
             'mon_host': '',
-            'key': ''
+            'key': '',
+            'direction': 'rx-tx',
+            'fsid': ''
         }
         peer = self.get_peer('rbd', uuid)
         self.assertEqual(expected_peer, peer)
index 2fd4c607f5e35868627263cc5eb7aa6f93ec191e..e8f2d84cb3318700637c4a237dd6f685ffa1261b 100644 (file)
@@ -421,6 +421,14 @@ class RbdMirroringPoolPeer(RESTController):
         peer['client_id'] = peer['client_name'].split('.', 1)[-1]
         del peer['client_name']
 
+        # convert direction enum to string
+        directions = {
+            rbd.RBD_MIRROR_PEER_DIRECTION_RX: 'rx',
+            rbd.RBD_MIRROR_PEER_DIRECTION_TX: 'tx',
+            rbd.RBD_MIRROR_PEER_DIRECTION_RX_TX: 'rx-tx'
+        }
+        peer['direction'] = directions[peer.get('direction', rbd.RBD_MIRROR_PEER_DIRECTION_RX)]
+
         try:
             attributes = rbd.RBD().mirror_peer_get_attributes(ioctx, peer_uuid)
         except rbd.ImageNotFound: