NFP -Added Cluster ID fix

Added cluster id in vip_pt, provider pt for
LB service.

Change-Id: I3388b482d3a5fe96aa64ebde2837130092351338
This commit is contained in:
Ashutosh Mishra
2016-09-11 23:10:41 +05:30
parent 7f41e94f71
commit adc1a2fe9f
4 changed files with 127 additions and 15 deletions

View File

@@ -554,7 +554,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
status = self.service_orchestrator.check_for_user_config_deleted(
test_event)
mock_is_config_delete_complete.assert_called_once_with(
request_data['heat_stack_id'], network_function['tenant_id'])
request_data['heat_stack_id'], network_function['tenant_id'],
network_function)
db_nf = self.nfp_db.get_network_function(
self.session, network_function['id'])
self.assertEqual(network_function['status'], db_nf['status'])
@@ -573,7 +574,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
status = self.service_orchestrator.check_for_user_config_deleted(
test_event)
mock_is_config_delete_complete.assert_called_once_with(
request_data['heat_stack_id'], network_function['tenant_id'])
request_data['heat_stack_id'], network_function['tenant_id'],
network_function)
event_data = {
'network_function_id': network_function['id']
}
@@ -596,7 +598,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
status = self.service_orchestrator.check_for_user_config_deleted(
test_event)
mock_is_config_delete_complete.assert_called_once_with(
request_data['heat_stack_id'], network_function['tenant_id'])
request_data['heat_stack_id'], network_function['tenant_id'],
network_function)
db_nf = self.nfp_db.get_network_function(
self.session, network_function['id'])
self.assertEqual(None, db_nf['heat_stack_id'])

View File

@@ -435,10 +435,12 @@ class TestHeatDriver(unittest.TestCase):
self.assertEqual(rvpn_l3_policy, expected_rvpn_l3_policy)
@mock.patch.object(gbp_client.Client, "create_policy_target")
@mock.patch.object(gbp_client.Client, "update_policy_target")
@mock.patch.object(neutron_client.Client, "list_subnets")
@mock.patch.object(neutron_client.Client, "list_pools")
@mock.patch.object(neutron_client.Client, "show_vip")
def test_create_policy_target_for_vip(self, vip, pools, subnets, pt):
def test_create_policy_target_for_vip(self, vip, pools, subnets,
pt, pt_update):
pt.return_value = {
'policy_target': {
'name': 'service_target_provider_0132c_00b93'
@@ -458,6 +460,12 @@ class TestHeatDriver(unittest.TestCase):
auth_token = 'adsdsdd'
provider_tenant_id = '8ae6701128994ab281dde6b92207bb19'
provider = self.mock_dict.provider_ptg
self.heat_driver_obj.gbp_client.get_policy_targets = (
mock.MagicMock(
return_value=self.mock_dict.policy_targets[
'policy_targets']))
self.heat_driver_obj.keystoneclient.get_admin_token = (
mock.MagicMock(return_value='token'))
self.heat_driver_obj._create_policy_target_for_vip(
auth_token, provider_tenant_id, provider)
pools.assert_called_once_with(