From: jose.lausuch Date: Thu, 29 Jun 2017 09:07:47 +0000 (+0200) Subject: Remove BGPVPN utils in Functest X-Git-Tag: opnfv-5.0.RC1~290 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F36709%2F1;p=functest.git Remove BGPVPN utils in Functest These util functions should be under control of the SDNVPN project. After [1] and [2] it is safe to remove them in Functest [1] https://gerrit.opnfv.org/gerrit/#/c/36655/ [2] https://gerrit.opnfv.org/gerrit/#/c/36505/ Change-Id: I2f6596cd60678bb0c50adb9b4bc0d59545c3fb0a Signed-off-by: jose.lausuch --- diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py index 74b49aaaf..828fb3d45 100644 --- a/functest/tests/unit/utils/test_openstack_utils.py +++ b/functest/tests/unit/utils/test_openstack_utils.py @@ -255,12 +255,6 @@ class OSUtilsTesting(unittest.TestCase): 'delete_port.return_value': mock.Mock(), 'remove_interface_router.return_value': mock.Mock(), 'remove_gateway_router.return_value': mock.Mock(), - 'create_bgpvpn.return_value': self.mock_return, - 'create_network_association.return_value': self.mock_return, - 'create_router_association.return_value': self.mock_return, - 'update_bgpvpn.return_value': self.mock_return, - 'delete_bgpvpn.return_value': self.mock_return, - 'show_bgpvpn.return_value': self.mock_return, 'list_security_groups.return_value': {'security_groups': [self.sec_group]}, 'list_security_group_rules.' @@ -1212,53 +1206,6 @@ class OSUtilsTesting(unittest.TestCase): 'router_id')) self.assertTrue(mock_logger_error.called) - def test_create_bgpvpn(self): - self.assertEqual(openstack_utils. - create_bgpvpn(self.neutron_client), - self.mock_return) - - def test_create_network_association(self): - self.assertEqual(openstack_utils. - create_network_association(self.neutron_client, - 'bgpvpn_id', - 'network_id'), - self.mock_return) - - def test_create_router_association(self): - self.assertEqual(openstack_utils. - create_router_association(self.neutron_client, - 'bgpvpn_id', - 'router_id'), - self.mock_return) - - def test_update_bgpvpn(self): - self.assertEqual(openstack_utils. - update_bgpvpn(self.neutron_client, - 'bgpvpn_id'), - self.mock_return) - - def test_delete_bgpvpn(self): - self.assertEqual(openstack_utils. - delete_bgpvpn(self.neutron_client, - 'bgpvpn_id'), - self.mock_return) - - def test_get_bgpvpn(self): - self.assertEqual(openstack_utils. - get_bgpvpn(self.neutron_client, - 'bgpvpn_id'), - self.mock_return) - - def test_get_bgpvpn_routers(self): - with mock.patch('functest.utils.openstack_utils.' - 'get_bgpvpn', - return_value={'bgpvpn': - {'routers': [self.router]}}): - self.assertEqual(openstack_utils. - get_bgpvpn_routers(self.neutron_client, - 'bgpvpn_id'), - [self.router]) - def test_get_security_groups_default(self): self.assertEqual(openstack_utils. get_security_groups(self.neutron_client), diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py index e7cdfc862..0ab630583 100644 --- a/functest/utils/openstack_utils.py +++ b/functest/utils/openstack_utils.py @@ -962,43 +962,6 @@ def create_shared_network_full(net_name, subnt_name, router_name, subnet_cidr): return network_dic -def create_bgpvpn(neutron_client, **kwargs): - # route_distinguishers - # route_targets - json_body = {"bgpvpn": kwargs} - return neutron_client.create_bgpvpn(json_body) - - -def create_network_association(neutron_client, bgpvpn_id, neutron_network_id): - json_body = {"network_association": {"network_id": neutron_network_id}} - return neutron_client.create_network_association(bgpvpn_id, json_body) - - -def create_router_association(neutron_client, bgpvpn_id, router_id): - json_body = {"router_association": {"router_id": router_id}} - return neutron_client.create_router_association(bgpvpn_id, json_body) - - -def update_bgpvpn(neutron_client, bgpvpn_id, **kwargs): - json_body = {"bgpvpn": kwargs} - return neutron_client.update_bgpvpn(bgpvpn_id, json_body) - - -def delete_bgpvpn(neutron_client, bgpvpn_id): - return neutron_client.delete_bgpvpn(bgpvpn_id) - - -def get_bgpvpn(neutron_client, bgpvpn_id): - return neutron_client.show_bgpvpn(bgpvpn_id) - - -def get_bgpvpn_routers(neutron_client, bgpvpn_id): - return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['routers'] - - -def get_bgpvpn_networks(neutron_client, bgpvpn_id): - return get_bgpvpn(neutron_client, bgpvpn_id)['bgpvpn']['networks'] - # ********************************************* # SEC GROUPS # *********************************************