"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/volume/test_connection.py" between
cinder-13.0.2.tar.gz and cinder-13.0.3.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 "Rocky" series (latest release).

test_connection.py  (cinder-13.0.2):test_connection.py  (cinder-13.0.3)
skipping to change at line 193 skipping to change at line 193
**_fake_volume) **_fake_volume)
_mock_volume_get.return_value = _fake_volume _mock_volume_get.return_value = _fake_volume
_mock_volume_update.return_value = _fake_volume _mock_volume_update.return_value = _fake_volume
_mock_volume_admin_metadata_get.return_value = { _mock_volume_admin_metadata_get.return_value = {
'fake-key': 'fake-value'} 'fake-key': 'fake-value'}
connector = {'ip': 'IP', 'initiator': 'INITIATOR'} connector = {'ip': 'IP', 'initiator': 'INITIATOR'}
qos_values = {'consumer': 'front-end', qos_values = {'consumer': 'front-end',
'specs': { 'specs': {
'write_iops_sec_per_gb': 5, 'write_iops_sec_per_gb': 30,
'read_iops_sec_per_gb': 7700, 'read_iops_sec_per_gb': 7700,
'total_iops_sec_per_gb': 300000, 'total_iops_sec_per_gb': 300000,
'read_bytes_sec_per_gb': 10, 'read_bytes_sec_per_gb': 10,
'write_bytes_sec_per_gb': 40, 'write_bytes_sec_per_gb': 40,
'total_bytes_sec_per_gb': 1048576} 'total_bytes_sec_per_gb': 1048576}
} }
with mock.patch.object(cinder.volume.volume_types, with mock.patch.object(cinder.volume.volume_types,
'get_volume_type_qos_specs') as type_qos, \ 'get_volume_type_qos_specs') as type_qos, \
mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver, mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver,
'initialize_connection') as driver_init: 'initialize_connection') as driver_init:
type_qos.return_value = dict(qos_specs=qos_values) type_qos.return_value = dict(qos_specs=qos_values)
driver_init.return_value = {'data': {}} driver_init.return_value = {'data': {}}
mock_get_target.return_value = None mock_get_target.return_value = None
qos_specs_expected = {'write_iops_sec': 15, qos_specs_expected = {'write_iops_sec': 90,
'read_iops_sec': 23100, 'read_iops_sec': 23100,
'total_iops_sec': 900000, 'total_iops_sec': 900000,
'read_bytes_sec': 30, 'read_bytes_sec': 30,
'write_bytes_sec': 120, 'write_bytes_sec': 120,
'total_bytes_sec': 3145728} 'total_bytes_sec': 3145728}
# initialize_connection() passes qos_specs that is designated to # initialize_connection() passes qos_specs that is designated to
# be consumed by front-end or both front-end and back-end # be consumed by front-end or both front-end and back-end
conn_info = self.volume.initialize_connection( conn_info = self.volume.initialize_connection(
self.context, fake_volume_obj, connector,) self.context, fake_volume_obj, connector,)
self.assertDictEqual(qos_specs_expected, self.assertDictEqual(qos_specs_expected,
skipping to change at line 254 skipping to change at line 254
**_fake_volume) **_fake_volume)
_mock_volume_get.return_value = _fake_volume _mock_volume_get.return_value = _fake_volume
_mock_volume_update.return_value = _fake_volume _mock_volume_update.return_value = _fake_volume
_mock_volume_admin_metadata_get.return_value = { _mock_volume_admin_metadata_get.return_value = {
'fake-key': 'fake-value'} 'fake-key': 'fake-value'}
connector = {'ip': 'IP', 'initiator': 'INITIATOR'} connector = {'ip': 'IP', 'initiator': 'INITIATOR'}
qos_values = {'consumer': 'front-end', qos_values = {'consumer': 'front-end',
'specs': { 'specs': {
'write_iops_sec_per_gb_min': 15, 'write_iops_sec_per_gb_min': 800,
'write_iops_sec_per_gb': 5, 'write_iops_sec_per_gb': 30,
'read_iops_sec_per_gb_min': 23100, 'read_iops_sec_per_gb_min': 23100,
'read_iops_sec_per_gb': 7700, 'read_iops_sec_per_gb': 7700,
'total_iops_sec_per_gb_min': 900000, 'total_iops_sec_per_gb_min': 900000,
'total_iops_sec_per_gb': 300000, 'total_iops_sec_per_gb': 300000,
'total_iops_sec_max': 15000000,
'read_bytes_sec_per_gb_min': 30, 'read_bytes_sec_per_gb_min': 30,
'read_bytes_sec_per_gb': 10, 'read_bytes_sec_per_gb': 10,
'write_bytes_sec_per_gb_min': 120, 'write_bytes_sec_per_gb_min': 120,
'write_bytes_sec_per_gb': 40, 'write_bytes_sec_per_gb': 40,
'total_bytes_sec_per_gb_min': 3145728, 'total_bytes_sec_per_gb_min': 3145728,
'total_bytes_sec_per_gb': 1048576} 'total_bytes_sec_per_gb': 1048576}
} }
with mock.patch.object(cinder.volume.volume_types, with mock.patch.object(cinder.volume.volume_types,
'get_volume_type_qos_specs') as type_qos, \ 'get_volume_type_qos_specs') as type_qos, \
mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver, mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver,
'initialize_connection') as driver_init: 'initialize_connection') as driver_init:
type_qos.return_value = dict(qos_specs=qos_values) type_qos.return_value = dict(qos_specs=qos_values)
driver_init.return_value = {'data': {}} driver_init.return_value = {'data': {}}
mock_get_target.return_value = None mock_get_target.return_value = None
qos_specs_expected = {'write_iops_sec': 15, qos_specs_expected = {'write_iops_sec': 800,
'read_iops_sec': 23100, 'read_iops_sec': 23100,
'total_iops_sec': 900000, 'total_iops_sec': 900000,
'read_bytes_sec': 30, 'read_bytes_sec': 30,
'write_bytes_sec': 120, 'write_bytes_sec': 120,
'total_bytes_sec': 3145728} 'total_bytes_sec': 3145728}
# initialize_connection() passes qos_specs that is designated to # initialize_connection() passes qos_specs that is designated to
# be consumed by front-end or both front-end and back-end # be consumed by front-end or both front-end and back-end
conn_info = self.volume.initialize_connection( conn_info = self.volume.initialize_connection(
self.context, fake_volume_obj, connector,) self.context, fake_volume_obj, connector,)
self.assertDictEqual(qos_specs_expected, self.assertDictEqual(qos_specs_expected,
skipping to change at line 321 skipping to change at line 322
**_fake_volume) **_fake_volume)
_mock_volume_get.return_value = _fake_volume _mock_volume_get.return_value = _fake_volume
_mock_volume_update.return_value = _fake_volume _mock_volume_update.return_value = _fake_volume
_mock_volume_admin_metadata_get.return_value = { _mock_volume_admin_metadata_get.return_value = {
'fake-key': 'fake-value'} 'fake-key': 'fake-value'}
connector = {'ip': 'IP', 'initiator': 'INITIATOR'} connector = {'ip': 'IP', 'initiator': 'INITIATOR'}
qos_values = {'consumer': 'front-end', qos_values = {'consumer': 'front-end',
'specs': { 'specs': {
'write_iops_sec_per_gb_min': 15, 'write_iops_sec_per_gb_min': 800,
'write_iops_sec_per_gb': 5, 'write_iops_sec_per_gb': 30,
'read_iops_sec_per_gb_min': 23100, 'read_iops_sec_per_gb_min': 23100,
'read_iops_sec_per_gb': 7700, 'read_iops_sec_per_gb': 7700,
'total_iops_sec_per_gb_min': 900000, 'total_iops_sec_per_gb_min': 900000,
'total_iops_sec_per_gb': 300000, 'total_iops_sec_per_gb': 300000,
'total_iops_sec_max': 15000000,
'read_bytes_sec_per_gb_min': 30, 'read_bytes_sec_per_gb_min': 30,
'read_bytes_sec_per_gb': 10, 'read_bytes_sec_per_gb': 10,
'write_bytes_sec_per_gb_min': 120, 'write_bytes_sec_per_gb_min': 120,
'write_bytes_sec_per_gb': 40, 'write_bytes_sec_per_gb': 40,
'total_bytes_sec_per_gb_min': 3145728, 'total_bytes_sec_per_gb_min': 3145728,
'total_bytes_sec_per_gb': 1048576} 'total_bytes_sec_per_gb': 1048576}
} }
with mock.patch.object(cinder.volume.volume_types, with mock.patch.object(cinder.volume.volume_types,
'get_volume_type_qos_specs') as type_qos, \ 'get_volume_type_qos_specs') as type_qos, \
mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver, mock.patch.object(cinder.tests.fake_driver.FakeLoggingVolumeDriver,
'initialize_connection') as driver_init: 'initialize_connection') as driver_init:
type_qos.return_value = dict(qos_specs=qos_values) type_qos.return_value = dict(qos_specs=qos_values)
driver_init.return_value = {'data': {}} driver_init.return_value = {'data': {}}
mock_get_target.return_value = None mock_get_target.return_value = None
qos_specs_expected = {'write_iops_sec': 500, qos_specs_expected = {'write_iops_sec': 3000,
'read_iops_sec': 770000, 'read_iops_sec': 770000,
'total_iops_sec': 30000000, 'total_iops_sec': 15000000,
'read_bytes_sec': 1000, 'read_bytes_sec': 1000,
'write_bytes_sec': 4000, 'write_bytes_sec': 4000,
'total_bytes_sec': 104857600} 'total_bytes_sec': 104857600}
# initialize_connection() passes qos_specs that is designated to # initialize_connection() passes qos_specs that is designated to
# be consumed by front-end or both front-end and back-end # be consumed by front-end or both front-end and back-end
conn_info = self.volume.initialize_connection( conn_info = self.volume.initialize_connection(
self.context, fake_volume_obj, connector,) self.context, fake_volume_obj, connector,)
self.assertDictEqual(qos_specs_expected, self.assertDictEqual(qos_specs_expected,
conn_info['data']['qos_specs']) conn_info['data']['qos_specs'])
 End of changes. 9 change blocks. 
9 lines changed or deleted 11 lines changed or added

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