]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
RBD: remove duplicate clone test
authorJon Bernard <jobernar@redhat.com>
Thu, 10 Mar 2016 21:00:41 +0000 (16:00 -0500)
committerJon Bernard <jobernar@redhat.com>
Thu, 10 Mar 2016 21:00:41 +0000 (16:00 -0500)
A more robust test for clone() recently added and there is no need to
keep the lesser (and nearly duplicate) version.

Change-Id: I34675f40b2bfdc709d985415454881b502d0436f

cinder/tests/unit/test_rbd.py

index 7a91a73b573f62f760a10964f200d38323831c05..57cf77b667f35914b69879d93869a88765919ffa 100644 (file)
@@ -843,43 +843,12 @@ class RBDTestCase(test.TestCase):
             self.assertDictMatch(expected, actual)
             self.assertTrue(mock_get_mon_addrs.called)
 
-    @common_mocks
-    def test_clone(self):
-        src_pool = u'images'
-        src_image = u'image-name'
-        src_snap = u'snapshot-name'
-
-        client_stack = []
-
-        def mock__enter__(inst):
-            def _inner():
-                client_stack.append(inst)
-                return inst
-            return _inner
-
-        client = self.mock_client.return_value
-        # capture both rados client used to perform the clone
-        client.__enter__.side_effect = mock__enter__(client)
-
-        self.driver._clone(self.volume_a, src_pool, src_image, src_snap)
-
-        chunk_size = self.cfg.rbd_store_chunk_size * units.Mi
-        order = int(math.log(chunk_size, 2))
-
-        args = [client_stack[0].ioctx, str(src_image), str(src_snap),
-                client_stack[1].ioctx, str(self.volume_a.name)]
-        kwargs = {'features': client.features,
-                  'order': order}
-        self.mock_rbd.RBD.return_value.clone.assert_called_once_with(
-            *args, **kwargs)
-        self.assertEqual(2, client.__enter__.call_count)
-
     @ddt.data({'rbd_chunk_size': 1, 'order': 20},
               {'rbd_chunk_size': 8, 'order': 23},
               {'rbd_chunk_size': 32, 'order': 25})
     @ddt.unpack
     @common_mocks
-    def test_clone_different_rbd_store_chunk_size(self, rbd_chunk_size, order):
+    def test_clone(self, rbd_chunk_size, order):
         self.cfg.rbd_store_chunk_size = rbd_chunk_size
         src_pool = u'images'
         src_image = u'image-name'