diff options
author | dimitris.tsiolakis <dmts@intracom-telecom.com> | 2018-06-26 11:20:31 +0300 |
---|---|---|
committer | Dimitris Tsiolakis <dmts@intracom-telecom.com> | 2018-06-29 06:55:45 +0000 |
commit | 8e60d220cbe67c9274b32dfe8d73e1c16351a80f (patch) | |
tree | 9deabb5b2cf24e75ac900e37d25971638000174e | |
parent | 48cf1c7577afc9e2def8065b21c5a39f1b57674c (diff) |
Clean up stale routers and gateway routers.opnfv-6.2.0
During snaps_smoke test all floating IPs are allocated
by routers as external IP's, as a result there are no
more floating IPs left.
This patch clean up stale routers and free the assigned
IPs.
JIRA: SNAPS-318
Change-Id: Ifbf01ce38db63315e692dca9ffa5d993dbfa4337
Signed-off-by: dimitris.tsiolakis <dmts@intracom-telecom.com>
(cherry picked from commit 71737f23f718791a554edf374ee0c28bb77c9773)
-rw-r--r-- | sdnvpn/test/functest/run_sdnvpn_tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sdnvpn/test/functest/run_sdnvpn_tests.py b/sdnvpn/test/functest/run_sdnvpn_tests.py index e4d55f1..7f11683 100644 --- a/sdnvpn/test/functest/run_sdnvpn_tests.py +++ b/sdnvpn/test/functest/run_sdnvpn_tests.py @@ -70,6 +70,24 @@ class SdnvpnFunctest(feature.Feature): os_utils.delete_floating_ip( neutron_client, floating_ip['id']) + # Workaround for + # https://jira.opnfv.org/browse/SNAPS-318 + # Clean up the stale routers + logger.info("Cleaning up the stale routers") + ports = os_utils.get_port_list(neutron_client) + if ports is not None: + for port in ports: + if port['device_owner'] == 'network:router_interface': + os_utils.delete_neutron_port( + neutron_client, port['id']) + routers = os_utils.get_router_list(neutron_client) + if routers is not None: + for router in routers: + os_utils.remove_gateway_router( + neutron_client, router['id']) + os_utils.delete_neutron_router( + neutron_client, router['id']) + with open(COMMON_CONFIG.config_file) as f: config_yaml = yaml.safe_load(f) |