]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add volume ID to fake volumes in Gluster tests
authorJohn Griffith <john.griffith8@gmail.com>
Fri, 29 May 2015 18:57:59 +0000 (12:57 -0600)
committerJohn Griffith <john.griffith8@gmail.com>
Fri, 29 May 2015 19:26:05 +0000 (19:26 +0000)
This adds the volume ID field to the fake volume objects
in the GlusterFS tests.  Turning up concurrency exposes some
issues where access of this field is attempted but doesn't
exist.

Parital-Bug: #1459854

Change-Id: I0edb4fc7f2d6d4a3c23f395b4c2a611c0e954425

cinder/tests/unit/test_glusterfs.py

index 29dcb142879709ab8120f0a52be31f37d77d8864..28dbecb6123f165d7898cb629d177366500bb7c0 100644 (file)
@@ -141,6 +141,7 @@ class GlusterFsDriverTestCase(test.TestCase):
         drv = self._driver
 
         volume = DumbVolume()
+        volume['id'] = self.VOLUME_UUID
         volume['provider_location'] = self.TEST_EXPORT1
         volume['name'] = 'volume-123'
 
@@ -605,6 +606,7 @@ class GlusterFsDriverTestCase(test.TestCase):
                 mock_ensure_shares_mounted:
             volume = DumbVolume()
             volume['size'] = self.TEST_SIZE_IN_GB
+            volume['id'] = self.VOLUME_UUID
             drv.create_volume(volume)
             self.assertTrue(mock_ensure_shares_mounted.called)
             self.assertTrue(mock_do_create_volume.called)
@@ -623,6 +625,7 @@ class GlusterFsDriverTestCase(test.TestCase):
 
             volume = DumbVolume()
             volume['size'] = self.TEST_SIZE_IN_GB
+            volume['id'] = self.VOLUME_UUID
             result = drv.create_volume(volume)
             self.assertEqual(self.TEST_EXPORT1, result['provider_location'])
             self.assertTrue(mock_ensure_shares_mounted.called)
@@ -905,6 +908,7 @@ class GlusterFsDriverTestCase(test.TestCase):
                 mock.patch.object(drv, '_ensure_share_mounted') as \
                 mock_ensure_share_mounted:
             volume = DumbVolume()
+            volume['id'] = self.VOLUME_UUID
             volume['name'] = 'volume-123'
             volume['provider_location'] = self.TEST_EXPORT1
 
@@ -922,6 +926,7 @@ class GlusterFsDriverTestCase(test.TestCase):
                 mock.patch.object(drv, '_ensure_share_mounted') as \
                 mock_ensure_share_mounted:
             volume = DumbVolume()
+            volume['id'] = self.VOLUME_UUID
             volume['name'] = 'volume-123'
             volume['provider_location'] = None
 
@@ -1513,6 +1518,7 @@ class GlusterFsDriverTestCase(test.TestCase):
                     'status': 'available'}
 
         new_volume = DumbVolume()
+        new_volume['id'] = self.VOLUME_UUID
         new_volume['size'] = snap_ref['size']
 
         with mock.patch.object(drv, '_ensure_shares_mounted') as \