Merge "[SVF]:Fix create volume on drp"

This commit is contained in:
Zuul 2021-08-17 19:40:55 +00:00 committed by Gerrit Code Review
commit a22c913c79
3 changed files with 48 additions and 4 deletions

View File

@ -5470,6 +5470,45 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
if 'CMMVC7050E' not in e.stderr:
raise
@ddt.data(('yes'), ('Yes'), ('no'), ('NO'), (''))
@mock.patch.object(storwize_svc_common.StorwizeHelpers,
'get_pool_attrs')
def test_build_pool_stats_drp(self, is_drp, get_pool_attrs):
get_pool_attrs.return_value = {'id': 1, 'name': 'openstack',
'data_reduction': is_drp,
'easy_tier': 'on',
'capacity': '20',
'free_capacity': '40',
'used_capacity': '0',
'real_capacity': '0',
'virtual_capacity': '0',
'status': 'online',
'site_id': '1',
'site_name': 'site1'}
pool = 'openstack'
pool_stats = self.driver._build_pool_stats(pool)
if is_drp in ['yes', 'Yes']:
self.assertTrue(pool_stats['data_reduction'])
else:
self.assertFalse(pool_stats['data_reduction'])
@mock.patch.object(storwize_svc_common.StorwizeHelpers,
'get_pool_attrs')
def test_build_pool_stats_drp_none(self, get_pool_attrs):
get_pool_attrs.return_value = {'id': 1, 'name': 'openstack1',
'easy_tier': 'on',
'capacity': '20',
'free_capacity': '40',
'used_capacity': '0',
'real_capacity': '0',
'virtual_capacity': '0',
'status': 'online',
'site_id': '1',
'site_name': 'site1'}
pool = 'openstack1'
pool_stats = self.driver._build_pool_stats(pool)
self.assertFalse(pool_stats['data_reduction'])
@ddt.data(('IOPs_limit', "50"), ('bandwidth_limit_MB', "100"))
@mock.patch.object(storwize_svc_common.StorwizeHelpers, 'get_pool_volumes')
@mock.patch.object(storwize_svc_common.StorwizeSSH, 'lsthrottle')

View File

@ -6090,10 +6090,8 @@ class StorwizeSVCCommonDriver(san.SanDriver,
# Get the data_reduction information for pool and set
# is_dr_pool flag.
if pool_data.get('data_reduction') == 'Yes':
is_dr_pool = True
elif pool_data.get('data_reduction') == 'No':
is_dr_pool = False
if pool_data.get('data_reduction'):
is_dr_pool = pool_data.get('data_reduction').lower() == 'yes'
pool_stats = {
'pool_name': pool_data['name'],

View File

@ -0,0 +1,7 @@
---
fixes:
- |
IBM Spectrum Virtualize Family driver
`Bug #1924568 <https://bugs.launchpad.net/cinder/+bug/1924568>`_:
Fixed issues that occurred while creating volume on data reduction
pool.