summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-19 12:10:27 +0000
committerGerrit Code Review <review@openstack.org>2017-06-19 12:10:27 +0000
commitd89deddcaa13f657608078141c38988a6e46f245 (patch)
tree70de779a0b39a9f13b3b0a4d724e359cb1ddd2be
parente2216e5e5ca41b468d762221b00f6a6cef8a37c4 (diff)
parent341161eead565af4a0eafbd030e59007bbe63011 (diff)
Merge "Use parenthesis instead of backslashes in tests folder"
-rw-r--r--manila/tests/api/v1/test_share_types_extra_specs.py16
-rw-r--r--manila/tests/api/v1/test_share_unmanage.py8
-rw-r--r--manila/tests/api/v2/test_availability_zones.py4
-rw-r--r--manila/tests/api/v2/test_quota_sets.py4
-rw-r--r--manila/tests/api/v2/test_share_networks.py20
-rw-r--r--manila/tests/api/v2/test_share_types.py4
-rw-r--r--manila/tests/api/v2/test_shares.py8
-rw-r--r--manila/tests/compute/test_nova.py20
-rw-r--r--manila/tests/db/sqlalchemy/test_api.py21
-rw-r--r--manila/tests/network/test_standalone_network_plugin.py8
-rw-r--r--manila/tests/scheduler/drivers/test_base.py4
-rw-r--r--manila/tests/scheduler/test_host_manager.py6
-rw-r--r--manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon.py12
-rw-r--r--manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon_api.py8
-rw-r--r--manila/tests/share/drivers/glusterfs/test_layout_directory.py24
-rw-r--r--manila/tests/share/drivers/hdfs/test_hdfs_native.py6
-rw-r--r--manila/tests/share/drivers/huawei/test_huawei_nas.py38
-rw-r--r--manila/tests/share/drivers/ibm/test_gpfs.py24
-rw-r--r--manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py16
-rw-r--r--manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py8
-rw-r--r--manila/tests/share/drivers/test_generic.py80
-rw-r--r--manila/tests/share/drivers/test_glusterfs.py4
-rw-r--r--manila/tests/share/drivers/test_helpers.py8
-rw-r--r--manila/tests/share/drivers/test_service_instance.py76
-rw-r--r--manila/tests/share/test_api.py12
-rw-r--r--manila/tests/share/test_driver.py4
-rw-r--r--manila/tests/share/test_manager.py99
-rw-r--r--manila/tests/test_manager.py4
-rw-r--r--manila/tests/volume/test_cinder.py8
29 files changed, 278 insertions, 276 deletions
diff --git a/manila/tests/api/v1/test_share_types_extra_specs.py b/manila/tests/api/v1/test_share_types_extra_specs.py
index e84cf54..983ed61 100644
--- a/manila/tests/api/v1/test_share_types_extra_specs.py
+++ b/manila/tests/api/v1/test_share_types_extra_specs.py
@@ -225,9 +225,9 @@ class ShareTypesExtraSpecsTest(test.TestCase):
225 for k, v in data.items(): 225 for k, v in data.items():
226 self.assertIn(k, res_dict['extra_specs']) 226 self.assertIn(k, res_dict['extra_specs'])
227 self.assertEqual(v, res_dict['extra_specs'][k]) 227 self.assertEqual(v, res_dict['extra_specs'][k])
228 manila.db.share_type_extra_specs_update_or_create.\ 228 (manila.db.share_type_extra_specs_update_or_create.
229 assert_called_once_with( 229 assert_called_once_with(
230 req.environ['manila.context'], 1, body['extra_specs']) 230 req.environ['manila.context'], 1, body['extra_specs']))
231 self.mock_policy_check.assert_called_once_with( 231 self.mock_policy_check.assert_called_once_with(
232 req_context, self.resource_name, 'create') 232 req_context, self.resource_name, 'create')
233 233
@@ -277,9 +277,9 @@ class ShareTypesExtraSpecsTest(test.TestCase):
277 self.assertEqual(1, len(fake_notifier.NOTIFICATIONS)) 277 self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))
278 self.assertEqual(mock_return_value['key1'], 278 self.assertEqual(mock_return_value['key1'],
279 res_dict['extra_specs']['other_alphanum.-_:']) 279 res_dict['extra_specs']['other_alphanum.-_:'])
280 manila.db.share_type_extra_specs_update_or_create.\ 280 (manila.db.share_type_extra_specs_update_or_create.
281 assert_called_once_with( 281 assert_called_once_with(
282 req.environ['manila.context'], 1, body['extra_specs']) 282 req.environ['manila.context'], 1, body['extra_specs']))
283 self.mock_policy_check.assert_called_once_with( 283 self.mock_policy_check.assert_called_once_with(
284 req_context, self.resource_name, 'create') 284 req_context, self.resource_name, 'create')
285 285
@@ -312,8 +312,8 @@ class ShareTypesExtraSpecsTest(test.TestCase):
312 res_dict['extra_specs']['other2_alphanum.-_:']) 312 res_dict['extra_specs']['other2_alphanum.-_:'])
313 self.assertEqual(mock_return_value['key3'], 313 self.assertEqual(mock_return_value['key3'],
314 res_dict['extra_specs']['other3_alphanum.-_:']) 314 res_dict['extra_specs']['other3_alphanum.-_:'])
315 manila.db.share_type_extra_specs_update_or_create.\ 315 (manila.db.share_type_extra_specs_update_or_create.
316 assert_called_once_with(req_context, 1, body['extra_specs']) 316 assert_called_once_with(req_context, 1, body['extra_specs']))
317 self.mock_policy_check.assert_called_once_with( 317 self.mock_policy_check.assert_called_once_with(
318 req_context, self.resource_name, 'create') 318 req_context, self.resource_name, 'create')
319 319
@@ -332,8 +332,8 @@ class ShareTypesExtraSpecsTest(test.TestCase):
332 332
333 self.assertEqual(1, len(fake_notifier.NOTIFICATIONS)) 333 self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))
334 self.assertTrue(res_dict[DRIVER_HANDLES_SHARE_SERVERS]) 334 self.assertTrue(res_dict[DRIVER_HANDLES_SHARE_SERVERS])
335 manila.db.share_type_extra_specs_update_or_create.\ 335 (manila.db.share_type_extra_specs_update_or_create.
336 assert_called_once_with(req_context, 1, body) 336 assert_called_once_with(req_context, 1, body))
337 self.mock_policy_check.assert_called_once_with( 337 self.mock_policy_check.assert_called_once_with(
338 req_context, self.resource_name, 'update') 338 req_context, self.resource_name, 'update')
339 339
diff --git a/manila/tests/api/v1/test_share_unmanage.py b/manila/tests/api/v1/test_share_unmanage.py
index 6f9490f..727b3b9 100644
--- a/manila/tests/api/v1/test_share_unmanage.py
+++ b/manila/tests/api/v1/test_share_unmanage.py
@@ -63,9 +63,9 @@ class ShareUnmanageTest(test.TestCase):
63 actual_result = self.controller.unmanage(self.request, share['id']) 63 actual_result = self.controller.unmanage(self.request, share['id'])
64 64
65 self.assertEqual(202, actual_result.status_int) 65 self.assertEqual(202, actual_result.status_int)
66 self.controller.share_api.db.share_snapshot_get_all_for_share.\ 66 (self.controller.share_api.db.share_snapshot_get_all_for_share.
67 assert_called_once_with( 67 assert_called_once_with(
68 self.request.environ['manila.context'], share['id']) 68 self.request.environ['manila.context'], share['id']))
69 self.controller.share_api.get.assert_called_once_with( 69 self.controller.share_api.get.assert_called_once_with(
70 self.request.environ['manila.context'], share['id']) 70 self.request.environ['manila.context'], share['id'])
71 share_api.API.unmanage.assert_called_once_with( 71 share_api.API.unmanage.assert_called_once_with(
@@ -90,9 +90,9 @@ class ShareUnmanageTest(test.TestCase):
90 self.controller.unmanage, self.request, share['id']) 90 self.controller.unmanage, self.request, share['id'])
91 91
92 self.assertFalse(self.controller.share_api.unmanage.called) 92 self.assertFalse(self.controller.share_api.unmanage.called)
93 self.controller.share_api.db.share_snapshot_get_all_for_share.\ 93 (self.controller.share_api.db.share_snapshot_get_all_for_share.
94 assert_called_once_with( 94 assert_called_once_with(
95 self.request.environ['manila.context'], share['id']) 95 self.request.environ['manila.context'], share['id']))
96 self.controller.share_api.get.assert_called_once_with( 96 self.controller.share_api.get.assert_called_once_with(
97 self.request.environ['manila.context'], share['id']) 97 self.request.environ['manila.context'], share['id'])
98 self.mock_policy_check.assert_called_once_with( 98 self.mock_policy_check.assert_called_once_with(
diff --git a/manila/tests/api/v2/test_availability_zones.py b/manila/tests/api/v2/test_availability_zones.py
index 9e9cf76..bc399bc 100644
--- a/manila/tests/api/v2/test_availability_zones.py
+++ b/manila/tests/api/v2/test_availability_zones.py
@@ -72,8 +72,8 @@ class AvailabilityZonesAPITest(test.TestCase):
72 72
73 result = az_controller.index(req) 73 result = az_controller.index(req)
74 74
75 availability_zones.db.availability_zone_get_all.\ 75 (availability_zones.db.availability_zone_get_all.
76 assert_called_once_with(ctxt) 76 assert_called_once_with(ctxt))
77 mock_policy_check.assert_called_once_with( 77 mock_policy_check.assert_called_once_with(
78 ctxt, controller.resource_name, 'index') 78 ctxt, controller.resource_name, 'index')
79 self.assertIsInstance(result, dict) 79 self.assertIsInstance(result, dict)
diff --git a/manila/tests/api/v2/test_quota_sets.py b/manila/tests/api/v2/test_quota_sets.py
index 9cfa2e9..f1f0268 100644
--- a/manila/tests/api/v2/test_quota_sets.py
+++ b/manila/tests/api/v2/test_quota_sets.py
@@ -374,11 +374,11 @@ class QuotaSetsControllerTest(test.TestCase):
374 ) 374 )
375 self.assertTrue(hasattr(result, 'status_code')) 375 self.assertTrue(hasattr(result, 'status_code'))
376 self.assertEqual(202, result.status_code) 376 self.assertEqual(202, result.status_code)
377 quota_sets.QUOTAS.destroy_all_by_project_and_user. \ 377 (quota_sets.QUOTAS.destroy_all_by_project_and_user.
378 assert_called_once_with( 378 assert_called_once_with(
379 REQ_WITH_USER.environ['manila.context'], 379 REQ_WITH_USER.environ['manila.context'],
380 project_id, 380 project_id,
381 REQ_WITH_USER.environ['manila.context'].user_id) 381 REQ_WITH_USER.environ['manila.context'].user_id))
382 self.assertFalse(quota_sets.QUOTAS.destroy_all_by_project.called) 382 self.assertFalse(quota_sets.QUOTAS.destroy_all_by_project.called)
383 self.mock_policy_check.assert_called_once_with( 383 self.mock_policy_check.assert_called_once_with(
384 REQ_WITH_USER.environ['manila.context'], self.resource_name, 384 REQ_WITH_USER.environ['manila.context'], self.resource_name,
diff --git a/manila/tests/api/v2/test_share_networks.py b/manila/tests/api/v2/test_share_networks.py
index 5b69494..4dcc407 100644
--- a/manila/tests/api/v2/test_share_networks.py
+++ b/manila/tests/api/v2/test_share_networks.py
@@ -217,9 +217,9 @@ class ShareNetworkAPITest(test.TestCase):
217 217
218 db_api.share_network_get.assert_called_once_with( 218 db_api.share_network_get.assert_called_once_with(
219 self.req.environ['manila.context'], share_nw['id']) 219 self.req.environ['manila.context'], share_nw['id'])
220 db_api.share_instances_get_all_by_share_network.\ 220 (db_api.share_instances_get_all_by_share_network.
221 assert_called_once_with(self.req.environ['manila.context'], 221 assert_called_once_with(self.req.environ['manila.context'],
222 share_nw['id']) 222 share_nw['id']))
223 self.controller.share_rpcapi.delete_share_server.assert_has_calls([ 223 self.controller.share_rpcapi.delete_share_server.assert_has_calls([
224 mock.call(self.req.environ['manila.context'], 'foo'), 224 mock.call(self.req.environ['manila.context'], 'foo'),
225 mock.call(self.req.environ['manila.context'], 'bar')]) 225 mock.call(self.req.environ['manila.context'], 'bar')])
@@ -257,9 +257,9 @@ class ShareNetworkAPITest(test.TestCase):
257 db_api.share_network_get.assert_called_once_with( 257 db_api.share_network_get.assert_called_once_with(
258 self.req.environ['manila.context'], share_nw['id']) 258 self.req.environ['manila.context'], share_nw['id'])
259 259
260 db_api.share_instances_get_all_by_share_network.\ 260 (db_api.share_instances_get_all_by_share_network.
261 assert_called_once_with(self.req.environ['manila.context'], 261 assert_called_once_with(self.req.environ['manila.context'],
262 share_nw['id']) 262 share_nw['id']))
263 263
264 self.controller.share_rpcapi.delete_share_server.assert_has_calls([ 264 self.controller.share_rpcapi.delete_share_server.assert_has_calls([
265 mock.call(self.req.environ['manila.context'], 'foo'), 265 mock.call(self.req.environ['manila.context'], 'foo'),
@@ -288,9 +288,9 @@ class ShareNetworkAPITest(test.TestCase):
288 288
289 db_api.share_network_get.assert_called_once_with( 289 db_api.share_network_get.assert_called_once_with(
290 self.req.environ['manila.context'], share_nw['id']) 290 self.req.environ['manila.context'], share_nw['id'])
291 db_api.share_instances_get_all_by_share_network.\ 291 (db_api.share_instances_get_all_by_share_network.
292 assert_called_once_with(self.req.environ['manila.context'], 292 assert_called_once_with(self.req.environ['manila.context'],
293 share_nw['id']) 293 share_nw['id']))
294 294
295 def test_delete_in_use_by_share_group(self): 295 def test_delete_in_use_by_share_group(self):
296 share_nw = fake_share_network.copy() 296 share_nw = fake_share_network.copy()
@@ -376,9 +376,9 @@ class ShareNetworkAPITest(test.TestCase):
376 req = fakes.HTTPRequest.blank( 376 req = fakes.HTTPRequest.blank(
377 '/share_networks?security_service_id=fake-ss-id') 377 '/share_networks?security_service_id=fake-ss-id')
378 result = self.controller.index(req) 378 result = self.controller.index(req)
379 db_api.share_network_get_all_by_security_service.\ 379 (db_api.share_network_get_all_by_security_service.
380 assert_called_once_with(req.environ['manila.context'], 380 assert_called_once_with(req.environ['manila.context'],
381 'fake-ss-id') 381 'fake-ss-id'))
382 self.assertEqual(1, len(result[share_networks.RESOURCES_NAME])) 382 self.assertEqual(1, len(result[share_networks.RESOURCES_NAME]))
383 self._check_share_network_view_shortened( 383 self._check_share_network_view_shortened(
384 result[share_networks.RESOURCES_NAME][0], 384 result[share_networks.RESOURCES_NAME][0],
@@ -442,9 +442,9 @@ class ShareNetworkAPITest(test.TestCase):
442 '/share_networks?security_service_id=fake-ss-id&project_id=fake', 442 '/share_networks?security_service_id=fake-ss-id&project_id=fake',
443 use_admin_context=True) 443 use_admin_context=True)
444 result = self.controller.index(req) 444 result = self.controller.index(req)
445 db_api.share_network_get_all_by_security_service.\ 445 (db_api.share_network_get_all_by_security_service.
446 assert_called_once_with(req.environ['manila.context'], 446 assert_called_once_with(req.environ['manila.context'],
447 'fake-ss-id') 447 'fake-ss-id'))
448 self.assertEqual(1, len(result[share_networks.RESOURCES_NAME])) 448 self.assertEqual(1, len(result[share_networks.RESOURCES_NAME]))
449 self._check_share_network_view_shortened( 449 self._check_share_network_view_shortened(
450 result[share_networks.RESOURCES_NAME][0], 450 result[share_networks.RESOURCES_NAME][0],
diff --git a/manila/tests/api/v2/test_share_types.py b/manila/tests/api/v2/test_share_types.py
index 34da5b5..7493360 100644
--- a/manila/tests/api/v2/test_share_types.py
+++ b/manila/tests/api/v2/test_share_types.py
@@ -98,8 +98,8 @@ def make_create_body(name="test_share_1", extra_specs=None,
98 extra_specs = {} 98 extra_specs = {}
99 99
100 if spec_driver_handles_share_servers is not None: 100 if spec_driver_handles_share_servers is not None:
101 extra_specs[constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS] =\ 101 extra_specs[constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS] = (
102 spec_driver_handles_share_servers 102 spec_driver_handles_share_servers)
103 103
104 body = { 104 body = {
105 "share_type": { 105 "share_type": {
diff --git a/manila/tests/api/v2/test_shares.py b/manila/tests/api/v2/test_shares.py
index 31ee5a9..09e221e 100644
--- a/manila/tests/api/v2/test_shares.py
+++ b/manila/tests/api/v2/test_shares.py
@@ -2361,9 +2361,9 @@ class ShareUnmanageTest(test.TestCase):
2361 actual_result = self.controller.unmanage(self.request, share['id']) 2361 actual_result = self.controller.unmanage(self.request, share['id'])
2362 2362
2363 self.assertEqual(202, actual_result.status_int) 2363 self.assertEqual(202, actual_result.status_int)
2364 self.controller.share_api.db.share_snapshot_get_all_for_share.\ 2364 (self.controller.share_api.db.share_snapshot_get_all_for_share.
2365 assert_called_once_with( 2365 assert_called_once_with(
2366 self.request.environ['manila.context'], share['id']) 2366 self.request.environ['manila.context'], share['id']))
2367 self.controller.share_api.get.assert_called_once_with( 2367 self.controller.share_api.get.assert_called_once_with(
2368 self.request.environ['manila.context'], share['id']) 2368 self.request.environ['manila.context'], share['id'])
2369 share_api.API.unmanage.assert_called_once_with( 2369 share_api.API.unmanage.assert_called_once_with(
@@ -2386,9 +2386,9 @@ class ShareUnmanageTest(test.TestCase):
2386 self.controller.unmanage, self.request, share['id']) 2386 self.controller.unmanage, self.request, share['id'])
2387 2387
2388 self.assertFalse(self.controller.share_api.unmanage.called) 2388 self.assertFalse(self.controller.share_api.unmanage.called)
2389 self.controller.share_api.db.share_snapshot_get_all_for_share.\ 2389 (self.controller.share_api.db.share_snapshot_get_all_for_share.
2390 assert_called_once_with( 2390 assert_called_once_with(
2391 self.request.environ['manila.context'], share['id']) 2391 self.request.environ['manila.context'], share['id']))
2392 self.controller.share_api.get.assert_called_once_with( 2392 self.controller.share_api.get.assert_called_once_with(
2393 self.request.environ['manila.context'], share['id']) 2393 self.request.environ['manila.context'], share['id'])
2394 2394
diff --git a/manila/tests/compute/test_nova.py b/manila/tests/compute/test_nova.py
index 83eab40..f65436e 100644
--- a/manila/tests/compute/test_nova.py
+++ b/manila/tests/compute/test_nova.py
@@ -337,15 +337,15 @@ class NovaApiTestCase(test.TestCase):
337 self.mock_object(self.novaclient.volumes, 'create_server_volume') 337 self.mock_object(self.novaclient.volumes, 'create_server_volume')
338 self.api.instance_volume_attach(self.ctx, 'instance_id', 338 self.api.instance_volume_attach(self.ctx, 'instance_id',
339 'vol_id', 'device') 339 'vol_id', 'device')
340 self.novaclient.volumes.create_server_volume.\ 340 (self.novaclient.volumes.create_server_volume.
341 assert_called_once_with('instance_id', 'vol_id', 'device') 341 assert_called_once_with('instance_id', 'vol_id', 'device'))
342 342
343 def test_instance_volume_detach(self): 343 def test_instance_volume_detach(self):
344 self.mock_object(self.novaclient.volumes, 'delete_server_volume') 344 self.mock_object(self.novaclient.volumes, 'delete_server_volume')
345 self.api.instance_volume_detach(self.ctx, 'instance_id', 345 self.api.instance_volume_detach(self.ctx, 'instance_id',
346 'att_id') 346 'att_id')
347 self.novaclient.volumes.delete_server_volume.\ 347 (self.novaclient.volumes.delete_server_volume.
348 assert_called_once_with('instance_id', 'att_id') 348 assert_called_once_with('instance_id', 'att_id'))
349 349
350 def test_instance_volumes_list(self): 350 def test_instance_volumes_list(self):
351 self.mock_object( 351 self.mock_object(
@@ -369,8 +369,8 @@ class NovaApiTestCase(test.TestCase):
369 self.mock_object(self.novaclient.volumes, 'update_server_volume') 369 self.mock_object(self.novaclient.volumes, 'update_server_volume')
370 self.api.update_server_volume(self.ctx, 'instance_id', 'att_id', 370 self.api.update_server_volume(self.ctx, 'instance_id', 'att_id',
371 'new_vol_id') 371 'new_vol_id')
372 self.novaclient.volumes.update_server_volume.\ 372 (self.novaclient.volumes.update_server_volume.
373 assert_called_once_with('instance_id', 'att_id', 'new_vol_id') 373 assert_called_once_with('instance_id', 'att_id', 'new_vol_id'))
374 374
375 def test_keypair_create(self): 375 def test_keypair_create(self):
376 self.mock_object(self.novaclient.keypairs, 'create') 376 self.mock_object(self.novaclient.keypairs, 'create')
@@ -380,14 +380,14 @@ class NovaApiTestCase(test.TestCase):
380 def test_keypair_import(self): 380 def test_keypair_import(self):
381 self.mock_object(self.novaclient.keypairs, 'create') 381 self.mock_object(self.novaclient.keypairs, 'create')
382 self.api.keypair_import(self.ctx, 'keypair_name', 'fake_pub_key') 382 self.api.keypair_import(self.ctx, 'keypair_name', 'fake_pub_key')
383 self.novaclient.keypairs.create.\ 383 (self.novaclient.keypairs.create.
384 assert_called_once_with('keypair_name', 'fake_pub_key') 384 assert_called_once_with('keypair_name', 'fake_pub_key'))
385 385
386 def test_keypair_delete(self): 386 def test_keypair_delete(self):
387 self.mock_object(self.novaclient.keypairs, 'delete') 387 self.mock_object(self.novaclient.keypairs, 'delete')
388 self.api.keypair_delete(self.ctx, 'fake_keypair_id') 388 self.api.keypair_delete(self.ctx, 'fake_keypair_id')
389 self.novaclient.keypairs.delete.\ 389 (self.novaclient.keypairs.delete.
390 assert_called_once_with('fake_keypair_id') 390 assert_called_once_with('fake_keypair_id'))
391 391
392 def test_keypair_list(self): 392 def test_keypair_list(self):
393 self.assertEqual([{'id': 'id1'}, {'id': 'id2'}], 393 self.assertEqual([{'id': 'id1'}, {'id': 'id2'}],
diff --git a/manila/tests/db/sqlalchemy/test_api.py b/manila/tests/db/sqlalchemy/test_api.py
index 0f33024..9cff31b 100644
--- a/manila/tests/db/sqlalchemy/test_api.py
+++ b/manila/tests/db/sqlalchemy/test_api.py
@@ -1838,11 +1838,12 @@ class ShareNetworkDatabaseAPITestCase(BaseDatabaseAPITestCase):
1838 self.share_nw_dict['id'], 1838 self.share_nw_dict['id'],
1839 security_dict1['id']) 1839 security_dict1['id'])
1840 1840
1841 result = db_api.model_query( 1841 result = (db_api.model_query(
1842 self.fake_context, 1842 self.fake_context,
1843 models.ShareNetworkSecurityServiceAssociation).\ 1843 models.ShareNetworkSecurityServiceAssociation).
1844 filter_by(security_service_id=security_dict1['id']).\ 1844 filter_by(security_service_id=security_dict1['id']).
1845 filter_by(share_network_id=self.share_nw_dict['id']).first() 1845 filter_by(share_network_id=self.share_nw_dict['id']).
1846 first())
1846 1847
1847 self.assertIsNotNone(result) 1848 self.assertIsNotNone(result)
1848 1849
@@ -1902,11 +1903,11 @@ class ShareNetworkDatabaseAPITestCase(BaseDatabaseAPITestCase):
1902 self.share_nw_dict['id'], 1903 self.share_nw_dict['id'],
1903 security_dict1['id']) 1904 security_dict1['id'])
1904 1905
1905 result = db_api.model_query( 1906 result = (db_api.model_query(
1906 self.fake_context, 1907 self.fake_context,
1907 models.ShareNetworkSecurityServiceAssociation).\ 1908 models.ShareNetworkSecurityServiceAssociation).
1908 filter_by(security_service_id=security_dict1['id']).\ 1909 filter_by(security_service_id=security_dict1['id']).
1909 filter_by(share_network_id=self.share_nw_dict['id']).first() 1910 filter_by(share_network_id=self.share_nw_dict['id']).first())
1910 1911
1911 self.assertIsNone(result) 1912 self.assertIsNone(result)
1912 1913
diff --git a/manila/tests/network/test_standalone_network_plugin.py b/manila/tests/network/test_standalone_network_plugin.py
index aef381d..d79a70e 100644
--- a/manila/tests/network/test_standalone_network_plugin.py
+++ b/manila/tests/network/test_standalone_network_plugin.py
@@ -283,13 +283,13 @@ class StandaloneNetworkPluginTest(test.TestCase):
283 283
284 instance.deallocate_network(fake_context, share_server_id) 284 instance.deallocate_network(fake_context, share_server_id)
285 285
286 instance.db.network_allocations_get_for_share_server.\ 286 (instance.db.network_allocations_get_for_share_server.
287 assert_called_once_with(fake_context, share_server_id) 287 assert_called_once_with(fake_context, share_server_id))
288 instance.db.network_allocation_delete.\ 288 (instance.db.network_allocation_delete.
289 assert_has_calls([ 289 assert_has_calls([
290 mock.call(fake_context, 'fake1'), 290 mock.call(fake_context, 'fake1'),
291 mock.call(fake_context, 'fake2'), 291 mock.call(fake_context, 'fake2'),
292 ]) 292 ]))
293 293
294 def test_allocate_network_zero_addresses_ipv4(self): 294 def test_allocate_network_zero_addresses_ipv4(self):
295 data = { 295 data = {
diff --git a/manila/tests/scheduler/drivers/test_base.py b/manila/tests/scheduler/drivers/test_base.py
index c0f48b4..a1c38e7 100644
--- a/manila/tests/scheduler/drivers/test_base.py
+++ b/manila/tests/scheduler/drivers/test_base.py
@@ -50,8 +50,8 @@ class SchedulerTestCase(test.TestCase):
50 'update_service_capabilities', mock.Mock()): 50 'update_service_capabilities', mock.Mock()):
51 self.driver.update_service_capabilities( 51 self.driver.update_service_capabilities(
52 service_name, host, capabilities) 52 service_name, host, capabilities)
53 self.driver.host_manager.update_service_capabilities.\ 53 (self.driver.host_manager.update_service_capabilities.
54 assert_called_once_with(service_name, host, capabilities) 54 assert_called_once_with(service_name, host, capabilities))
55 55
56 def test_hosts_up(self): 56 def test_hosts_up(self):
57 service1 = {'host': 'host1'} 57 service1 = {'host': 'host1'}
diff --git a/manila/tests/scheduler/test_host_manager.py b/manila/tests/scheduler/test_host_manager.py
index 576d0e8..7cfca68 100644
--- a/manila/tests/scheduler/test_host_manager.py
+++ b/manila/tests/scheduler/test_host_manager.py
@@ -836,9 +836,9 @@ class HostStateTestCase(test.TestCase):
836 context=fake_context) 836 context=fake_context)
837 837
838 result = fake_host.__repr__() 838 result = fake_host.__repr__()
839 expected = "host: 'host1', free_capacity_gb: None, " \ 839 expected = ("host: 'host1', free_capacity_gb: None, "
840 "pools: {'Backend1': host: 'host1#Backend1', " \ 840 "pools: {'Backend1': host: 'host1#Backend1', "
841 "free_capacity_gb: 15000, pools: None}" 841 "free_capacity_gb: 15000, pools: None}")
842 self.assertEqual(expected, result) 842 self.assertEqual(expected, result)
843 843
844 844
diff --git a/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon.py b/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon.py
index d6acd52..fffa167 100644
--- a/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon.py
+++ b/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon.py
@@ -940,8 +940,8 @@ class IsilonTest(test.TestCase):
940 } 940 }
941 access_rules = [access] 941 access_rules = [access]
942 add_rules = [access] 942 add_rules = [access]
943 self._mock_isilon_api.request.return_value.raise_for_status.\ 943 (self._mock_isilon_api.request.return_value.raise_for_status.
944 side_effect = HTTPError 944 side_effect) = HTTPError
945 945
946 rule_map = self.storage_connection.update_access( 946 rule_map = self.storage_connection.update_access(
947 self.mock_context, share, access_rules, add_rules, []) 947 self.mock_context, share, access_rules, add_rules, [])
@@ -966,8 +966,8 @@ class IsilonTest(test.TestCase):
966 } 966 }
967 add_rules = [access] 967 add_rules = [access]
968 access_rules = [access] 968 access_rules = [access]
969 self._mock_isilon_api.request.return_value.raise_for_status.\ 969 (self._mock_isilon_api.request.return_value.raise_for_status.
970 side_effect = HTTPError 970 side_effect) = HTTPError
971 971
972 rule_map = self.storage_connection.update_access( 972 rule_map = self.storage_connection.update_access(
973 self.mock_context, share, access_rules, add_rules, []) 973 self.mock_context, share, access_rules, add_rules, [])
@@ -993,8 +993,8 @@ class IsilonTest(test.TestCase):
993 add_rules = [access] 993 add_rules = [access]
994 access_rules = [access] 994 access_rules = [access]
995 message = _('Only "RW" and "RO" access levels are supported.') 995 message = _('Only "RW" and "RO" access levels are supported.')
996 self._mock_isilon_api.smb_permissions_add.side_effect = \ 996 self._mock_isilon_api.smb_permissions_add.side_effect = (
997 exception.ShareBackendException(message=message) 997 exception.ShareBackendException(message=message))
998 998
999 rule_map = self.storage_connection.update_access( 999 rule_map = self.storage_connection.update_access(
1000 self.mock_context, share, access_rules, add_rules, []) 1000 self.mock_context, share, access_rules, add_rules, [])
diff --git a/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon_api.py b/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon_api.py
index 968943c..0ca8742 100644
--- a/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon_api.py
+++ b/manila/tests/share/drivers/dell_emc/plugins/isilon/test_isilon_api.py
@@ -632,8 +632,8 @@ class IsilonApiTest(test.TestCase):
632 } 632 }
633 m.get(papi_share_url, status_code=200, json=share_data) 633 m.get(papi_share_url, status_code=200, json=share_data)
634 634
635 auth_url = '{0}/platform/1/auth/mapping/users/lookup?user={1}' \ 635 auth_url = ('{0}/platform/1/auth/mapping/users/lookup?user={1}'
636 ''.format(self._mock_url, user) 636 ''.format(self._mock_url, user))
637 example_sid = 'SID:S-1-5-21' 637 example_sid = 'SID:S-1-5-21'
638 sid_json = { 638 sid_json = {
639 'id': example_sid, 639 'id': example_sid,
@@ -675,8 +675,8 @@ class IsilonApiTest(test.TestCase):
675 } 675 }
676 m.get(papi_share_url, status_code=200, json=share_data) 676 m.get(papi_share_url, status_code=200, json=share_data)
677 677
678 auth_url = '{0}/platform/1/auth/mapping/users/lookup?user={1}' \ 678 auth_url = ('{0}/platform/1/auth/mapping/users/lookup?user={1}'
679 ''.format(self._mock_url, user) 679 ''.format(self._mock_url, user))
680 example_sid = 'SID:S-1-5-21' 680 example_sid = 'SID:S-1-5-21'
681 sid_json = { 681 sid_json = {
682 'id': example_sid, 682 'id': example_sid,
diff --git a/manila/tests/share/drivers/glusterfs/test_layout_directory.py b/manila/tests/share/drivers/glusterfs/test_layout_directory.py
index 1b555d4..5fa6cb6 100644
--- a/manila/tests/share/drivers/glusterfs/test_layout_directory.py
+++ b/manila/tests/share/drivers/glusterfs/test_layout_directory.py
@@ -182,8 +182,8 @@ class GlusterfsDirectoryMappedLayoutTestCase(test.TestCase):
182 self.assertTrue(common._mount_gluster_vol.called) 182 self.assertTrue(common._mount_gluster_vol.called)
183 183
184 def test_ensure_gluster_vol_mounted_error(self): 184 def test_ensure_gluster_vol_mounted_error(self):
185 common._mount_gluster_vol =\ 185 common._mount_gluster_vol = (
186 mock.Mock(side_effect=exception.GlusterfsException) 186 mock.Mock(side_effect=exception.GlusterfsException))
187 187
188 self.assertRaises(exception.GlusterfsException, 188 self.assertRaises(exception.GlusterfsException,
189 self._layout._ensure_gluster_vol_mounted) 189 self._layout._ensure_gluster_vol_mounted)
@@ -205,12 +205,12 @@ class GlusterfsDirectoryMappedLayoutTestCase(test.TestCase):
205 def test_update_share_stats(self): 205 def test_update_share_stats(self):
206 test_statvfs = mock.Mock(f_frsize=4096, f_blocks=524288, 206 test_statvfs = mock.Mock(f_frsize=4096, f_blocks=524288,
207 f_bavail=524288) 207 f_bavail=524288)
208 self._layout._get_mount_point_for_gluster_vol = \ 208 self._layout._get_mount_point_for_gluster_vol = (
209 mock.Mock(return_value='/mnt/nfs/testvol') 209 mock.Mock(return_value='/mnt/nfs/testvol'))
210 some_no = 42 210 some_no = 42
211 not_some_no = some_no + 1 211 not_some_no = some_no + 1
212 os_stat = lambda path: mock.Mock(st_dev=some_no) if path == '/mnt/nfs' \ 212 os_stat = (lambda path: mock.Mock(st_dev=some_no) if path == '/mnt/nfs'
213 else mock.Mock(st_dev=not_some_no) 213 else mock.Mock(st_dev=not_some_no))
214 with mock.patch.object(os, 'statvfs', return_value=test_statvfs): 214 with mock.patch.object(os, 'statvfs', return_value=test_statvfs):
215 with mock.patch.object(os, 'stat', os_stat): 215 with mock.patch.object(os, 'stat', os_stat):
216 216
@@ -223,8 +223,8 @@ class GlusterfsDirectoryMappedLayoutTestCase(test.TestCase):
223 self.assertEqual(test_data, ret) 223 self.assertEqual(test_data, ret)
224 224
225 def test_update_share_stats_gluster_mnt_unavailable(self): 225 def test_update_share_stats_gluster_mnt_unavailable(self):
226 self._layout._get_mount_point_for_gluster_vol = \ 226 self._layout._get_mount_point_for_gluster_vol = (
227 mock.Mock(return_value='/mnt/nfs/testvol') 227 mock.Mock(return_value='/mnt/nfs/testvol'))
228 some_no = 42 228 some_no = 42
229 with mock.patch.object(os, 'stat', 229 with mock.patch.object(os, 'stat',
230 return_value=mock.Mock(st_dev=some_no)): 230 return_value=mock.Mock(st_dev=some_no)):
@@ -342,8 +342,8 @@ class GlusterfsDirectoryMappedLayoutTestCase(test.TestCase):
342 self.assertIsNone(ret) 342 self.assertIsNone(ret)
343 343
344 def test_delete_share(self): 344 def test_delete_share(self):
345 self._layout._get_local_share_path =\ 345 self._layout._get_local_share_path = (
346 mock.Mock(return_value='/mnt/nfs/testvol/fakename') 346 mock.Mock(return_value='/mnt/nfs/testvol/fakename'))
347 347
348 self._layout.delete_share(self._context, self.share) 348 self._layout.delete_share(self._context, self.share)
349 349
@@ -351,8 +351,8 @@ class GlusterfsDirectoryMappedLayoutTestCase(test.TestCase):
351 fake_utils.fake_execute_get_log()) 351 fake_utils.fake_execute_get_log())
352 352
353 def test_cannot_delete_share(self): 353 def test_cannot_delete_share(self):
354 self._layout._get_local_share_path =\ 354 self._layout._get_local_share_path = (
355 mock.Mock(return_value='/mnt/nfs/testvol/fakename') 355 mock.Mock(return_value='/mnt/nfs/testvol/fakename'))
356 356
357 def exec_runner(*ignore_args, **ignore_kw): 357 def exec_runner(*ignore_args, **ignore_kw):
358 raise exception.ProcessExecutionError 358 raise exception.ProcessExecutionError
diff --git a/manila/tests/share/drivers/hdfs/test_hdfs_native.py b/manila/tests/share/drivers/hdfs/test_hdfs_native.py
index 15915f1..f7f7146 100644
--- a/manila/tests/share/drivers/hdfs/test_hdfs_native.py
+++ b/manila/tests/share/drivers/hdfs/test_hdfs_native.py
@@ -377,9 +377,9 @@ class HDFSNativeShareDriverTestCase(test.TestCase):
377 'fake_hdfs_bin', 'fsck', '/') 377 'fake_hdfs_bin', 'fsck', '/')
378 378
379 def test__get_available_capacity(self): 379 def test__get_available_capacity(self):
380 fake_out = 'Configured Capacity: 2.4\n' + \ 380 fake_out = ('Configured Capacity: 2.4\n' +
381 'Total Capacity: 2\n' + \ 381 'Total Capacity: 2\n' +
382 'DFS free: 1' 382 'DFS free: 1')
383 self._driver._hdfs_execute = mock.Mock(return_value=(fake_out, '')) 383 self._driver._hdfs_execute = mock.Mock(return_value=(fake_out, ''))
384 total, free = self._driver._get_available_capacity() 384 total, free = self._driver._get_available_capacity()
385 self._driver._hdfs_execute.assert_called_once_with( 385 self._driver._hdfs_execute.assert_called_once_with(
diff --git a/manila/tests/share/drivers/huawei/test_huawei_nas.py b/manila/tests/share/drivers/huawei/test_huawei_nas.py
index 61529c7..f38a6a2 100644
--- a/manila/tests/share/drivers/huawei/test_huawei_nas.py
+++ b/manila/tests/share/drivers/huawei/test_huawei_nas.py
@@ -498,42 +498,42 @@ class FakeHuaweiNasHelper(helper.RestHelper):
498 self.delete_flag = True 498 self.delete_flag = True
499 499
500 if url == "/NFS_SHARE_AUTH_CLIENT": 500 if url == "/NFS_SHARE_AUTH_CLIENT":
501 data, self.allow_ro_flag, self.allow_rw_flag = \ 501 data, self.allow_ro_flag, self.allow_rw_flag = (
502 allow_access('NFS', method, data) 502 allow_access('NFS', method, data))
503 self.allow_flag = True 503 self.allow_flag = True
504 504
505 if url == "/CIFS_SHARE_AUTH_CLIENT": 505 if url == "/CIFS_SHARE_AUTH_CLIENT":
506 data, self.allow_ro_flag, self.allow_rw_flag = \ 506 data, self.allow_ro_flag, self.allow_rw_flag = (
507 allow_access('CIFS', method, data) 507 allow_access('CIFS', method, data))
508 self.allow_flag = True 508 self.allow_flag = True
509 509
510 if url == "/FSSNAPSHOT?TYPE=48&PARENTID=4"\ 510 if url == ("/FSSNAPSHOT?TYPE=48&PARENTID=4"
511 "&&sortby=TIMESTAMP,d&range=[0-2000]": 511 "&&sortby=TIMESTAMP,d&range=[0-2000]"):
512 data = """{"error":{"code":0}, 512 data = """{"error":{"code":0},
513 "data":[{"ID":"3", 513 "data":[{"ID":"3",
514 "NAME":"share_snapshot_fake_snapshot_uuid"}]}""" 514 "NAME":"share_snapshot_fake_snapshot_uuid"}]}"""
515 self.delete_flag = True 515 self.delete_flag = True
516 516
517 if url == "/NFS_SHARE_AUTH_CLIENT?"\ 517 if url == ("/NFS_SHARE_AUTH_CLIENT?"
518 "filter=PARENTID::1&range=[0-100]": 518 "filter=PARENTID::1&range=[0-100]"):
519 data = """{"error":{"code":0}, 519 data = """{"error":{"code":0},
520 "data":[{"ID":"0", 520 "data":[{"ID":"0",
521 "NAME":"100.112.0.1_fail"}]}""" 521 "NAME":"100.112.0.1_fail"}]}"""
522 522
523 if url == "/CIFS_SHARE_AUTH_CLIENT?"\ 523 if url == ("/CIFS_SHARE_AUTH_CLIENT?"
524 "filter=PARENTID::2&range=[0-100]": 524 "filter=PARENTID::2&range=[0-100]"):
525 data = """{"error":{"code":0}, 525 data = """{"error":{"code":0},
526 "data":[{"ID":"0", 526 "data":[{"ID":"0",
527 "NAME":"user_name_fail"}]}""" 527 "NAME":"user_name_fail"}]}"""
528 528
529 if url == "/NFS_SHARE_AUTH_CLIENT?"\ 529 if url == ("/NFS_SHARE_AUTH_CLIENT?"
530 "filter=PARENTID::1&range=[100-200]": 530 "filter=PARENTID::1&range=[100-200]"):
531 data = """{"error":{"code":0}, 531 data = """{"error":{"code":0},
532 "data":[{"ID":"5", 532 "data":[{"ID":"5",
533 "NAME":"100.112.0.2"}]}""" 533 "NAME":"100.112.0.2"}]}"""
534 534
535 if url == "/CIFS_SHARE_AUTH_CLIENT?"\ 535 if url == ("/CIFS_SHARE_AUTH_CLIENT?"
536 "filter=PARENTID::2&range=[100-200]": 536 "filter=PARENTID::2&range=[100-200]"):
537 data = """{"error":{"code":0}, 537 data = """{"error":{"code":0},
538 "data":[{"ID":"6", 538 "data":[{"ID":"6",
539 "NAME":"user_exist"}]}""" 539 "NAME":"user_exist"}]}"""
@@ -560,9 +560,9 @@ class FakeHuaweiNasHelper(helper.RestHelper):
560 data = """{"error":{"code":0},"data":{ 560 data = """{"error":{"code":0},"data":{
561 "COUNT":"196"}}""" 561 "COUNT":"196"}}"""
562 562
563 if url == "/NFS_SHARE_AUTH_CLIENT/count?filter=PARENTID::1"\ 563 if (url == "/NFS_SHARE_AUTH_CLIENT/count?filter=PARENTID::1"
564 or url == "/CIFS_SHARE_AUTH_CLIENT/count?filter="\ 564 or url == ("/CIFS_SHARE_AUTH_CLIENT/count?filter="
565 "PARENTID::2": 565 "PARENTID::2")):
566 data = """{"error":{"code":0},"data":{ 566 data = """{"error":{"code":0},"data":{
567 "COUNT":"196"}}""" 567 "COUNT":"196"}}"""
568 568
@@ -3318,8 +3318,8 @@ class HuaweiShareDriverTestCase(test.TestCase):
3318 3318
3319 def test_setup_server_invalid_ipv4(self): 3319 def test_setup_server_invalid_ipv4(self):
3320 netwot_info_invali_ipv4 = self.fake_network_info 3320 netwot_info_invali_ipv4 = self.fake_network_info
3321 netwot_info_invali_ipv4['network_allocations'][0]['ip_address'] =\ 3321 netwot_info_invali_ipv4['network_allocations'][0]['ip_address'] = (
3322 "::1/128" 3322 "::1/128")
3323 self.assertRaises(exception.InvalidInput, 3323 self.assertRaises(exception.InvalidInput,
3324 self.driver._setup_server, 3324 self.driver._setup_server,
3325 netwot_info_invali_ipv4) 3325 netwot_info_invali_ipv4)
diff --git a/manila/tests/share/drivers/ibm/test_gpfs.py b/manila/tests/share/drivers/ibm/test_gpfs.py
index 3048a52..7186975 100644
--- a/manila/tests/share/drivers/ibm/test_gpfs.py
+++ b/manila/tests/share/drivers/ibm/test_gpfs.py
@@ -92,12 +92,12 @@ mmcesnfslsexport:nfsexports:HEADER:version:reserved:reserved:Path:Delegations:Cl
92 self.remote_ip2 = "2.2.2.2" 92 self.remote_ip2 = "2.2.2.2"
93 gpfs_nfs_server_list = [self.remote_ip, self.local_ip, self.remote_ip2, 93 gpfs_nfs_server_list = [self.remote_ip, self.local_ip, self.remote_ip2,
94 "fake_location"] 94 "fake_location"]
95 self._knfs_helper.configuration.gpfs_nfs_server_list = \ 95 self._knfs_helper.configuration.gpfs_nfs_server_list = (
96 gpfs_nfs_server_list 96 gpfs_nfs_server_list)
97 self._ces_helper.configuration.gpfs_nfs_server_list = \ 97 self._ces_helper.configuration.gpfs_nfs_server_list = (
98 gpfs_nfs_server_list 98 gpfs_nfs_server_list)
99 self._ces_helper.configuration.ganesha_config_path = \ 99 self._ces_helper.configuration.ganesha_config_path = (
100 "fake_ganesha_config_path" 100 "fake_ganesha_config_path")
101 self.sshlogin = "fake_login" 101 self.sshlogin = "fake_login"
102 self.sshkey = "fake_sshkey" 102 self.sshkey = "fake_sshkey"
103 self.gservice = "fake_ganesha_service" 103 self.gservice = "fake_ganesha_service"
@@ -233,22 +233,22 @@ mmcesnfslsexport:nfsexports:HEADER:version:reserved:reserved:Path:Delegations:Cl
233 233
234 def test__local_path(self): 234 def test__local_path(self):
235 sharename = 'fakesharename' 235 sharename = 'fakesharename'
236 self._driver.configuration.gpfs_mount_point_base =\ 236 self._driver.configuration.gpfs_mount_point_base = (
237 self.fakefspath 237 self.fakefspath)
238 local_path = self._driver._local_path(sharename) 238 local_path = self._driver._local_path(sharename)
239 self.assertEqual(self.fakefspath + '/' + sharename, 239 self.assertEqual(self.fakefspath + '/' + sharename,
240 local_path) 240 local_path)
241 241
242 def test__get_share_path(self): 242 def test__get_share_path(self):
243 self._driver.configuration.gpfs_mount_point_base =\ 243 self._driver.configuration.gpfs_mount_point_base = (
244 self.fakefspath 244 self.fakefspath)
245 share_path = self._driver._get_share_path(self.share) 245 share_path = self._driver._get_share_path(self.share)
246 self.assertEqual(self.fakefspath + '/' + self.share['name'], 246 self.assertEqual(self.fakefspath + '/' + self.share['name'],
247 share_path) 247 share_path)
248 248
249 def test__get_snapshot_path(self): 249 def test__get_snapshot_path(self):
250 self._driver.configuration.gpfs_mount_point_base =\ 250 self._driver.configuration.gpfs_mount_point_base = (
251 self.fakefspath 251 self.fakefspath)
252 snapshot_path = self._driver._get_snapshot_path(self.snapshot) 252 snapshot_path = self._driver._get_snapshot_path(self.snapshot)
253 self.assertEqual(self.fakefspath + '/' + self.snapshot['share_name'] + 253 self.assertEqual(self.fakefspath + '/' + self.snapshot['share_name'] +
254 '/.snapshots/' + self.snapshot['name'], 254 '/.snapshots/' + self.snapshot['name'],
diff --git a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py
index 7e82f2d..510ad01 100644
--- a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py
+++ b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py
@@ -115,8 +115,8 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
115 self.library.do_setup(self.context) 115 self.library.do_setup(self.context)
116 116
117 mock_get_api_client.assert_called_once_with() 117 mock_get_api_client.assert_called_once_with()
118 self.library._client.check_for_cluster_credentials.\ 118 (self.library._client.check_for_cluster_credentials.
119 assert_called_once_with() 119 assert_called_once_with())
120 self.assertEqual('fake_perf_library', self.library._perf_library) 120 self.assertEqual('fake_perf_library', self.library._perf_library)
121 121
122 def test_check_for_setup_error(self): 122 def test_check_for_setup_error(self):
@@ -295,8 +295,8 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
295 295
296 result = self.library._get_aggregate_space() 296 result = self.library._get_aggregate_space()
297 297
298 self.library._client.get_cluster_aggregate_capacities.\ 298 (self.library._client.get_cluster_aggregate_capacities.
299 assert_called_once_with(fake.AGGREGATES) 299 assert_called_once_with(fake.AGGREGATES))
300 self.assertDictEqual(fake.AGGREGATE_CAPACITIES, result) 300 self.assertDictEqual(fake.AGGREGATE_CAPACITIES, result)
301 301
302 def test_get_aggregate_space_no_cluster_creds(self): 302 def test_get_aggregate_space_no_cluster_creds(self):
@@ -311,8 +311,8 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
311 311
312 result = self.library._get_aggregate_space() 312 result = self.library._get_aggregate_space()
313 313
314 self.library._client.get_vserver_aggregate_capacities.\ 314 (self.library._client.get_vserver_aggregate_capacities.
315 assert_called_once_with(fake.AGGREGATES) 315 assert_called_once_with(fake.AGGREGATES))
316 self.assertDictEqual(fake.AGGREGATE_CAPACITIES, result) 316 self.assertDictEqual(fake.AGGREGATE_CAPACITIES, result)
317 317
318 def test_get_aggregate_node_cluster_creds(self): 318 def test_get_aggregate_node_cluster_creds(self):
@@ -324,8 +324,8 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
324 324
325 result = self.library._get_aggregate_node(fake.AGGREGATE) 325 result = self.library._get_aggregate_node(fake.AGGREGATE)
326 326
327 self.library._client.get_node_for_aggregate.\ 327 (self.library._client.get_node_for_aggregate.
328 assert_called_once_with(fake.AGGREGATE) 328 assert_called_once_with(fake.AGGREGATE))
329 self.assertEqual(fake.CLUSTER_NODE, result) 329 self.assertEqual(fake.CLUSTER_NODE, result)
330 330
331 def test_get_aggregate_node_no_cluster_creds(self): 331 def test_get_aggregate_node_no_cluster_creds(self):
diff --git a/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py b/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
index 0c12b5b..ba7e3c5 100644
--- a/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
+++ b/manila/tests/share/drivers/netapp/dataontap/protocols/test_nfs_cmode.py
@@ -64,8 +64,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
64 64
65 self.helper.delete_share(fake.NFS_SHARE, fake.SHARE_NAME) 65 self.helper.delete_share(fake.NFS_SHARE, fake.SHARE_NAME)
66 66
67 self.mock_client.clear_nfs_export_policy_for_volume.\ 67 (self.mock_client.clear_nfs_export_policy_for_volume.
68 assert_called_once_with(fake.SHARE_NAME) 68 assert_called_once_with(fake.SHARE_NAME))
69 self.mock_client.soft_delete_nfs_export_policy.assert_called_once_with( 69 self.mock_client.soft_delete_nfs_export_policy.assert_called_once_with(
70 fake.EXPORT_POLICY_NAME) 70 fake.EXPORT_POLICY_NAME)
71 71
@@ -230,8 +230,8 @@ class NetAppClusteredNFSHelperTestCase(test.TestCase):
230 230
231 self.mock_client.create_nfs_export_policy.assert_called_once_with( 231 self.mock_client.create_nfs_export_policy.assert_called_once_with(
232 fake.EXPORT_POLICY_NAME) 232 fake.EXPORT_POLICY_NAME)
233 self.mock_client.set_nfs_export_policy_for_volume.\ 233 (self.mock_client.set_nfs_export_policy_for_volume.
234 assert_called_once_with(fake.SHARE_NAME, fake.EXPORT_POLICY_NAME) 234 assert_called_once_with(fake.SHARE_NAME, fake.EXPORT_POLICY_NAME))
235 self.assertFalse(self.mock_client.rename_nfs_export_policy.called) 235 self.assertFalse(self.mock_client.rename_nfs_export_policy.called)
236 236
237 def test_ensure_export_policy_rename(self): 237 def test_ensure_export_policy_rename(self):
diff --git a/manila/tests/share/drivers/test_generic.py b/manila/tests/share/drivers/test_generic.py
index 6a78b84..942af3b 100644
--- a/manila/tests/share/drivers/test_generic.py
+++ b/manila/tests/share/drivers/test_generic.py
@@ -179,8 +179,8 @@ class GenericShareDriverTestCase(test.TestCase):
179 compute.API.assert_called_once_with() 179 compute.API.assert_called_once_with()
180 self._driver._setup_helpers.assert_called_once_with() 180 self._driver._setup_helpers.assert_called_once_with()
181 if not dhss: 181 if not dhss:
182 self._driver.service_instance_manager.get_common_server.\ 182 (self._driver.service_instance_manager.get_common_server.
183 assert_called_once_with() 183 assert_called_once_with())
184 self._driver._is_share_server_active.assert_called_once_with( 184 self._driver._is_share_server_active.assert_called_once_with(
185 self._context, fake_server) 185 self._context, fake_server)
186 else: 186 else:
@@ -213,8 +213,8 @@ class GenericShareDriverTestCase(test.TestCase):
213 volume.API.assert_called_once_with() 213 volume.API.assert_called_once_with()
214 compute.API.assert_called_once_with() 214 compute.API.assert_called_once_with()
215 self._driver._setup_helpers.assert_called_once_with() 215 self._driver._setup_helpers.assert_called_once_with()
216 self._driver.service_instance_manager.get_common_server.\ 216 (self._driver.service_instance_manager.get_common_server.
217 assert_has_calls([mock.call()] * 3) 217 assert_has_calls([mock.call()] * 3))
218 self._driver._is_share_server_active.assert_has_calls( 218 self._driver._is_share_server_active.assert_has_calls(
219 [mock.call(self._context, fake_server)] * 2) 219 [mock.call(self._context, fake_server)] * 2)
220 mock_sleep.assert_has_calls([mock.call(5)] * 2) 220 mock_sleep.assert_has_calls([mock.call(5)] * 2)
@@ -543,9 +543,9 @@ class GenericShareDriverTestCase(test.TestCase):
543 result = self._driver._attach_volume(self._context, self.share, 543 result = self._driver._attach_volume(self._context, self.share,
544 'fake_inst_id', available_volume) 544 'fake_inst_id', available_volume)
545 545
546 self._driver.compute_api.instance_volume_attach.\ 546 (self._driver.compute_api.instance_volume_attach.
547 assert_called_once_with(self._context, 'fake_inst_id', 547 assert_called_once_with(self._context, 'fake_inst_id',
548 available_volume['id']) 548 available_volume['id']))
549 self._driver.volume_api.get.assert_called_once_with( 549 self._driver.volume_api.get.assert_called_once_with(
550 self._context, attached_volume['id']) 550 self._context, attached_volume['id'])
551 self.assertEqual(attached_volume, result) 551 self.assertEqual(attached_volume, result)
@@ -732,11 +732,11 @@ class GenericShareDriverTestCase(test.TestCase):
732 self._driver._detach_volume(self._context, self.share, 732 self._driver._detach_volume(self._context, self.share,
733 self.server['backend_details']) 733 self.server['backend_details'])
734 734
735 self._driver.compute_api.instance_volume_detach.\ 735 (self._driver.compute_api.instance_volume_detach.
736 assert_called_once_with( 736 assert_called_once_with(
737 self._context, 737 self._context,
738 self.server['backend_details']['instance_id'], 738 self.server['backend_details']['instance_id'],
739 available_volume['id']) 739 available_volume['id']))
740 self._driver.volume_api.get.assert_called_once_with( 740 self._driver.volume_api.get.assert_called_once_with(
741 self._context, available_volume['id']) 741 self._context, available_volume['id'])
742 742
@@ -944,13 +944,13 @@ class GenericShareDriverTestCase(test.TestCase):
944 944
945 self._driver.delete_share(self._context, self.share) 945 self._driver.delete_share(self._context, self.share)
946 946
947 self._driver.service_instance_manager.get_common_server.\ 947 (self._driver.service_instance_manager.get_common_server.
948 assert_called_once_with() 948 assert_called_once_with())
949 self._driver._deallocate_container.assert_called_once_with( 949 self._driver._deallocate_container.assert_called_once_with(
950 self._driver.admin_context, self.share) 950 self._driver.admin_context, self.share)
951 self._driver.service_instance_manager.ensure_service_instance.\ 951 (self._driver.service_instance_manager.ensure_service_instance.
952 assert_called_once_with( 952 assert_called_once_with(
953 self._context, self.server['backend_details']) 953 self._context, self.server['backend_details']))
954 954
955 def test_delete_share(self): 955 def test_delete_share(self):
956 self.mock_object(self._driver, '_unmount_device') 956 self.mock_object(self._driver, '_unmount_device')
@@ -969,9 +969,9 @@ class GenericShareDriverTestCase(test.TestCase):
969 self.server['backend_details']) 969 self.server['backend_details'])
970 self._driver._deallocate_container.assert_called_once_with( 970 self._driver._deallocate_container.assert_called_once_with(
971 self._driver.admin_context, self.share) 971 self._driver.admin_context, self.share)
972 self._driver.service_instance_manager.ensure_service_instance.\ 972 (self._driver.service_instance_manager.ensure_service_instance.
973 assert_called_once_with( 973 assert_called_once_with(
974 self._context, self.server['backend_details']) 974 self._context, self.server['backend_details']))
975 975
976 def test_detach_volume_with_volume_not_found(self): 976 def test_detach_volume_with_volume_not_found(self):
977 fake_vol = fake_volume.FakeVolume() 977 fake_vol = fake_volume.FakeVolume()
@@ -1048,9 +1048,9 @@ class GenericShareDriverTestCase(test.TestCase):
1048 self.assertFalse(self._driver._detach_volume.called) 1048 self.assertFalse(self._driver._detach_volume.called)
1049 self._driver._deallocate_container.assert_called_once_with( 1049 self._driver._deallocate_container.assert_called_once_with(
1050 self._driver.admin_context, self.share) 1050 self._driver.admin_context, self.share)
1051 self._driver.service_instance_manager.ensure_service_instance.\ 1051 (self._driver.service_instance_manager.ensure_service_instance.
1052 assert_called_once_with( 1052 assert_called_once_with(
1053 self._context, self.server['backend_details']) 1053 self._context, self.server['backend_details']))
1054 1054
1055 def test_delete_share_invalid_helper(self): 1055 def test_delete_share_invalid_helper(self):
1056 self._driver._helpers = {'CIFS': self._helper_cifs} 1056 self._driver._helpers = {'CIFS': self._helper_cifs}
@@ -1156,10 +1156,10 @@ class GenericShareDriverTestCase(test.TestCase):
1156 share_server=self.server) 1156 share_server=self.server)
1157 1157
1158 # asserts 1158 # asserts
1159 self._driver._helpers[self.share['share_proto']].\ 1159 (self._driver._helpers[self.share['share_proto']].
1160 update_access.assert_called_once_with( 1160 update_access.assert_called_once_with(
1161 self.server['backend_details'], self.share['name'], 1161 self.server['backend_details'], self.share['name'],
1162 access_rules, add_rules=add_rules, delete_rules=delete_rules) 1162 access_rules, add_rules=add_rules, delete_rules=delete_rules))
1163 1163
1164 @ddt.data(fake_share.fake_share(), 1164 @ddt.data(fake_share.fake_share(),
1165 fake_share.fake_share(share_proto='NFSBOGUS'), 1165 fake_share.fake_share(share_proto='NFSBOGUS'),
@@ -1201,9 +1201,9 @@ class GenericShareDriverTestCase(test.TestCase):
1201 'router_id': 'fake_router_id', 1201 'router_id': 'fake_router_id',
1202 } 1202 }
1203 self._driver.teardown_server(server_details) 1203 self._driver.teardown_server(server_details)
1204 self._driver.service_instance_manager.delete_service_instance.\ 1204 (self._driver.service_instance_manager.delete_service_instance.
1205 assert_called_once_with( 1205 assert_called_once_with(
1206 self._driver.admin_context, server_details) 1206 self._driver.admin_context, server_details))
1207 1207
1208 def test_ssh_exec_connection_not_exist(self): 1208 def test_ssh_exec_connection_not_exist(self):
1209 ssh_conn_timeout = 30 1209 ssh_conn_timeout = 30
@@ -1372,9 +1372,9 @@ class GenericShareDriverTestCase(test.TestCase):
1372 self._driver.service_instance_manager.get_common_server.call_count) 1372 self._driver.service_instance_manager.get_common_server.call_count)
1373 self._driver._is_device_mounted.assert_called_once_with( 1373 self._driver._is_device_mounted.assert_called_once_with(
1374 fake_path, None) 1374 fake_path, None)
1375 self._driver._helpers[share['share_proto']].\ 1375 (self._driver._helpers[share['share_proto']].
1376 get_share_path_by_export_location.assert_called_once_with( 1376 get_share_path_by_export_location.assert_called_once_with(
1377 None, share['export_locations'][0]['path']) 1377 None, share['export_locations'][0]['path']))
1378 1378
1379 def test_manage_share_not_attached_to_cinder_volume_invalid_size(self): 1379 def test_manage_share_not_attached_to_cinder_volume_invalid_size(self):
1380 share = get_fake_manage_share() 1380 share = get_fake_manage_share()
@@ -1397,9 +1397,9 @@ class GenericShareDriverTestCase(test.TestCase):
1397 1397
1398 self._driver._get_mounted_share_size.assert_called_once_with( 1398 self._driver._get_mounted_share_size.assert_called_once_with(
1399 fake_path, server_details) 1399 fake_path, server_details)
1400 self._driver._helpers[share['share_proto']].\ 1400 (self._driver._helpers[share['share_proto']].
1401 get_share_path_by_export_location.assert_called_once_with( 1401 get_share_path_by_export_location.assert_called_once_with(
1402 server_details, share['export_locations'][0]['path']) 1402 server_details, share['export_locations'][0]['path']))
1403 1403
1404 def test_manage_share_not_attached_to_cinder_volume(self): 1404 def test_manage_share_not_attached_to_cinder_volume(self):
1405 share = get_fake_manage_share() 1405 share = get_fake_manage_share()
@@ -1424,12 +1424,12 @@ class GenericShareDriverTestCase(test.TestCase):
1424 1424
1425 self.assertEqual( 1425 self.assertEqual(
1426 {'size': share_size, 'export_locations': fake_exports}, result) 1426 {'size': share_size, 'export_locations': fake_exports}, result)
1427 self._driver._helpers[share['share_proto']].get_exports_for_share.\ 1427 (self._driver._helpers[share['share_proto']].get_exports_for_share.
1428 assert_called_once_with( 1428 assert_called_once_with(
1429 server_details, share['export_locations'][0]['path']) 1429 server_details, share['export_locations'][0]['path']))
1430 self._driver._helpers[share['share_proto']].\ 1430 (self._driver._helpers[share['share_proto']].
1431 get_share_path_by_export_location.assert_called_once_with( 1431 get_share_path_by_export_location.assert_called_once_with(
1432 server_details, share['export_locations'][0]['path']) 1432 server_details, share['export_locations'][0]['path']))
1433 self._driver._get_mounted_share_size.assert_called_once_with( 1433 self._driver._get_mounted_share_size.assert_called_once_with(
1434 fake_path, server_details) 1434 fake_path, server_details)
1435 self.assertFalse(self._driver._get_volume.called) 1435 self.assertFalse(self._driver._get_volume.called)
@@ -1493,9 +1493,9 @@ class GenericShareDriverTestCase(test.TestCase):
1493 1493
1494 self.assertEqual( 1494 self.assertEqual(
1495 {'size': fake_size, 'export_locations': fake_exports}, result) 1495 {'size': fake_size, 'export_locations': fake_exports}, result)
1496 self._driver._helpers[share['share_proto']].get_exports_for_share.\ 1496 (self._driver._helpers[share['share_proto']].get_exports_for_share.
1497 assert_called_once_with( 1497 assert_called_once_with(
1498 server_details, share['export_locations'][0]['path']) 1498 server_details, share['export_locations'][0]['path']))
1499 expected_volume_update = { 1499 expected_volume_update = {
1500 'name': self._driver._get_volume_name(share['id']) 1500 'name': self._driver._get_volume_name(share['id'])
1501 } 1501 }
@@ -1602,10 +1602,10 @@ class GenericShareDriverTestCase(test.TestCase):
1602 self.assertFalse(self._driver._extend_volume.called) 1602 self.assertFalse(self._driver._extend_volume.called)
1603 self.assertFalse(self._driver._attach_volume.called) 1603 self.assertFalse(self._driver._attach_volume.called)
1604 1604
1605 self._helper_nfs.disable_access_for_maintenance.\ 1605 (self._helper_nfs.disable_access_for_maintenance.
1606 assert_called_once_with(srv_details, 'test_share') 1606 assert_called_once_with(srv_details, 'test_share'))
1607 self._helper_nfs.restore_access_after_maintenance.\ 1607 (self._helper_nfs.restore_access_after_maintenance.
1608 assert_called_once_with(srv_details, 'test_share') 1608 assert_called_once_with(srv_details, 'test_share'))
1609 self.assertTrue(self._driver._resize_filesystem.called) 1609 self.assertTrue(self._driver._resize_filesystem.called)
1610 1610
1611 def test_extend_volume(self): 1611 def test_extend_volume(self):
@@ -1828,11 +1828,11 @@ class GenericDriverEnsureServerTestCase(test.TestCase):
1828 actual = fake(self.dhss_false, self._context) 1828 actual = fake(self.dhss_false, self._context)
1829 1829
1830 self.assertEqual(self.server, actual) 1830 self.assertEqual(self.server, actual)
1831 self.dhss_false.service_instance_manager.\ 1831 (self.dhss_false.service_instance_manager.
1832 get_common_server.assert_called_once_with() 1832 get_common_server.assert_called_once_with())
1833 self.dhss_false.service_instance_manager.ensure_service_instance.\ 1833 (self.dhss_false.service_instance_manager.ensure_service_instance.
1834 assert_called_once_with( 1834 assert_called_once_with(
1835 self._context, self.server['backend_details']) 1835 self._context, self.server['backend_details']))
1836 1836
1837 @ddt.data({'id': 'without_details'}, 1837 @ddt.data({'id': 'without_details'},
1838 {'id': 'with_details', 'backend_details': {'foo': 'bar'}}) 1838 {'id': 'with_details', 'backend_details': {'foo': 'bar'}})
@@ -1849,9 +1849,9 @@ class GenericDriverEnsureServerTestCase(test.TestCase):
1849 actual = fake(self.dhss_true, self._context, share_server=self.server) 1849 actual = fake(self.dhss_true, self._context, share_server=self.server)
1850 1850
1851 self.assertEqual(self.server, actual) 1851 self.assertEqual(self.server, actual)
1852 self.dhss_true.service_instance_manager.ensure_service_instance.\ 1852 (self.dhss_true.service_instance_manager.ensure_service_instance.
1853 assert_called_once_with( 1853 assert_called_once_with(
1854 self._context, self.server['backend_details']) 1854 self._context, self.server['backend_details']))
1855 1855
1856 def test_share_servers_are_handled_invalid_server_provided(self): 1856 def test_share_servers_are_handled_invalid_server_provided(self):
1857 server = {'id': 'without_details'} 1857 server = {'id': 'without_details'}
diff --git a/manila/tests/share/drivers/test_glusterfs.py b/manila/tests/share/drivers/test_glusterfs.py
index 98d814f..4443874 100644
--- a/manila/tests/share/drivers/test_glusterfs.py
+++ b/manila/tests/share/drivers/test_glusterfs.py
@@ -450,8 +450,8 @@ class GaneshaNFSHelperTestCase(test.TestCase):
450 450
451 ret = self._helper._default_config_hook() 451 ret = self._helper._default_config_hook()
452 452
453 glusterfs.ganesha.GaneshaNASHelper._default_config_hook.\ 453 (glusterfs.ganesha.GaneshaNASHelper._default_config_hook.
454 assert_called_once_with() 454 assert_called_once_with())
455 glusterfs.ganesha_utils.path_from.assert_called_once_with( 455 glusterfs.ganesha_utils.path_from.assert_called_once_with(
456 glusterfs.__file__, 'conf') 456 glusterfs.__file__, 'conf')
457 self._helper._load_conf_dir.assert_called_once_with( 457 self._helper._load_conf_dir.assert_called_once_with(
diff --git a/manila/tests/share/drivers/test_helpers.py b/manila/tests/share/drivers/test_helpers.py
index 74f1dae..c3cd1a2 100644
--- a/manila/tests/share/drivers/test_helpers.py
+++ b/manila/tests/share/drivers/test_helpers.py
@@ -551,8 +551,8 @@ class CIFSHelperIPAccessTestCase(test.TestCase):
551 "metadata": {"export_location_metadata_example": "example"} 551 "metadata": {"export_location_metadata_example": "example"}
552 }] 552 }]
553 self.assertEqual(expected_export_location, result) 553 self.assertEqual(expected_export_location, result)
554 self._helper._get_share_group_name_from_export_location.\ 554 (self._helper._get_share_group_name_from_export_location.
555 assert_called_once_with(export_location) 555 assert_called_once_with(export_location))
556 556
557 @ddt.data( 557 @ddt.data(
558 {'public_address_with_suffix': 'foo'}, 558 {'public_address_with_suffix': 'foo'},
@@ -583,8 +583,8 @@ class CIFSHelperIPAccessTestCase(test.TestCase):
583 self.assertEqual('/bar/quuz', result) 583 self.assertEqual('/bar/quuz', result)
584 self._helper._ssh_exec.assert_called_once_with( 584 self._helper._ssh_exec.assert_called_once_with(
585 fake_server, ['sudo', 'net', 'conf', 'getparm', 'foo', 'path']) 585 fake_server, ['sudo', 'net', 'conf', 'getparm', 'foo', 'path'])
586 self._helper._get_share_group_name_from_export_location.\ 586 (self._helper._get_share_group_name_from_export_location.
587 assert_called_once_with(export_location) 587 assert_called_once_with(export_location))
588 588
589 def test_disable_access_for_maintenance(self): 589 def test_disable_access_for_maintenance(self):
590 allowed_hosts = ['test', 'test2'] 590 allowed_hosts = ['test', 'test2']
diff --git a/manila/tests/share/drivers/test_service_instance.py b/manila/tests/share/drivers/test_service_instance.py
index 76e1dd9..1a06cfa 100644
--- a/manila/tests/share/drivers/test_service_instance.py
+++ b/manila/tests/share/drivers/test_service_instance.py
@@ -964,9 +964,9 @@ class ServiceInstanceManagerTestCase(test.TestCase):
964 availability_zone=service_instance.CONF.storage_availability_zone) 964 availability_zone=service_instance.CONF.storage_availability_zone)
965 self._manager.compute_api.server_get.assert_called_once_with( 965 self._manager.compute_api.server_get.assert_called_once_with(
966 self._manager.admin_context, server_create['id']) 966 self._manager.admin_context, server_create['id'])
967 self._manager.compute_api.add_security_group_to_server.\ 967 (self._manager.compute_api.add_security_group_to_server.
968 assert_called_once_with( 968 assert_called_once_with(
969 self._manager.admin_context, server_get['id'], sg['id']) 969 self._manager.admin_context, server_get['id'], sg['id']))
970 self._manager.network_helper.get_network_name.assert_has_calls([]) 970 self._manager.network_helper.get_network_name.assert_has_calls([])
971 971
972 def test___create_service_instance_neutron_no_admin_ip(self): 972 def test___create_service_instance_neutron_no_admin_ip(self):
@@ -1039,9 +1039,9 @@ class ServiceInstanceManagerTestCase(test.TestCase):
1039 availability_zone=service_instance.CONF.storage_availability_zone) 1039 availability_zone=service_instance.CONF.storage_availability_zone)
1040 self._manager.compute_api.server_get.assert_called_once_with( 1040 self._manager.compute_api.server_get.assert_called_once_with(
1041 self._manager.admin_context, server_create['id']) 1041 self._manager.admin_context, server_create['id'])
1042 self._manager.compute_api.add_security_group_to_server.\ 1042 (self._manager.compute_api.add_security_group_to_server.
1043 assert_called_once_with( 1043 assert_called_once_with(
1044 self._manager.admin_context, server_get['id'], sg['id']) 1044 self._manager.admin_context, server_get['id'], sg['id']))
1045 self._manager.network_helper.get_network_name.assert_has_calls([]) 1045 self._manager.network_helper.get_network_name.assert_has_calls([])
1046 1046
1047 @ddt.data( 1047 @ddt.data(
@@ -1320,14 +1320,14 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1320 'connect_share_server_to_tenant_network', 'get_config_option'] 1320 'connect_share_server_to_tenant_network', 'get_config_option']
1321 for attr in attrs: 1321 for attr in attrs:
1322 self.assertTrue(hasattr(instance, attr), "No attr '%s'" % attr) 1322 self.assertTrue(hasattr(instance, attr), "No attr '%s'" % attr)
1323 service_instance.NeutronNetworkHelper._get_service_network_id.\ 1323 (service_instance.NeutronNetworkHelper._get_service_network_id.
1324 assert_called_once_with() 1324 assert_called_once_with())
1325 self.assertEqual('DEFAULT', instance.neutron_api.config_group_name) 1325 self.assertEqual('DEFAULT', instance.neutron_api.config_group_name)
1326 1326
1327 def test_init_neutron_network_plugin_with_driver_config_group(self): 1327 def test_init_neutron_network_plugin_with_driver_config_group(self):
1328 self.fake_manager.driver_config = mock.Mock() 1328 self.fake_manager.driver_config = mock.Mock()
1329 self.fake_manager.driver_config.config_group =\ 1329 self.fake_manager.driver_config.config_group = (
1330 'fake_config_group' 1330 'fake_config_group')
1331 self.fake_manager.driver_config.network_config_group = None 1331 self.fake_manager.driver_config.network_config_group = None
1332 instance = self._init_neutron_network_plugin() 1332 instance = self._init_neutron_network_plugin()
1333 self.assertEqual('fake_config_group', 1333 self.assertEqual('fake_config_group',
@@ -1335,10 +1335,10 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1335 1335
1336 def test_init_neutron_network_plugin_with_network_config_group(self): 1336 def test_init_neutron_network_plugin_with_network_config_group(self):
1337 self.fake_manager.driver_config = mock.Mock() 1337 self.fake_manager.driver_config = mock.Mock()
1338 self.fake_manager.driver_config.config_group =\ 1338 self.fake_manager.driver_config.config_group = (
1339 "fake_config_group" 1339 "fake_config_group")
1340 self.fake_manager.driver_config.network_config_group =\ 1340 self.fake_manager.driver_config.network_config_group = (
1341 "fake_network_config_group" 1341 "fake_network_config_group")
1342 instance = self._init_neutron_network_plugin() 1342 instance = self._init_neutron_network_plugin()
1343 self.assertEqual('fake_network_config_group', 1343 self.assertEqual('fake_network_config_group',
1344 instance.neutron_api.config_group_name) 1344 instance.neutron_api.config_group_name)
@@ -1416,8 +1416,8 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1416 self.assertRaises(exception.ManilaException, 1416 self.assertRaises(exception.ManilaException,
1417 lambda: helper.service_network_id) 1417 lambda: helper.service_network_id)
1418 1418
1419 service_instance.neutron.API.get_all_admin_project_networks.\ 1419 (service_instance.neutron.API.get_all_admin_project_networks.
1420 assert_has_calls([mock.call()]) 1420 assert_has_calls([mock.call()]))
1421 1421
1422 @ddt.data(dict(), dict(subnet_id='foo'), dict(router_id='bar')) 1422 @ddt.data(dict(), dict(subnet_id='foo'), dict(router_id='bar'))
1423 def test_teardown_network_no_service_data(self, server_details): 1423 def test_teardown_network_no_service_data(self, server_details):
@@ -1558,10 +1558,10 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1558 1558
1559 instance.teardown_network(server_details) 1559 instance.teardown_network(server_details)
1560 1560
1561 service_instance.neutron.API.router_remove_interface.\ 1561 (service_instance.neutron.API.router_remove_interface.
1562 assert_called_once_with('bar', 'foo') 1562 assert_called_once_with('bar', 'foo'))
1563 service_instance.neutron.API.update_subnet.\ 1563 (service_instance.neutron.API.update_subnet.
1564 assert_called_once_with('foo', '') 1564 assert_called_once_with('foo', ''))
1565 service_instance.neutron.API.list_ports.assert_called_once_with( 1565 service_instance.neutron.API.list_ports.assert_called_once_with(
1566 fields=['fixed_ips', 'device_id', 'device_owner']) 1566 fields=['fixed_ips', 'device_id', 'device_owner'])
1567 1567
@@ -1584,10 +1584,10 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1584 1584
1585 instance.teardown_network(server_details) 1585 instance.teardown_network(server_details)
1586 1586
1587 service_instance.neutron.API.router_remove_interface.\ 1587 (service_instance.neutron.API.router_remove_interface.
1588 assert_called_once_with('bar', 'foo') 1588 assert_called_once_with('bar', 'foo'))
1589 service_instance.neutron.API.update_subnet.\ 1589 (service_instance.neutron.API.update_subnet.
1590 assert_called_once_with('foo', '') 1590 assert_called_once_with('foo', ''))
1591 service_instance.neutron.API.list_ports.assert_called_once_with( 1591 service_instance.neutron.API.list_ports.assert_called_once_with(
1592 fields=['fixed_ips', 'device_id', 'device_owner']) 1592 fields=['fixed_ips', 'device_id', 'device_owner'])
1593 1593
@@ -1612,8 +1612,8 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1612 exception.NetworkException, 1612 exception.NetworkException,
1613 instance.teardown_network, server_details) 1613 instance.teardown_network, server_details)
1614 1614
1615 service_instance.neutron.API.router_remove_interface.\ 1615 (service_instance.neutron.API.router_remove_interface.
1616 assert_called_once_with('bar', 'foo') 1616 assert_called_once_with('bar', 'foo'))
1617 self.assertFalse(service_instance.neutron.API.update_subnet.called) 1617 self.assertFalse(service_instance.neutron.API.update_subnet.called)
1618 service_instance.neutron.API.list_ports.assert_called_once_with( 1618 service_instance.neutron.API.list_ports.assert_called_once_with(
1619 fields=['fixed_ips', 'device_id', 'device_owner']) 1619 fields=['fixed_ips', 'device_id', 'device_owner'])
@@ -1671,8 +1671,8 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1671 result = instance.setup_network(network_info) 1671 result = instance.setup_network(network_info)
1672 1672
1673 self.assertEqual(expected, result) 1673 self.assertEqual(expected, result)
1674 instance.setup_connectivity_with_service_instances.\ 1674 (instance.setup_connectivity_with_service_instances.
1675 assert_called_once_with() 1675 assert_called_once_with())
1676 instance._get_service_subnet.assert_called_once_with(mock.ANY) 1676 instance._get_service_subnet.assert_called_once_with(mock.ANY)
1677 instance._get_cidr_for_subnet.assert_called_once_with() 1677 instance._get_cidr_for_subnet.assert_called_once_with()
1678 self.assertTrue(service_instance.neutron.API.subnet_create.called) 1678 self.assertTrue(service_instance.neutron.API.subnet_create.called)
@@ -1722,8 +1722,8 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1722 result = instance.setup_network(network_info) 1722 result = instance.setup_network(network_info)
1723 1723
1724 self.assertEqual(expected, result) 1724 self.assertEqual(expected, result)
1725 instance.setup_connectivity_with_service_instances.\ 1725 (instance.setup_connectivity_with_service_instances.
1726 assert_called_once_with() 1726 assert_called_once_with())
1727 self.assertTrue(service_instance.neutron.API.create_port.called) 1727 self.assertTrue(service_instance.neutron.API.create_port.called)
1728 1728
1729 @ddt.data(None, exception.NetworkException(code=400)) 1729 @ddt.data(None, exception.NetworkException(code=400))
@@ -1779,16 +1779,16 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1779 result = instance.setup_network(network_info) 1779 result = instance.setup_network(network_info)
1780 1780
1781 self.assertEqual(expected, result) 1781 self.assertEqual(expected, result)
1782 instance.setup_connectivity_with_service_instances.\ 1782 (instance.setup_connectivity_with_service_instances.
1783 assert_called_once_with() 1783 assert_called_once_with())
1784 instance._get_service_subnet.assert_called_once_with(mock.ANY) 1784 instance._get_service_subnet.assert_called_once_with(mock.ANY)
1785 instance._get_cidr_for_subnet.assert_called_once_with() 1785 instance._get_cidr_for_subnet.assert_called_once_with()
1786 self.assertTrue(service_instance.neutron.API.subnet_create.called) 1786 self.assertTrue(service_instance.neutron.API.subnet_create.called)
1787 self.assertTrue(service_instance.neutron.API.create_port.called) 1787 self.assertTrue(service_instance.neutron.API.create_port.called)
1788 instance._get_private_router.assert_called_once_with( 1788 instance._get_private_router.assert_called_once_with(
1789 network_info['neutron_net_id'], network_info['neutron_subnet_id']) 1789 network_info['neutron_net_id'], network_info['neutron_subnet_id'])
1790 service_instance.neutron.API.router_add_interface.\ 1790 (service_instance.neutron.API.router_add_interface.
1791 assert_called_once_with(router['id'], service_subnet['id']) 1791 assert_called_once_with(router['id'], service_subnet['id']))
1792 1792
1793 def test_setup_network_using_router_addon_of_interface_failed(self): 1793 def test_setup_network_using_router_addon_of_interface_failed(self):
1794 network_info = dict( 1794 network_info = dict(
@@ -1816,8 +1816,8 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1816 instance._get_service_subnet.assert_called_once_with(mock.ANY) 1816 instance._get_service_subnet.assert_called_once_with(mock.ANY)
1817 instance._get_private_router.assert_called_once_with( 1817 instance._get_private_router.assert_called_once_with(
1818 network_info['neutron_net_id'], network_info['neutron_subnet_id']) 1818 network_info['neutron_net_id'], network_info['neutron_subnet_id'])
1819 service_instance.neutron.API.router_add_interface.\ 1819 (service_instance.neutron.API.router_add_interface.
1820 assert_called_once_with(router['id'], service_subnet['id']) 1820 assert_called_once_with(router['id'], service_subnet['id']))
1821 1821
1822 def test_setup_network_using_router_connectivity_verification_fail(self): 1822 def test_setup_network_using_router_connectivity_verification_fail(self):
1823 admin_project_id = 'fake_admin_project_id' 1823 admin_project_id = 'fake_admin_project_id'
@@ -1859,16 +1859,16 @@ class NeutronNetworkHelperTestCase(test.TestCase):
1859 self.assertRaises( 1859 self.assertRaises(
1860 exception.ManilaException, instance.setup_network, network_info) 1860 exception.ManilaException, instance.setup_network, network_info)
1861 1861
1862 instance.setup_connectivity_with_service_instances.\ 1862 (instance.setup_connectivity_with_service_instances.
1863 assert_called_once_with() 1863 assert_called_once_with())
1864 instance._get_service_subnet.assert_called_once_with(mock.ANY) 1864 instance._get_service_subnet.assert_called_once_with(mock.ANY)
1865 instance._get_cidr_for_subnet.assert_called_once_with() 1865 instance._get_cidr_for_subnet.assert_called_once_with()
1866 self.assertTrue(service_instance.neutron.API.subnet_create.called) 1866 self.assertTrue(service_instance.neutron.API.subnet_create.called)
1867 self.assertTrue(service_instance.neutron.API.create_port.called) 1867 self.assertTrue(service_instance.neutron.API.create_port.called)
1868 instance._get_private_router.assert_called_once_with( 1868 instance._get_private_router.assert_called_once_with(
1869 network_info['neutron_net_id'], network_info['neutron_subnet_id']) 1869 network_info['neutron_net_id'], network_info['neutron_subnet_id'])
1870 service_instance.neutron.API.router_add_interface.\ 1870 (service_instance.neutron.API.router_add_interface.
1871 assert_called_once_with(router['id'], service_subnet['id']) 1871 assert_called_once_with(router['id'], service_subnet['id']))
1872 service_instance.neutron.API.delete_port.assert_has_calls([ 1872 service_instance.neutron.API.delete_port.assert_has_calls([
1873 mock.call(self.service_port['id'])]) 1873 mock.call(self.service_port['id'])])
1874 1874
diff --git a/manila/tests/share/test_api.py b/manila/tests/share/test_api.py
index 125a06a..bab0657 100644
--- a/manila/tests/share/test_api.py
+++ b/manila/tests/share/test_api.py
@@ -708,9 +708,9 @@ class ShareAPITestCase(test.TestCase):
708 708
709 self.api.create_instance(self.context, share) 709 self.api.create_instance(self.context, share)
710 710
711 self.api.scheduler_rpcapi.create_share_instance.\ 711 (self.api.scheduler_rpcapi.create_share_instance.
712 assert_called_once_with( 712 assert_called_once_with(
713 self.context, request_spec=mock.ANY, filter_properties={}) 713 self.context, request_spec=mock.ANY, filter_properties={}))
714 self.assertFalse(self.api.share_rpcapi.create_share_instance.called) 714 self.assertFalse(self.api.share_rpcapi.create_share_instance.called)
715 715
716 def test_create_instance_share_group_snapshot_member(self): 716 def test_create_instance_share_group_snapshot_member(self):
@@ -1432,8 +1432,8 @@ class ShareAPITestCase(test.TestCase):
1432 self.api.delete_share_server(self.context, server) 1432 self.api.delete_share_server(self.context, server)
1433 db_api.share_instances_get_all_by_share_server.assert_called_once_with( 1433 db_api.share_instances_get_all_by_share_server.assert_called_once_with(
1434 self.context, server['id']) 1434 self.context, server['id'])
1435 db_api.share_group_get_all_by_share_server.\ 1435 (db_api.share_group_get_all_by_share_server.
1436 assert_called_once_with(self.context, server['id']) 1436 assert_called_once_with(self.context, server['id']))
1437 self.share_rpcapi.delete_share_server.assert_called_once_with( 1437 self.share_rpcapi.delete_share_server.assert_called_once_with(
1438 self.context, server_returned) 1438 self.context, server_returned)
1439 1439
@@ -1463,8 +1463,8 @@ class ShareAPITestCase(test.TestCase):
1463 1463
1464 db_api.share_instances_get_all_by_share_server.assert_called_once_with( 1464 db_api.share_instances_get_all_by_share_server.assert_called_once_with(
1465 self.context, server['id']) 1465 self.context, server['id'])
1466 db_api.share_group_get_all_by_share_server.\ 1466 (db_api.share_group_get_all_by_share_server.
1467 assert_called_once_with(self.context, server['id']) 1467 assert_called_once_with(self.context, server['id']))
1468 1468
1469 @mock.patch.object(db_api, 'share_snapshot_instance_update', mock.Mock()) 1469 @mock.patch.object(db_api, 'share_snapshot_instance_update', mock.Mock())
1470 def test_delete_snapshot(self): 1470 def test_delete_snapshot(self):
diff --git a/manila/tests/share/test_driver.py b/manila/tests/share/test_driver.py
index 4626a22..fed846b 100644
--- a/manila/tests/share/test_driver.py
+++ b/manila/tests/share/test_driver.py
@@ -512,8 +512,8 @@ class ShareDriverTestCase(test.TestCase):
512 share_driver.allocate_admin_network(ctxt, share_server) 512 share_driver.allocate_admin_network(ctxt, share_server)
513 513
514 mock_get_admin_network_allocations_number.assert_called_once_with() 514 mock_get_admin_network_allocations_number.assert_called_once_with()
515 share_driver.admin_network_api.allocate_network.\ 515 (share_driver.admin_network_api.allocate_network.
516 assert_called_once_with(ctxt, share_server, count=1) 516 assert_called_once_with(ctxt, share_server, count=1))
517 517
518 def test_allocate_admin_network_count_1_api_not_initialized(self): 518 def test_allocate_admin_network_count_1_api_not_initialized(self):
519 share_driver = self._instantiate_share_driver(None, True, None) 519 share_driver = self._instantiate_share_driver(None, True, None)
diff --git a/manila/tests/share/test_manager.py b/manila/tests/share/test_manager.py
index a36e0c6..e01805d 100644
--- a/manila/tests/share/test_manager.py
+++ b/manila/tests/share/test_manager.py
@@ -175,13 +175,13 @@ class ShareManagerTestCase(test.TestCase):
175 self.share_manager.init_host() 175 self.share_manager.init_host()
176 176
177 self.assertTrue(self.share_manager.driver.initialized) 177 self.assertTrue(self.share_manager.driver.initialized)
178 self.share_manager.db.share_instances_get_all_by_host.\ 178 (self.share_manager.db.share_instances_get_all_by_host.
179 assert_called_once_with(utils.IsAMatcher(context.RequestContext), 179 assert_called_once_with(utils.IsAMatcher(context.RequestContext),
180 self.share_manager.host) 180 self.share_manager.host))
181 self.share_manager.driver.do_setup.assert_called_once_with( 181 self.share_manager.driver.do_setup.assert_called_once_with(
182 utils.IsAMatcher(context.RequestContext)) 182 utils.IsAMatcher(context.RequestContext))
183 self.share_manager.driver.check_for_setup_error.\ 183 (self.share_manager.driver.check_for_setup_error.
184 assert_called_once_with() 184 assert_called_once_with())
185 185
186 @ddt.data( 186 @ddt.data(
187 "connection_get_info", 187 "connection_get_info",
@@ -318,9 +318,9 @@ class ShareManagerTestCase(test.TestCase):
318 self.share_manager.init_host() 318 self.share_manager.init_host()
319 319
320 # verification of call 320 # verification of call
321 self.share_manager.db.share_instances_get_all_by_host.\ 321 (self.share_manager.db.share_instances_get_all_by_host.
322 assert_called_once_with(utils.IsAMatcher(context.RequestContext), 322 assert_called_once_with(utils.IsAMatcher(context.RequestContext),
323 self.share_manager.host) 323 self.share_manager.host))
324 exports_update = self.share_manager.db.share_export_locations_update 324 exports_update = self.share_manager.db.share_export_locations_update
325 exports_update.assert_has_calls([ 325 exports_update.assert_has_calls([
326 mock.call(mock.ANY, instances[0]['id'], fake_export_locations), 326 mock.call(mock.ANY, instances[0]['id'], fake_export_locations),
@@ -328,8 +328,8 @@ class ShareManagerTestCase(test.TestCase):
328 ]) 328 ])
329 self.share_manager.driver.do_setup.assert_called_once_with( 329 self.share_manager.driver.do_setup.assert_called_once_with(
330 utils.IsAMatcher(context.RequestContext)) 330 utils.IsAMatcher(context.RequestContext))
331 self.share_manager.driver.check_for_setup_error.\ 331 (self.share_manager.driver.check_for_setup_error.
332 assert_called_once_with() 332 assert_called_once_with())
333 self.share_manager._ensure_share_instance_has_pool.assert_has_calls([ 333 self.share_manager._ensure_share_instance_has_pool.assert_has_calls([
334 mock.call(utils.IsAMatcher(context.RequestContext), instances[0]), 334 mock.call(utils.IsAMatcher(context.RequestContext), instances[0]),
335 mock.call(utils.IsAMatcher(context.RequestContext), instances[2]), 335 mock.call(utils.IsAMatcher(context.RequestContext), instances[2]),
@@ -344,9 +344,9 @@ class ShareManagerTestCase(test.TestCase):
344 mock.call(utils.IsAMatcher(context.RequestContext), instances[2], 344 mock.call(utils.IsAMatcher(context.RequestContext), instances[2],
345 share_server=share_server), 345 share_server=share_server),
346 ]) 346 ])
347 self.share_manager.publish_service_capabilities.\ 347 (self.share_manager.publish_service_capabilities.
348 assert_called_once_with( 348 assert_called_once_with(
349 utils.IsAMatcher(context.RequestContext)) 349 utils.IsAMatcher(context.RequestContext)))
350 self.share_manager.access_helper.update_access_rules.assert_has_calls([ 350 self.share_manager.access_helper.update_access_rules.assert_has_calls([
351 mock.call(mock.ANY, instances[4]['id'], share_server=share_server), 351 mock.call(mock.ANY, instances[4]['id'], share_server=share_server),
352 ]) 352 ])
@@ -376,9 +376,9 @@ class ShareManagerTestCase(test.TestCase):
376 self.share_manager.init_host() 376 self.share_manager.init_host()
377 377
378 # verification of call 378 # verification of call
379 self.share_manager.db.share_instances_get_all_by_host.\ 379 (self.share_manager.db.share_instances_get_all_by_host.
380 assert_called_once_with(utils.IsAMatcher(context.RequestContext), 380 assert_called_once_with(utils.IsAMatcher(context.RequestContext),
381 self.share_manager.host) 381 self.share_manager.host))
382 self.share_manager.driver.do_setup.assert_called_once_with( 382 self.share_manager.driver.do_setup.assert_called_once_with(
383 utils.IsAMatcher(context.RequestContext)) 383 utils.IsAMatcher(context.RequestContext))
384 self.share_manager.driver.check_for_setup_error.assert_called_with() 384 self.share_manager.driver.check_for_setup_error.assert_called_with()
@@ -396,9 +396,9 @@ class ShareManagerTestCase(test.TestCase):
396 mock.call(utils.IsAMatcher(context.RequestContext), instances[2], 396 mock.call(utils.IsAMatcher(context.RequestContext), instances[2],
397 share_server=share_server), 397 share_server=share_server),
398 ]) 398 ])
399 self.share_manager.publish_service_capabilities.\ 399 (self.share_manager.publish_service_capabilities.
400 assert_called_once_with( 400 assert_called_once_with(
401 utils.IsAMatcher(context.RequestContext)) 401 utils.IsAMatcher(context.RequestContext)))
402 manager.LOG.info.assert_any_call( 402 manager.LOG.info.assert_any_call(
403 mock.ANY, 403 mock.ANY,
404 {'task': constants.TASK_STATE_MIGRATION_IN_PROGRESS, 404 {'task': constants.TASK_STATE_MIGRATION_IN_PROGRESS,
@@ -438,9 +438,9 @@ class ShareManagerTestCase(test.TestCase):
438 smanager.init_host() 438 smanager.init_host()
439 439
440 # verification of call 440 # verification of call
441 smanager.db.share_instances_get_all_by_host.\ 441 (smanager.db.share_instances_get_all_by_host.
442 assert_called_once_with(utils.IsAMatcher(context.RequestContext), 442 assert_called_once_with(utils.IsAMatcher(context.RequestContext),
443 smanager.host) 443 smanager.host))
444 smanager.driver.do_setup.assert_called_once_with( 444 smanager.driver.do_setup.assert_called_once_with(
445 utils.IsAMatcher(context.RequestContext)) 445 utils.IsAMatcher(context.RequestContext))
446 smanager.driver.check_for_setup_error.assert_called_with() 446 smanager.driver.check_for_setup_error.assert_called_with()
@@ -458,9 +458,9 @@ class ShareManagerTestCase(test.TestCase):
458 mock.call(utils.IsAMatcher(context.RequestContext), instances[2], 458 mock.call(utils.IsAMatcher(context.RequestContext), instances[2],
459 share_server=share_server), 459 share_server=share_server),
460 ]) 460 ])
461 self.share_manager.publish_service_capabilities.\ 461 (self.share_manager.publish_service_capabilities.
462 assert_called_once_with( 462 assert_called_once_with(
463 utils.IsAMatcher(context.RequestContext)) 463 utils.IsAMatcher(context.RequestContext)))
464 manager.LOG.info.assert_any_call( 464 manager.LOG.info.assert_any_call(
465 mock.ANY, 465 mock.ANY,
466 {'task': constants.TASK_STATE_MIGRATION_IN_PROGRESS, 466 {'task': constants.TASK_STATE_MIGRATION_IN_PROGRESS,
@@ -1769,12 +1769,12 @@ class ShareManagerTestCase(test.TestCase):
1769 self.context, 1769 self.context,
1770 fake_share.instance['id'], 1770 fake_share.instance['id'],
1771 ) 1771 )
1772 db.share_server_get_all_by_host_and_share_net_valid.\ 1772 (db.share_server_get_all_by_host_and_share_net_valid.
1773 assert_called_once_with( 1773 assert_called_once_with(
1774 utils.IsAMatcher(context.RequestContext), 1774 utils.IsAMatcher(context.RequestContext),
1775 self.share_manager.host, 1775 self.share_manager.host,
1776 fake_share['share_network_id'], 1776 fake_share['share_network_id'],
1777 ) 1777 ))
1778 db.share_server_create.assert_called_once_with( 1778 db.share_server_create.assert_called_once_with(
1779 utils.IsAMatcher(context.RequestContext), mock.ANY) 1779 utils.IsAMatcher(context.RequestContext), mock.ANY)
1780 db.share_instance_update.assert_has_calls([ 1780 db.share_instance_update.assert_has_calls([
@@ -2137,8 +2137,8 @@ class ShareManagerTestCase(test.TestCase):
2137 self.share_manager.manage_share, 2137 self.share_manager.manage_share,
2138 self.context, share_id, driver_options) 2138 self.context, share_id, driver_options)
2139 2139
2140 self.share_manager.driver.manage_existing.\ 2140 (self.share_manager.driver.manage_existing.
2141 assert_called_once_with(mock.ANY, driver_options) 2141 assert_called_once_with(mock.ANY, driver_options))
2142 2142
2143 self.share_manager.db.share_update.assert_called_once_with( 2143 self.share_manager.db.share_update.assert_called_once_with(
2144 utils.IsAMatcher(context.RequestContext), share_id, 2144 utils.IsAMatcher(context.RequestContext), share_id,
@@ -2163,8 +2163,8 @@ class ShareManagerTestCase(test.TestCase):
2163 self.share_manager.manage_share, 2163 self.share_manager.manage_share,
2164 self.context, share_id, driver_options) 2164 self.context, share_id, driver_options)
2165 2165
2166 self.share_manager.driver.manage_existing.\ 2166 (self.share_manager.driver.manage_existing.
2167 assert_called_once_with(mock.ANY, driver_options) 2167 assert_called_once_with(mock.ANY, driver_options))
2168 self.share_manager.db.share_update.assert_called_once_with( 2168 self.share_manager.db.share_update.assert_called_once_with(
2169 utils.IsAMatcher(context.RequestContext), share_id, 2169 utils.IsAMatcher(context.RequestContext), share_id,
2170 {'status': constants.STATUS_MANAGE_ERROR, 'size': 1}) 2170 {'status': constants.STATUS_MANAGE_ERROR, 'size': 1})
@@ -2190,8 +2190,8 @@ class ShareManagerTestCase(test.TestCase):
2190 self.share_manager.manage_share, 2190 self.share_manager.manage_share,
2191 self.context, share_id, driver_options) 2191 self.context, share_id, driver_options)
2192 2192
2193 self.share_manager.driver.manage_existing.\ 2193 (self.share_manager.driver.manage_existing.
2194 assert_called_once_with(mock.ANY, driver_options) 2194 assert_called_once_with(mock.ANY, driver_options))
2195 self.share_manager.db.share_update.assert_called_once_with( 2195 self.share_manager.db.share_update.assert_called_once_with(
2196 mock.ANY, share_id, 2196 mock.ANY, share_id,
2197 {'status': constants.STATUS_MANAGE_ERROR, 'size': 1}) 2197 {'status': constants.STATUS_MANAGE_ERROR, 'size': 1})
@@ -2226,13 +2226,13 @@ class ShareManagerTestCase(test.TestCase):
2226 2226
2227 self.share_manager.manage_share(self.context, share_id, driver_options) 2227 self.share_manager.manage_share(self.context, share_id, driver_options)
2228 2228
2229 self.share_manager.driver.manage_existing.\ 2229 (self.share_manager.driver.manage_existing.
2230 assert_called_once_with(mock.ANY, driver_options) 2230 assert_called_once_with(mock.ANY, driver_options))
2231 if export_locations: 2231 if export_locations:
2232 self.share_manager.db.share_export_locations_update.\ 2232 (self.share_manager.db.share_export_locations_update.
2233 assert_called_once_with( 2233 assert_called_once_with(
2234 utils.IsAMatcher(context.RequestContext), 2234 utils.IsAMatcher(context.RequestContext),
2235 share.instance['id'], export_locations, delete=True) 2235 share.instance['id'], export_locations, delete=True))
2236 else: 2236 else:
2237 self.assertFalse( 2237 self.assertFalse(
2238 self.share_manager.db.share_export_locations_update.called) 2238 self.share_manager.db.share_export_locations_update.called)
@@ -2328,8 +2328,8 @@ class ShareManagerTestCase(test.TestCase):
2328 2328
2329 self.share_manager.unmanage_share(self.context, share_id) 2329 self.share_manager.unmanage_share(self.context, share_id)
2330 2330
2331 self.share_manager.driver.unmanage.\ 2331 (self.share_manager.driver.unmanage.
2332 assert_called_once_with(mock.ANY) 2332 assert_called_once_with(mock.ANY))
2333 self.share_manager.db.share_instance_delete.assert_called_once_with( 2333 self.share_manager.db.share_instance_delete.assert_called_once_with(
2334 mock.ANY, share_instance_id) 2334 mock.ANY, share_instance_id)
2335 2335
@@ -2344,8 +2344,8 @@ class ShareManagerTestCase(test.TestCase):
2344 2344
2345 self.share_manager.unmanage_share(self.context, share['id']) 2345 self.share_manager.unmanage_share(self.context, share['id'])
2346 2346
2347 self.share_manager.driver.unmanage.\ 2347 (self.share_manager.driver.unmanage.
2348 assert_called_once_with(mock.ANY) 2348 assert_called_once_with(mock.ANY))
2349 self.share_manager.db.share_instance_delete.assert_called_once_with( 2349 self.share_manager.db.share_instance_delete.assert_called_once_with(
2350 mock.ANY, share_instance_id) 2350 mock.ANY, share_instance_id)
2351 2351
@@ -2628,7 +2628,7 @@ class ShareManagerTestCase(test.TestCase):
2628 network_info) 2628 network_info)
2629 self.share_manager.driver.setup_server.assert_called_once_with( 2629 self.share_manager.driver.setup_server.assert_called_once_with(
2630 network_info, metadata=metadata) 2630 network_info, metadata=metadata)
2631 self.share_manager.db.share_server_backend_details_set.\ 2631 (self.share_manager.db.share_server_backend_details_set.
2632 assert_has_calls([ 2632 assert_has_calls([
2633 mock.call(self.context, share_server['id'], 2633 mock.call(self.context, share_server['id'],
2634 {'security_service_' + sec_services[0]['type']: 2634 {'security_service_' + sec_services[0]['type']:
@@ -2640,7 +2640,7 @@ class ShareManagerTestCase(test.TestCase):
2640 {'security_service_' + sec_services[2]['type']: 2640 {'security_service_' + sec_services[2]['type']:
2641 jsonutils.dumps(sec_services[2])}), 2641 jsonutils.dumps(sec_services[2])}),
2642 mock.call(self.context, share_server['id'], server_info), 2642 mock.call(self.context, share_server['id'], server_info),
2643 ]) 2643 ]))
2644 self.share_manager.db.share_server_update.assert_called_once_with( 2644 self.share_manager.db.share_server_update.assert_called_once_with(
2645 self.context, share_server['id'], 2645 self.context, share_server['id'],
2646 {'status': constants.STATUS_ACTIVE}) 2646 {'status': constants.STATUS_ACTIVE})
@@ -2734,9 +2734,9 @@ class ShareManagerTestCase(test.TestCase):
2734 2734
2735 # verify results 2735 # verify results
2736 if detail_data_proper: 2736 if detail_data_proper:
2737 self.share_manager.db.share_server_backend_details_set.\ 2737 (self.share_manager.db.share_server_backend_details_set.
2738 assert_called_once_with( 2738 assert_called_once_with(
2739 self.context, share_server['id'], server_info) 2739 self.context, share_server['id'], server_info))
2740 self.share_manager._form_server_setup_info.assert_called_once_with( 2740 self.share_manager._form_server_setup_info.assert_called_once_with(
2741 self.context, share_server, share_network) 2741 self.context, share_server, share_network)
2742 self.share_manager.db.share_server_update.assert_called_once_with( 2742 self.share_manager.db.share_server_update.assert_called_once_with(
@@ -2887,11 +2887,11 @@ class ShareManagerTestCase(test.TestCase):
2887 self.context, fake_share_server, fake_share_network) 2887 self.context, fake_share_server, fake_share_network)
2888 2888
2889 self.assertEqual(expected, network_info) 2889 self.assertEqual(expected, network_info)
2890 self.share_manager.db.network_allocations_get_for_share_server.\ 2890 (self.share_manager.db.network_allocations_get_for_share_server.
2891 assert_has_calls([ 2891 assert_has_calls([
2892 mock.call(self.context, fake_share_server['id'], label='user'), 2892 mock.call(self.context, fake_share_server['id'], label='user'),
2893 mock.call(self.context, fake_share_server['id'], label='admin') 2893 mock.call(self.context, fake_share_server['id'], label='admin')
2894 ]) 2894 ]))
2895 2895
2896 @ddt.data( 2896 @ddt.data(
2897 {'network_info': {'network_type': 'vlan', 'segmentation_id': '100'}}, 2897 {'network_info': {'network_type': 'vlan', 'segmentation_id': '100'}},
@@ -3315,8 +3315,8 @@ class ShareManagerTestCase(test.TestCase):
3315 3315
3316 self.share_manager.create_share_group(self.context, "fake_id") 3316 self.share_manager.create_share_group(self.context, "fake_id")
3317 3317
3318 self.share_manager.db.share_group_update.\ 3318 (self.share_manager.db.share_group_update.
3319 assert_any_call(mock.ANY, 'fake_id', {'foo': 'bar'}) 3319 assert_any_call(mock.ANY, 'fake_id', {'foo': 'bar'}))
3320 self.share_manager.db.share_group_update.assert_any_call( 3320 self.share_manager.db.share_group_update.assert_any_call(
3321 mock.ANY, 'fake_id', { 3321 mock.ANY, 'fake_id', {
3322 'status': constants.STATUS_AVAILABLE, 3322 'status': constants.STATUS_AVAILABLE,
@@ -4090,8 +4090,8 @@ class ShareManagerTestCase(test.TestCase):
4090 self.share_manager.migration_wait_access_rules_timeout) 4090 self.share_manager.migration_wait_access_rules_timeout)
4091 4091
4092 if exc is None: 4092 if exc is None:
4093 self.share_manager.driver.connection_get_info.\ 4093 (self.share_manager.driver.connection_get_info.
4094 assert_called_once_with(self.context, instance, server) 4094 assert_called_once_with(self.context, instance, server))
4095 rpcapi.ShareAPI.connection_get_info.assert_called_once_with( 4095 rpcapi.ShareAPI.connection_get_info.assert_called_once_with(
4096 self.context, new_instance) 4096 self.context, new_instance)
4097 data_rpc.DataAPI.migration_start.assert_called_once_with( 4097 data_rpc.DataAPI.migration_start.assert_called_once_with(
@@ -4676,9 +4676,10 @@ class ShareManagerTestCase(test.TestCase):
4676 assert_called_once_with(self.context, share, instance['id'], 4676 assert_called_once_with(self.context, share, instance['id'],
4677 helper=helper, supress_errors=cancelled)) 4677 helper=helper, supress_errors=cancelled))
4678 if status == constants.TASK_STATE_MIGRATION_CANCELLED: 4678 if status == constants.TASK_STATE_MIGRATION_CANCELLED:
4679 self.share_manager.db.share_instance_update.\ 4679 (self.share_manager.db.share_instance_update.
4680 assert_called_once_with(self.context, instance['id'], 4680 assert_called_once_with(
4681 {'status': constants.STATUS_AVAILABLE}) 4681 self.context, instance['id'],
4682 {'status': constants.STATUS_AVAILABLE}))
4682 self.share_manager.db.share_update.assert_called_once_with( 4683 self.share_manager.db.share_update.assert_called_once_with(
4683 self.context, share['id'], 4684 self.context, share['id'],
4684 {'task_state': constants.TASK_STATE_MIGRATION_CANCELLED}) 4685 {'task_state': constants.TASK_STATE_MIGRATION_CANCELLED})
@@ -4847,8 +4848,8 @@ class ShareManagerTestCase(test.TestCase):
4847 self.share_manager.db.share_update.assert_called_once_with( 4848 self.share_manager.db.share_update.assert_called_once_with(
4848 self.context, share['id'], 4849 self.context, share['id'],
4849 {'task_state': constants.TASK_STATE_MIGRATION_COMPLETING}) 4850 {'task_state': constants.TASK_STATE_MIGRATION_COMPLETING})
4850 migration_api.ShareMigrationHelper.apply_new_access_rules.\ 4851 (migration_api.ShareMigrationHelper.apply_new_access_rules.
4851 assert_called_once_with(new_instance) 4852 assert_called_once_with(new_instance))
4852 delete_mock.assert_called_once_with(instance) 4853 delete_mock.assert_called_once_with(instance)
4853 4854
4854 @ddt.data(constants.TASK_STATE_MIGRATION_DRIVER_IN_PROGRESS, 4855 @ddt.data(constants.TASK_STATE_MIGRATION_DRIVER_IN_PROGRESS,
diff --git a/manila/tests/test_manager.py b/manila/tests/test_manager.py
index 25e874d..fb08c7e 100644
--- a/manila/tests/test_manager.py
+++ b/manila/tests/test_manager.py
@@ -110,9 +110,9 @@ class SchedulerDependentManagerTestCase(test.TestCase):
110 110
111 self.sched_manager._publish_service_capabilities(self.context) 111 self.sched_manager._publish_service_capabilities(self.context)
112 112
113 self.sched_manager.scheduler_rpcapi.update_service_capabilities.\ 113 (self.sched_manager.scheduler_rpcapi.update_service_capabilities.
114 assert_called_once_with( 114 assert_called_once_with(
115 self.context, self.service_name, self.host, last_capabilities) 115 self.context, self.service_name, self.host, last_capabilities))
116 manager.LOG.debug.assert_called_once_with(mock.ANY) 116 manager.LOG.debug.assert_called_once_with(mock.ANY)
117 117
118 @ddt.data(None, '', [], {}, {'foo': 'bar'}) 118 @ddt.data(None, '', [], {}, {'foo': 'bar'})
diff --git a/manila/tests/volume/test_cinder.py b/manila/tests/volume/test_cinder.py
index ea32c11..c95516d 100644
--- a/manila/tests/volume/test_cinder.py
+++ b/manila/tests/volume/test_cinder.py
@@ -263,14 +263,14 @@ class CinderApiTestCase(test.TestCase):
263 def test_initialize_connection(self): 263 def test_initialize_connection(self):
264 self.mock_object(self.cinderclient.volumes, 'initialize_connection') 264 self.mock_object(self.cinderclient.volumes, 'initialize_connection')
265 self.api.initialize_connection(self.ctx, 'id1', 'connector') 265 self.api.initialize_connection(self.ctx, 'id1', 'connector')
266 self.cinderclient.volumes.initialize_connection.\ 266 (self.cinderclient.volumes.initialize_connection.
267 assert_called_once_with('id1', 'connector') 267 assert_called_once_with('id1', 'connector'))
268 268
269 def test_terminate_connection(self): 269 def test_terminate_connection(self):
270 self.mock_object(self.cinderclient.volumes, 'terminate_connection') 270 self.mock_object(self.cinderclient.volumes, 'terminate_connection')
271 self.api.terminate_connection(self.ctx, 'id1', 'connector') 271 self.api.terminate_connection(self.ctx, 'id1', 'connector')
272 self.cinderclient.volumes.terminate_connection.\ 272 (self.cinderclient.volumes.terminate_connection.
273 assert_called_once_with('id1', 'connector') 273 assert_called_once_with('id1', 'connector'))
274 274
275 def test_delete(self): 275 def test_delete(self):
276 self.mock_object(self.cinderclient.volumes, 'delete') 276 self.mock_object(self.cinderclient.volumes, 'delete')