"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/tests/unit/volume/drivers/nec/test_volume.py" between
cinder-15.0.1.tar.gz and cinder-15.1.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 (latest release).

test_volume.py  (cinder-15.0.1):test_volume.py  (cinder-15.1.0)
skipping to change at line 677 skipping to change at line 677
return_value=('success', 0, 0)) return_value=('success', 0, 0))
self.mock_object(self._cli, 'view_all', return_value=xml_out) self.mock_object(self._cli, 'view_all', return_value=xml_out)
self.do_setup(None) self.do_setup(None)
self.xml = xml_out self.xml = xml_out
def test_validate_migrate_volume(self): def test_validate_migrate_volume(self):
vol = DummyVolume("46045673-41e7-44a7-9333-02f07feab04b", 1) vol = DummyVolume("46045673-41e7-44a7-9333-02f07feab04b", 1)
vol.status = 'available' vol.status = 'available'
self._validate_migrate_volume(vol, self.xml) self._validate_migrate_volume(vol, self.xml)
vol.status = 'creating'
with self.assertRaisesRegex(exception.VolumeBackendAPIException,
'Specified Logical Disk'
' LX:287RbQoP7VdwR1WsPC2fZT'
' is not available.'):
self._validate_migrate_volume(vol, self.xml)
vol.id = "AAAAAAAA" vol.id = "AAAAAAAA"
vol.status = 'available' vol.status = 'available'
with self.assertRaisesRegex(exception.NotFound, with self.assertRaisesRegex(exception.NotFound,
'Logical Disk `LX:37mA82`' 'Logical Disk `LX:37mA82`'
' could not be found.'): ' could not be found.'):
self._validate_migrate_volume(vol, self.xml) self._validate_migrate_volume(vol, self.xml)
def test_extend_volume(self): def test_extend_volume(self):
vol = DummyVolume("46045673-41e7-44a7-9333-02f07feab04b", 1) vol = DummyVolume("46045673-41e7-44a7-9333-02f07feab04b", 1)
vol.status = 'available' vol.status = 'available'
skipping to change at line 1392 skipping to change at line 1385
def test_update_migrate_volume(self): def test_update_migrate_volume(self):
newvol = DummyVolume(constants.VOLUME_ID) newvol = DummyVolume(constants.VOLUME_ID)
sourcevol = DummyVolume(constants.VOLUME2_ID) sourcevol = DummyVolume(constants.VOLUME2_ID)
update_data = self.update_migrated_volume(None, sourcevol, update_data = self.update_migrated_volume(None, sourcevol,
newvol, 'available') newvol, 'available')
self.assertIsNone(update_data['_name_id']) self.assertIsNone(update_data['_name_id'])
self.assertIsNone(update_data['provider_location']) self.assertIsNone(update_data['provider_location'])
def test_migrate_volume(self): def test_migrate_volume(self):
vol = DummyVolume(constants.VOLUME2_ID) vol = DummyVolume(constants.VOLUME2_ID)
moved, model_update = self.migrate_volume(None, vol, vol.status = 'available'
self.host) moved, __ = self.migrate_volume(None, vol,
self.host)
self.assertTrue(moved) self.assertTrue(moved)
vol = DummyVolume(constants.VOLUME2_ID)
vol.status = 'in-use'
moved, __ = self.migrate_volume(None, vol,
self.host)
self.assertFalse(moved)
vol.id = "87d8d42f-7550-4f43-9a2b-fe722bf86941" vol.id = "87d8d42f-7550-4f43-9a2b-fe722bf86941"
with self.assertRaisesRegex(exception.NotFound, with self.assertRaisesRegex(exception.NotFound,
'Logical Disk `LX:48L3QCi4npuqxPX0Lyeu8H`' 'Logical Disk `LX:48L3QCi4npuqxPX0Lyeu8H`'
' could not be found.'): ' could not be found.'):
self._validate_migrate_volume(vol, xml_out) self._validate_migrate_volume(vol, xml_out)
vol.id = '46045673-41e7-44a7-9333-02f07feab04b' vol.id = '46045673-41e7-44a7-9333-02f07feab04b'
vol.status = 'creating' vol.status = 'creating'
with self.assertRaisesRegex(exception.VolumeBackendAPIException, moved, __ = self.migrate_volume(None, vol,
'Specified Logical Disk ' self.host)
'LX:287RbQoP7VdwR1WsPC2fZT is ' self.assertFalse(moved)
'not available.'):
self._validate_migrate_volume(vol, xml_out)
vol.id = "92dbc7f4-dbc3-4a87-aef4-d5a2ada3a9af" vol.id = "92dbc7f4-dbc3-4a87-aef4-d5a2ada3a9af"
vol.status = 'available' vol.status = 'available'
with self.assertRaisesRegex(exception.VolumeBackendAPIException, with self.assertRaisesRegex(exception.VolumeBackendAPIException,
r'Specified Logical Disk ' r'Specified Logical Disk '
r'LX:4T7JpyqI3UuPlKeT9D3VQF has an ' r'LX:4T7JpyqI3UuPlKeT9D3VQF has an '
r'invalid attribute ' r'invalid attribute '
r'\(\(invalid attribute\)\).'): r'\(\(invalid attribute\)\).'):
self._validate_migrate_volume(vol, xml_out) self._validate_migrate_volume(vol, xml_out)
skipping to change at line 1456 skipping to change at line 1454
retyped = self.retype(None, vol, new_type, diff, self.host) retyped = self.retype(None, vol, new_type, diff, self.host)
self.assertTrue(retyped) self.assertTrue(retyped)
diff = {'encryption': {}, diff = {'encryption': {},
'qos_specs': {'consumer': (u'back-end', None), 'qos_specs': {'consumer': (u'back-end', None),
u'lowerlimit': (u'1000', u'500'), u'lowerlimit': (u'1000', u'500'),
u'upperlimit': (u'3000', u'2000')}, u'upperlimit': (u'3000', u'2000')},
'extra_specs': {}} 'extra_specs': {}}
retyped = self.retype(None, vol, new_type, diff, self.host) retyped = self.retype(None, vol, new_type, diff, self.host)
self.assertTrue(retyped) self.assertTrue(retyped)
vol.attach_status = 'attached'
diff = {'encryption': {},
'qos_specs': {},
'extra_specs': {u'volume_backend_name': (u'Storage1',
u'Storage2')}}
retyped = self.retype(None, vol, new_type, diff, self.host)
self.assertFalse(retyped)
def test_validate_retype_volume(self): def test_validate_retype_volume(self):
vol = DummyVolume("87d8d42f-7550-4f43-9a2b-fe722bf86941") vol = DummyVolume("87d8d42f-7550-4f43-9a2b-fe722bf86941")
with self.assertRaisesRegex(exception.NotFound, with self.assertRaisesRegex(exception.NotFound,
'Logical Disk `LX:48L3QCi4npuqxPX0Lyeu8H`' 'Logical Disk `LX:48L3QCi4npuqxPX0Lyeu8H`'
' could not be found.'): ' could not be found.'):
self._validate_retype_volume(vol, xml_out) self._validate_retype_volume(vol, xml_out)
vol = DummyVolume("92dbc7f4-dbc3-4a87-aef4-d5a2ada3a9af") vol = DummyVolume("92dbc7f4-dbc3-4a87-aef4-d5a2ada3a9af")
with self.assertRaisesRegex(exception.VolumeBackendAPIException, with self.assertRaisesRegex(exception.VolumeBackendAPIException,
r'Specified Logical Disk ' r'Specified Logical Disk '
 End of changes. 5 change blocks. 
14 lines changed or deleted 20 lines changed or added

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