"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/volume/drivers/solidfire/test_solidfire.py" between
cinder-15.4.1.tar.gz and cinder-15.5.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Train" series (maintained release).

test_solidfire.py  (cinder-15.4.1):test_solidfire.py  (cinder-15.5.0)
skipping to change at line 180 skipping to change at line 180
self.mvip = '192.168.139.102' self.mvip = '192.168.139.102'
self.svip = '10.10.8.134' self.svip = '10.10.8.134'
self.fake_sfsnap_name = '%s%s' % (self.configuration.sf_volume_prefix, self.fake_sfsnap_name = '%s%s' % (self.configuration.sf_volume_prefix,
self.snap.id) self.snap.id)
self.fake_sfsnaps = [{'snapshotID': '5', self.fake_sfsnaps = [{'snapshotID': '5',
'name': self.fake_sfsnap_name, 'name': self.fake_sfsnap_name,
'volumeID': 6}] 'volumeID': 6}]
def fake_issue_api_request(self, method, params, version='1.0', def fake_issue_api_request(self, method, params, version='1.0',
endpoint=None): endpoint=None, timeout=None):
if method is 'GetClusterCapacity': if method == 'GetClusterCapacity':
data = {} data = {}
if version == '1.0': if version == '1.0':
data = {'result': {'clusterCapacity': { data = {'result': {'clusterCapacity': {
'maxProvisionedSpace': 107374182400, 'maxProvisionedSpace': 107374182400,
'usedSpace': 1073741824, 'usedSpace': 1073741824,
'compressionPercent': 100, 'compressionPercent': 100,
'deDuplicationPercent': 100, 'deDuplicationPercent': 100,
'thinProvisioningPercent': 100, 'thinProvisioningPercent': 100,
'maxUsedSpace': 53687091200}}} 'maxUsedSpace': 53687091200}}}
elif version == '8.0': elif version == '8.0':
skipping to change at line 329 skipping to change at line 329
'name': test_name, 'name': test_name,
'accountID': 8, 'accountID': 8,
'sliceCount': 1, 'sliceCount': 1,
'totalSize': int(1.75 * units.Gi), 'totalSize': int(1.75 * units.Gi),
'enable512e': True, 'enable512e': True,
'access': "readWrite", 'access': "readWrite",
'status': "active", 'status': "active",
'attributes': {'uuid': f_uuid[1]}, 'attributes': {'uuid': f_uuid[1]},
'qos': None, 'qos': None,
'iqn': test_name}]}} 'iqn': test_name}]}}
if params and params['startVolumeID']: if params and params.get('startVolumeID', None):
volumes = result['result']['volumes'] volumes = result['result']['volumes']
selected_volumes = [v for v in volumes if v.get('volumeID') selected_volumes = [v for v in volumes if v.get('volumeID') !=
!= params['startVolumeID']] params['startVolumeID']]
result['result']['volumes'] = selected_volumes result['result']['volumes'] = selected_volumes
else:
result = {'result': {'volumes': []}}
return result return result
elif method is 'DeleteSnapshot': elif method is 'DeleteSnapshot':
return {'result': {}} return {'result': {}}
elif method is 'GetClusterVersionInfo': elif method is 'GetClusterVersionInfo':
return {'result': {'clusterAPIVersion': '8.0'}} return {'result': {'clusterAPIVersion': '8.0'}}
elif method is 'StartVolumePairing': elif method is 'StartVolumePairing':
return {'result': {'volumePairingKey': 'fake-pairing-key'}} return {'result': {'volumePairingKey': 'fake-pairing-key'}}
elif method is 'RollbackToSnapshot': elif method is 'RollbackToSnapshot':
return { return {
"id": 1, "id": 1,
skipping to change at line 597 skipping to change at line 600
'volume_type_id': None, 'volume_type_id': None,
'created_at': timeutils.utcnow()} 'created_at': timeutils.utcnow()}
updates_vol_b = {'project_id': 'testprjid', updates_vol_b = {'project_id': 'testprjid',
'name': 'testvol', 'name': 'testvol',
'size': 1, 'size': 1,
'id': 'b831c4d1-d1f0-11e1-9b23-0800200c9a66', 'id': 'b831c4d1-d1f0-11e1-9b23-0800200c9a66',
'volume_type_id': None, 'volume_type_id': None,
'created_at': timeutils.utcnow()} 'created_at': timeutils.utcnow()}
fake_model_info = {
'provider_id': '%s %s cluster-id-01' % (
self.fake_sfvol['volumeID'],
self.fake_sfaccount['accountID'])
}
ctx = context.get_admin_context() ctx = context.get_admin_context()
testvol = fake_volume.fake_volume_obj(ctx, **updates_vol_a) testvol = fake_volume.fake_volume_obj(ctx, **updates_vol_a)
testvol_b = fake_volume.fake_volume_obj(ctx, **updates_vol_b) testvol_b = fake_volume.fake_volume_obj(ctx, **updates_vol_b)
sfv = solidfire.SolidFireDriver(configuration=self.configuration) sfv = solidfire.SolidFireDriver(configuration=self.configuration)
with mock.patch.object(sfv, with mock.patch.object(sfv,
'_get_sf_snapshots', '_get_sf_snapshots',
return_value=_fake_get_snaps), \ return_value=_fake_get_snaps), \
mock.patch.object(sfv, mock.patch.object(sfv,
'_get_sf_volume', '_get_sf_volume',
return_value=_fake_get_volume), \ return_value=_fake_get_volume), \
mock.patch.object(sfv, mock.patch.object(sfv,
'_issue_api_request', '_issue_api_request',
side_effect=self.fake_issue_api_request), \ side_effect=self.fake_issue_api_request), \
mock.patch.object(sfv, mock.patch.object(sfv,
'_get_sfaccounts_for_tenant', '_get_sfaccounts_for_tenant',
return_value=[]), \ return_value=[]), \
mock.patch.object(sfv, mock.patch.object(sfv,
'_get_model_info', '_get_model_info',
return_value={}): return_value=fake_model_info):
sfv.create_cloned_volume(testvol_b, testvol) sfv.create_cloned_volume(testvol_b, testvol)
def test_initialize_connector_with_blocksizes(self): def test_initialize_connector_with_blocksizes(self):
connector = {'initiator': 'iqn.2012-07.org.fake:01'} connector = {'initiator': 'iqn.2012-07.org.fake:01'}
testvol = {'project_id': 'testprjid', testvol = {'project_id': 'testprjid',
'name': 'testvol', 'name': 'testvol',
'size': 1, 'size': 1,
'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66', 'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66',
'volume_type_id': None, 'volume_type_id': None,
'provider_location': '10.10.7.1:3260 iqn.2010-01.com.' 'provider_location': '10.10.7.1:3260 iqn.2010-01.com.'
skipping to change at line 2948 skipping to change at line 2957
ctx = context.get_admin_context() ctx = context.get_admin_context()
vol_fields = {'updated_at': timeutils.utcnow(), vol_fields = {'updated_at': timeutils.utcnow(),
'created_at': timeutils.utcnow()} 'created_at': timeutils.utcnow()}
src_vol = fake_volume.fake_volume_obj(ctx) src_vol = fake_volume.fake_volume_obj(ctx)
dst_vol = fake_volume.fake_volume_obj(ctx, **vol_fields) dst_vol = fake_volume.fake_volume_obj(ctx, **vol_fields)
mock_create_cluster_reference.return_value = { mock_create_cluster_reference.return_value = {
'mvip': self.mvip, 'mvip': self.mvip,
'svip': self.svip} 'svip': self.svip}
self.configuration.sf_volume_clone_timeout = 1
sfv = solidfire.SolidFireDriver(configuration=self.configuration) sfv = solidfire.SolidFireDriver(configuration=self.configuration)
sfv.replication_enabled = False sfv.replication_enabled = False
reset_mocks() reset_mocks()
mock_issue_api_request.return_value = { mock_issue_api_request.return_value = {
'error': {'code': 000, 'name': 'DummyError', 'error': {'code': 000, 'name': 'DummyError',
'message': 'This is a fake error response'}, 'message': 'This is a fake error response'},
'id': 1} 'id': 1}
self.assertRaises(solidfire.SolidFireAPIException, self.assertRaises(solidfire.SolidFireAPIException,
skipping to change at line 2992 skipping to change at line 3002
self.assertRaises(solidfire.SolidFireAPIException, self.assertRaises(solidfire.SolidFireAPIException,
sfv._do_clone_volume, src_vol.id, sfv._do_clone_volume, src_vol.id,
dst_vol, sf_src_snap=self.fake_sfsnaps[0]) dst_vol, sf_src_snap=self.fake_sfsnaps[0])
mock_get_create_account.assert_called_with(dst_vol.project_id) mock_get_create_account.assert_called_with(dst_vol.project_id)
calls = [mock.call('CloneVolume', clone_vol_params, version='6.0'), calls = [mock.call('CloneVolume', clone_vol_params, version='6.0'),
mock.call('ModifyVolume', {'volumeID': 6})] mock.call('ModifyVolume', {'volumeID': 6})]
mock_issue_api_request.assert_has_calls(calls) mock_issue_api_request.assert_has_calls(calls)
mock_test_set_cluster_pairs.assert_not_called() mock_test_set_cluster_pairs.assert_not_called()
mock_update_attributes.assert_not_called() mock_update_attributes.assert_not_called()
mock_get_model_info.assert_called_once() mock_get_model_info.assert_called()
mock_snapshot_discovery.assert_not_called() mock_snapshot_discovery.assert_not_called()
reset_mocks() reset_mocks()
mock_retrieve_replication_settings.return_value = 'Async' mock_retrieve_replication_settings.return_value = 'Async'
update = {'replication_status': fields.ReplicationStatus.ENABLED} update = {'replication_status': fields.ReplicationStatus.ENABLED}
mock_replicate_volume.side_effect = solidfire.SolidFireDriverException mock_replicate_volume.side_effect = solidfire.SolidFireDriverException
mock_update_attributes.return_value = {'result': {}, 'id': 1} mock_update_attributes.return_value = {'result': {}, 'id': 1}
mock_get_model_info.return_value = { mock_get_model_info.return_value = {
'provider_location': '1.1.1.1 iqn 0', 'provider_location': '1.1.1.1 iqn 0',
'provider_auth': 'CHAP stack-1-a60e2611875f40199931f2c76370d66b ' 'provider_auth': 'CHAP stack-1-a60e2611875f40199931f2c76370d66b '
 End of changes. 8 change blocks. 
7 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)