"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "manila/tests/share/test_driver.py" between
manila-8.1.3.tar.gz and manila-8.1.4.tar.gz

About: OpenStack Manila provides “Shared Filesystems as a service”.
The "Stein" series (maintained release).

test_driver.py  (manila-8.1.3):test_driver.py  (manila-8.1.4)
skipping to change at line 808 skipping to change at line 808
self.assertIsNone(share_group_update) self.assertIsNone(share_group_update)
self.assertIsNone(share_update) self.assertIsNone(share_update)
def test_create_share_group_snapshot(self): def test_create_share_group_snapshot(self):
fake_snap_member_1 = { fake_snap_member_1 = {
'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e', 'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1', 'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'should_not_be_used_1', 'provider_location': 'should_not_be_used_1',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3, 'size': 3,
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_member_2 = { fake_snap_member_2 = {
'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89', 'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2', 'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'should_not_be_used_2', 'provider_location': 'should_not_be_used_2',
'share_name': 'share_fake_share_instance_id_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2', 'size': '2',
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_dict = { fake_snap_dict = {
'status': 'available', 'status': 'available',
'project_id': '13c0be6290934bd98596cfa004650049', 'project_id': '13c0be6290934bd98596cfa004650049',
'user_id': 'a0314a441ca842019b0952224aa39192', 'user_id': 'a0314a441ca842019b0952224aa39192',
skipping to change at line 858 skipping to change at line 862
'fake_context', fake_snap_dict)) 'fake_context', fake_snap_dict))
mock_create_snap.assert_has_calls([ mock_create_snap.assert_has_calls([
mock.call( mock.call(
'fake_context', 'fake_context',
{'snapshot_id': member['share_group_snapshot_id'], {'snapshot_id': member['share_group_snapshot_id'],
'share_id': member['share_id'], 'share_id': member['share_id'],
'share_instance_id': member['share']['id'], 'share_instance_id': member['share']['id'],
'id': member['id'], 'id': member['id'],
'share': member['share'], 'share': member['share'],
'share_name': member['share_name'],
'name': member['name'],
'size': member['share']['size'], 'size': member['share']['size'],
'share_size': member['share']['size'], 'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'], 'share_proto': member['share']['share_proto'],
'provider_location': None}, 'provider_location': None},
share_server=None) share_server=None)
for member in (fake_snap_member_1, fake_snap_member_2) for member in (fake_snap_member_1, fake_snap_member_2)
]) ])
self.assertIsNone(share_group_snapshot_update) self.assertIsNone(share_group_snapshot_update)
self.assertEqual( self.assertEqual(
[{'id': member['id'], 'foo_k': 'foo_v', [{'id': member['id'], 'foo_k': 'foo_v',
skipping to change at line 880 skipping to change at line 886
member_update_list, member_update_list,
) )
def test_create_share_group_snapshot_failed_snapshot(self): def test_create_share_group_snapshot_failed_snapshot(self):
fake_snap_member_1 = { fake_snap_member_1 = {
'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e', 'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1', 'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'should_not_be_used_1', 'provider_location': 'should_not_be_used_1',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3, 'size': 3,
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_member_2 = { fake_snap_member_2 = {
'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89', 'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2', 'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'should_not_be_used_2', 'provider_location': 'should_not_be_used_2',
'share_name': 'share_fake_share_instance_id_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2', 'size': '2',
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_dict = { fake_snap_dict = {
'status': 'available', 'status': 'available',
'project_id': '13c0be6290934bd98596cfa004650049', 'project_id': '13c0be6290934bd98596cfa004650049',
'user_id': 'a0314a441ca842019b0952224aa39192', 'user_id': 'a0314a441ca842019b0952224aa39192',
skipping to change at line 931 skipping to change at line 941
expected_exception, expected_exception,
share_driver.create_share_group_snapshot, share_driver.create_share_group_snapshot,
'fake_context', fake_snap_dict) 'fake_context', fake_snap_dict)
fake_snap_member_1_expected = { fake_snap_member_1_expected = {
'snapshot_id': fake_snap_member_1['share_group_snapshot_id'], 'snapshot_id': fake_snap_member_1['share_group_snapshot_id'],
'share_id': fake_snap_member_1['share_id'], 'share_id': fake_snap_member_1['share_id'],
'share_instance_id': fake_snap_member_1['share']['id'], 'share_instance_id': fake_snap_member_1['share']['id'],
'id': fake_snap_member_1['id'], 'id': fake_snap_member_1['id'],
'share': fake_snap_member_1['share'], 'share': fake_snap_member_1['share'],
'share_name': fake_snap_member_1['share_name'],
'name': fake_snap_member_1['name'],
'size': fake_snap_member_1['share']['size'], 'size': fake_snap_member_1['share']['size'],
'share_size': fake_snap_member_1['share']['size'], 'share_size': fake_snap_member_1['share']['size'],
'share_proto': fake_snap_member_1['share']['share_proto'], 'share_proto': fake_snap_member_1['share']['share_proto'],
'provider_location': None, 'provider_location': None,
} }
mock_create_snap.assert_has_calls([ mock_create_snap.assert_has_calls([
mock.call( mock.call(
'fake_context', 'fake_context',
{'snapshot_id': member['share_group_snapshot_id'], {'snapshot_id': member['share_group_snapshot_id'],
'share_id': member['share_id'], 'share_id': member['share_id'],
'share_instance_id': member['share']['id'], 'share_instance_id': member['share']['id'],
'id': member['id'], 'id': member['id'],
'share': member['share'], 'share': member['share'],
'share_name': member['share_name'],
'name': member['name'],
'size': member['share']['size'], 'size': member['share']['size'],
'share_size': member['share']['size'], 'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'], 'share_proto': member['share']['share_proto'],
'provider_location': None}, 'provider_location': None},
share_server=None) share_server=None)
for member in (fake_snap_member_1, fake_snap_member_2) for member in (fake_snap_member_1, fake_snap_member_2)
]) ])
mock_delete_snap.assert_called_with( mock_delete_snap.assert_called_with(
'fake_context', fake_snap_member_1_expected, share_server=None) 'fake_context', fake_snap_member_1_expected, share_server=None)
skipping to change at line 1019 skipping to change at line 1033
self.assertIsNone(share_group_snapshot_update) self.assertIsNone(share_group_snapshot_update)
self.assertIsNone(member_update_list) self.assertIsNone(member_update_list)
def test_delete_share_group_snapshot(self): def test_delete_share_group_snapshot(self):
fake_snap_member_1 = { fake_snap_member_1 = {
'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e', 'id': '6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1', 'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'fake_provider_location_2', 'provider_location': 'fake_provider_location_2',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3, 'size': 3,
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_member_2 = { fake_snap_member_2 = {
'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89', 'id': '1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296', 'share_id': 'a3ebdba5-b4e1-46c8-a0ea-a9ac8daf5296',
'share_group_snapshot_id': 'fake_share_group_snapshot_id', 'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2', 'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'fake_provider_location_2', 'provider_location': 'fake_provider_location_2',
'share_name': 'share_fake_provider_location_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': { 'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2', 'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2', 'size': '2',
'share_proto': 'fake_share_proto', 'share_proto': 'fake_share_proto',
}, },
} }
fake_snap_dict = { fake_snap_dict = {
'status': 'available', 'status': 'available',
'project_id': '13c0be6290934bd98596cfa004650049', 'project_id': '13c0be6290934bd98596cfa004650049',
'user_id': 'a0314a441ca842019b0952224aa39192', 'user_id': 'a0314a441ca842019b0952224aa39192',
skipping to change at line 1069 skipping to change at line 1087
mock_delete_snap.assert_has_calls([ mock_delete_snap.assert_has_calls([
mock.call( mock.call(
'fake_context', 'fake_context',
{'snapshot_id': member['share_group_snapshot_id'], {'snapshot_id': member['share_group_snapshot_id'],
'share_id': member['share_id'], 'share_id': member['share_id'],
'share_instance_id': member['share']['id'], 'share_instance_id': member['share']['id'],
'id': member['id'], 'id': member['id'],
'share': member['share'], 'share': member['share'],
'size': member['share']['size'], 'size': member['share']['size'],
'share_size': member['share']['size'], 'share_size': member['share']['size'],
'share_name': member['share_name'],
'name': member['name'],
'share_proto': member['share']['share_proto'], 'share_proto': member['share']['share_proto'],
'provider_location': member['provider_location']}, 'provider_location': member['provider_location']},
share_server=None) share_server=None)
for member in (fake_snap_member_1, fake_snap_member_2) for member in (fake_snap_member_1, fake_snap_member_2)
]) ])
self.assertIsNone(share_group_snapshot_update) self.assertIsNone(share_group_snapshot_update)
self.assertIsNone(member_update_list) self.assertIsNone(member_update_list)
def test_snapshot_update_access(self): def test_snapshot_update_access(self):
share_driver = self._instantiate_share_driver(None, False) share_driver = self._instantiate_share_driver(None, False)
 End of changes. 10 change blocks. 
0 lines changed or deleted 20 lines changed or added

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