NFP - Modified node config update for FW and vpn service
VPN and Firewall node update restructured, Update is now handled in create first and delete later. external network name field added to nfp ini, changed corresponding code. Updated unit tests. Change-Id: I7c926e1cbb316397d9702ef39c3e70341d11d643 Co-Authored-By: ashutosh mishra <mca.ashu4@gmail.com> Co-Authored-By: Rajendra Machani <rajendra.machani@oneconvergence.com> Co-Authored-By: Ashok Pariya <pariya.ashok@gmail.com>
This commit is contained in:
@@ -591,11 +591,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
|
||||
request_data['config_policy_id'],
|
||||
network_function['tenant_id'],
|
||||
network_function)
|
||||
event_data = {
|
||||
'network_function_id': network_function['id']
|
||||
}
|
||||
mock_create_event.assert_called_once_with(
|
||||
'USER_CONFIG_DELETE_FAILED', event_data=event_data,
|
||||
'USER_CONFIG_DELETE_FAILED', event_data=request_data,
|
||||
is_internal_event=True)
|
||||
self.assertEqual(status, nso.STOP_POLLING)
|
||||
|
||||
@@ -619,10 +616,7 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
|
||||
network_function)
|
||||
db_nf = self.nfp_db.get_network_function(
|
||||
self.session, network_function['id'])
|
||||
self.assertEqual(None, db_nf['config_policy_id'])
|
||||
mock_create_event.assert_called_once_with(
|
||||
'UPDATE_USER_CONFIG_IN_PROGRESS', event_data=request_data,
|
||||
original_event=test_event)
|
||||
self.assertEqual('config_policy_id', db_nf['config_policy_id'])
|
||||
self.assertEqual(status, nso.STOP_POLLING)
|
||||
|
||||
def test_event_handle_user_config_delete_failed(self):
|
||||
|
||||
@@ -421,20 +421,6 @@ class TestHeatDriver(unittest.TestCase):
|
||||
stack_template['resources']['sc_firewall_policy'],
|
||||
copy.deepcopy(self.mock_dict.updated_template_sc_firewall_policy))
|
||||
|
||||
@mock.patch.object(gbp_client.Client, "list_l3_policies")
|
||||
def test_get_rvpn_l3_policy(self, mock_obj):
|
||||
mock_obj.return_value = self.mock_dict.l3_policies
|
||||
auth_token = 'asdaddasd'
|
||||
node_update = True
|
||||
expected_rvpn_l3_policy = {
|
||||
u'tenant_id': '8ae6701128994ab281dde6b92207bb19',
|
||||
u'name': u'remote-vpn-client-pool-cidr-l3policy'
|
||||
}
|
||||
rvpn_l3_policy = self.heat_driver_obj._get_rvpn_l3_policy(
|
||||
auth_token,
|
||||
self.mock_dict.provider_ptg, node_update)
|
||||
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")
|
||||
@@ -473,7 +459,8 @@ class TestHeatDriver(unittest.TestCase):
|
||||
pools.assert_called_once_with(
|
||||
subnet_id=[subnets.return_value['subnets'][0]['id']])
|
||||
|
||||
def test_create_node_config_data_vpn(self):
|
||||
@mock.patch.object(neutron_client.Client, "list_networks")
|
||||
def test_create_node_config_data_vpn(self, mock_list_networks):
|
||||
self.mock_objects()
|
||||
auth_token = 'asdasasd'
|
||||
tenant_id = '8ae6701128994ab281dde6b92207bb19'
|
||||
|
||||
@@ -250,9 +250,10 @@ class TestNeutronClient(SampleData):
|
||||
def test_get_floating_ips(self, mock_obj):
|
||||
instance = mock_obj.return_value
|
||||
obj = instance.list_floatingips()['floatingips']
|
||||
filters = {'tenant_id': self.TENANT_ID,
|
||||
'port_id': self.PORT_ID}
|
||||
retval = self.neutron_obj.get_floating_ips(self.AUTH_TOKEN,
|
||||
self.TENANT_ID,
|
||||
self.PORT_ID)
|
||||
**filters)
|
||||
self.assertEqual(retval, obj)
|
||||
mock_obj.assert_called_once_with(token=self.AUTH_TOKEN,
|
||||
endpoint_url=self.ENDPOINT_URL)
|
||||
|
||||
Reference in New Issue
Block a user