summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomsou <soth@intracom-telecom.com>2017-05-22 09:14:22 +0000
committertomsou <soth@intracom-telecom.com>2017-05-31 13:19:43 +0000
commitde80ee56c458b127be3497f3882bc1c962f42dfe (patch)
treec2c415ece2c7e6aabf7a0a59493485787142e6b1
parent9fb7fad2a9f83ddb7d0c1f61b2d5609352fb6f15 (diff)
Cleanup after testcase running
After every testcase running cleanup neutron and nova elements: - Allocated floating IPs (nova) - Created instances (nova) - Created images (nova) - Created router-subnet interfaces (neutron) - Created gateaway routers (neutron) - Created routers (neutron) - Created subnets (neutron) - Created networks (neutron) - Created bgpvpns (neutron) JIRA: SDNVPN-145 JIRA: SDNVPN-148 Change-Id: Id6df004bb9d0d394e2cf39692b624607167c9a6c Signed-off-by: tomsou <soth@intracom-telecom.com>
-rw-r--r--sdnvpn/lib/utils.py76
-rw-r--r--sdnvpn/test/functest/testcase_1.py30
-rw-r--r--sdnvpn/test/functest/testcase_2.py23
-rw-r--r--sdnvpn/test/functest/testcase_3.py44
-rw-r--r--sdnvpn/test/functest/testcase_4.py36
-rw-r--r--sdnvpn/test/functest/testcase_7.py25
-rw-r--r--sdnvpn/test/functest/testcase_8.py33
7 files changed, 228 insertions, 39 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py
index 3bac483..7e41d41 100644
--- a/sdnvpn/lib/utils.py
+++ b/sdnvpn/lib/utils.py
@@ -536,3 +536,79 @@ def detach_instance_from_ext_br(instance, compute_node):
sudo brctl delbr {bridge}
"""
compute_node.run_cmd(cmd.format(bridge=bridge))
+
+
+def cleanup_neutron(neutron_client, bgpvpn_ids, interfaces, subnet_ids,
+ router_ids, network_ids):
+
+ if len(bgpvpn_ids) != 0:
+ for bgpvpn_id in bgpvpn_ids:
+ os_utils.delete_bgpvpn(neutron_client, bgpvpn_id)
+
+ if len(interfaces) != 0:
+ for router_id, subnet_id in interfaces:
+ if not os_utils.remove_interface_router(neutron_client,
+ router_id, subnet_id):
+ logging.error('Fail to delete all interface routers. '
+ 'Interface router with id {} was not deleted.'.
+ format(router_id))
+
+ if len(router_ids) != 0:
+ for router_id in router_ids:
+ if not os_utils.remove_gateway_router(neutron_client, router_id):
+ logging.error('Fail to delete all gateway routers. '
+ 'Gateway router with id {} was not deleted.'.
+ format(router_id))
+
+ if len(subnet_ids) != 0:
+ for subnet_id in subnet_ids:
+ if not os_utils.delete_neutron_subnet(neutron_client, subnet_id):
+ logging.error('Fail to delete all subnets. '
+ 'Subnet with id {} was not deleted.'.
+ format(subnet_id))
+ return False
+
+ if len(router_ids) != 0:
+ for router_id in router_ids:
+ if not os_utils.delete_neutron_router(neutron_client, router_id):
+ logging.error('Fail to delete all routers. '
+ 'Router with id {} was not deleted.'.
+ format(router_id))
+ return False
+
+ if len(network_ids) != 0:
+ for network_id in network_ids:
+ if not os_utils.delete_neutron_net(neutron_client, network_id):
+ logging.error('Fail to delete all networks. '
+ 'Network with id {} was not deleted.'.
+ format(network_id))
+ return False
+ return True
+
+
+def cleanup_nova(nova_client, floatingip_ids, instance_ids, image_ids):
+
+ if len(floatingip_ids) != 0:
+ for floatingip_id in floatingip_ids:
+ if not os_utils.delete_floating_ip(nova_client, floatingip_id):
+ logging.error('Fail to delete all floating ips. '
+ 'Floating ip with id {} was not deleted.'.
+ format(floatingip_id))
+ return False
+
+ if len(instance_ids) != 0:
+ for instance_id in instance_ids:
+ if not os_utils.delete_instance(nova_client, instance_id):
+ logging.error('Fail to delete all instances. '
+ 'Instance with id {} was not deleted.'.
+ format(instance_id))
+ return False
+
+ if len(image_ids) != 0:
+ for image_id in image_ids:
+ if not os_utils.delete_glance_image(nova_client, image_id):
+ logging.error('Fail to delete all images. '
+ 'Image with id {} was not deleted.'.
+ format(image_id))
+ return False
+ return True
diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py
index 544d30f..2cd03b6 100644
--- a/sdnvpn/test/functest/testcase_1.py
+++ b/sdnvpn/test/functest/testcase_1.py
@@ -43,26 +43,33 @@ def main():
neutron_client = os_utils.get_neutron_client()
glance_client = os_utils.get_glance_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
image_id = os_utils.create_glance_image(glance_client,
TESTCASE_CONFIG.image_name,
COMMON_CONFIG.image_path,
disk=COMMON_CONFIG.image_format,
container="bare",
public='public')
+ image_ids.append(image_id)
+
network_1_id = test_utils.create_net(neutron_client,
TESTCASE_CONFIG.net_1_name)
- test_utils.create_subnet(neutron_client,
- TESTCASE_CONFIG.subnet_1_name,
- TESTCASE_CONFIG.subnet_1_cidr,
- network_1_id)
+ subnet_1_id = test_utils.create_subnet(neutron_client,
+ TESTCASE_CONFIG.subnet_1_name,
+ TESTCASE_CONFIG.subnet_1_cidr,
+ network_1_id)
network_2_id = test_utils.create_net(neutron_client,
TESTCASE_CONFIG.net_2_name)
- test_utils.create_subnet(neutron_client,
- TESTCASE_CONFIG.subnet_2_name,
- TESTCASE_CONFIG.subnet_2_cidr,
- network_2_id)
+ subnet_2_id = test_utils.create_subnet(neutron_client,
+ TESTCASE_CONFIG.subnet_2_name,
+ TESTCASE_CONFIG.subnet_2_cidr,
+ network_2_id)
+ network_ids.extend([network_1_id, network_2_id])
+ subnet_ids.extend([subnet_1_id, subnet_2_id])
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
@@ -132,6 +139,7 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1,
userdata=u1)
+ instance_ids.extend([vm_1.id, vm_2.id, vm_3.id, vm_4.id, vm_5.id])
msg = ("Create VPN with eRT<>iRT")
results.record_action(msg)
@@ -145,6 +153,7 @@ def main():
bgpvpn = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn_id = bgpvpn['bgpvpn']['id']
logger.debug("VPN created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_1_name)
results.record_action(msg)
@@ -203,6 +212,11 @@ def main():
results.get_ping_status(vm_1, vm_4, expected="PASS", timeout=30)
results.get_ping_status(vm_1, vm_5, expected="PASS", timeout=30)
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
+
return results.compile_summary()
diff --git a/sdnvpn/test/functest/testcase_2.py b/sdnvpn/test/functest/testcase_2.py
index e24cfc0..61d81a3 100644
--- a/sdnvpn/test/functest/testcase_2.py
+++ b/sdnvpn/test/functest/testcase_2.py
@@ -44,6 +44,9 @@ def main():
neutron_client = os_utils.get_neutron_client()
glance_client = os_utils.get_glance_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
logger.debug("Using private key %s injected to the VMs."
% COMMON_CONFIG.keyfile_path)
keyfile = open(COMMON_CONFIG.keyfile_path, 'r')
@@ -57,15 +60,17 @@ def main():
disk=COMMON_CONFIG.image_format,
container="bare",
public='public')
+ image_ids.append(image_id)
+
network_1_id = test_utils.create_net(
neutron_client,
TESTCASE_CONFIG.net_1_name)
- test_utils.create_subnet(
+ subnet_1a_id = test_utils.create_subnet(
neutron_client,
TESTCASE_CONFIG.subnet_1a_name,
TESTCASE_CONFIG.subnet_1a_cidr,
network_1_id)
- test_utils.create_subnet(
+ subnet_1b_id = test_utils.create_subnet(
neutron_client,
TESTCASE_CONFIG.subnet_1b_name,
TESTCASE_CONFIG.subnet_1b_cidr,
@@ -74,16 +79,18 @@ def main():
network_2_id = test_utils.create_net(
neutron_client,
TESTCASE_CONFIG.net_2_name)
- test_utils.create_subnet(
+ subnet_2a_id = test_utils.create_subnet(
neutron_client,
TESTCASE_CONFIG.subnet_2a_name,
TESTCASE_CONFIG.subnet_2a_cidr,
network_2_id)
- test_utils.create_subnet(
+ subnet_2b_id = test_utils.create_subnet(
neutron_client,
TESTCASE_CONFIG.subnet_2b_name,
TESTCASE_CONFIG.subnet_2b_cidr,
network_2_id)
+ network_ids.extend([network_1_id, network_2_id])
+ subnet_ids.extend([subnet_1a_id, subnet_1b_id, subnet_2a_id, subnet_2b_id])
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
@@ -164,6 +171,7 @@ def main():
compute_node=av_zone_1,
userdata=u1,
files=files)
+ instance_ids.extend([vm_1.id, vm_2.id, vm_3.id, vm_4.id, vm_5.id])
msg = ("Create VPN1 with eRT=iRT")
results.record_action(msg)
@@ -176,6 +184,7 @@ def main():
bgpvpn1 = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn1_id = bgpvpn1['bgpvpn']['id']
logger.debug("VPN1 created details: %s" % bgpvpn1)
+ bgpvpn_ids.append(bgpvpn1_id)
msg = ("Associate network '%s' to the VPN." % TESTCASE_CONFIG.net_1_name)
results.record_action(msg)
@@ -218,6 +227,7 @@ def main():
bgpvpn2 = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn2_id = bgpvpn2['bgpvpn']['id']
logger.debug("VPN created details: %s" % bgpvpn2)
+ bgpvpn_ids.append(bgpvpn2_id)
msg = ("Associate network '%s' to the VPN2." % TESTCASE_CONFIG.net_2_name)
results.record_action(msg)
@@ -243,6 +253,11 @@ def main():
expected="not reachable",
timeout=30)
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
+
return results.compile_summary()
diff --git a/sdnvpn/test/functest/testcase_3.py b/sdnvpn/test/functest/testcase_3.py
index b906be6..85a8827 100644
--- a/sdnvpn/test/functest/testcase_3.py
+++ b/sdnvpn/test/functest/testcase_3.py
@@ -149,6 +149,9 @@ def main():
nova_client = os_utils.get_nova_client()
neutron_client = os_utils.get_neutron_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
TESTCASE_CONFIG.secgroup_descr)
@@ -156,18 +159,26 @@ def main():
test_utils.open_http_port(neutron_client, sg_id)
test_utils.open_bgp_port(neutron_client, sg_id)
- net_id, _, _ = test_utils.create_network(neutron_client,
- TESTCASE_CONFIG.net_1_name,
- TESTCASE_CONFIG.subnet_1_name,
- TESTCASE_CONFIG.subnet_1_cidr,
- TESTCASE_CONFIG.router_1_name)
-
- quagga_net_id, _, _ = test_utils.create_network(
+ net_id, subnet_1_id, router_1_id = test_utils.create_network(
neutron_client,
- TESTCASE_CONFIG.quagga_net_name,
- TESTCASE_CONFIG.quagga_subnet_name,
- TESTCASE_CONFIG.quagga_subnet_cidr,
- TESTCASE_CONFIG.quagga_router_name)
+ TESTCASE_CONFIG.net_1_name,
+ TESTCASE_CONFIG.subnet_1_name,
+ TESTCASE_CONFIG.subnet_1_cidr,
+ TESTCASE_CONFIG.router_1_name)
+
+ quagga_net_id, subnet_quagga_id, \
+ router_quagga_id = test_utils.create_network(
+ neutron_client,
+ TESTCASE_CONFIG.quagga_net_name,
+ TESTCASE_CONFIG.quagga_subnet_name,
+ TESTCASE_CONFIG.quagga_subnet_cidr,
+ TESTCASE_CONFIG.quagga_router_name)
+
+ interfaces.append(tuple((router_1_id, subnet_1_id)))
+ interfaces.append(tuple((router_quagga_id, subnet_quagga_id)))
+ network_ids.extend([net_id, quagga_net_id])
+ router_ids.extend([router_1_id, router_quagga_id])
+ subnet_ids.extend([subnet_1_id, subnet_quagga_id])
installer_type = str(os.environ['INSTALLER_TYPE'].lower())
if installer_type == "fuel":
@@ -185,6 +196,8 @@ def main():
container="bare",
public="public")
+ image_ids.append(ubuntu_image_id)
+
# NOTE(rski) The order of this seems a bit weird but
# there is a reason for this, namely
# https://jira.opnfv.org/projects/SDNVPN/issues/SDNVPN-99
@@ -198,6 +211,8 @@ def main():
# fake_fip is needed to bypass NAT
# see below for the reason why.
fake_fip = os_utils.create_floating_ip(neutron_client)
+
+ floatingip_ids.extend([fip['fip_id'], fake_fip['fip_id']])
# pin quagga to some compute
compute_node = nova_client.hypervisors.list()[0]
quagga_compute_node = "nova:" + compute_node.hypervisor_hostname
@@ -225,6 +240,8 @@ def main():
userdata=quagga_bootstrap_script,
compute_node=quagga_compute_node)
+ instance_ids.append(quagga_vm)
+
fip_added = os_utils.add_floating_ip(nova_client,
quagga_vm.id,
fip['fip_addr'])
@@ -265,6 +282,11 @@ def main():
finally:
test_utils.detach_instance_from_ext_br(quagga_vm, compute)
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
+
return results.compile_summary()
diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py
index c91af24..69c3461 100644
--- a/sdnvpn/test/functest/testcase_4.py
+++ b/sdnvpn/test/functest/testcase_4.py
@@ -43,13 +43,18 @@ def main():
neutron_client = os_utils.get_neutron_client()
glance_client = os_utils.get_glance_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
image_id = os_utils.create_glance_image(glance_client,
TESTCASE_CONFIG.image_name,
COMMON_CONFIG.image_path,
disk=COMMON_CONFIG.image_format,
container="bare",
public='public')
- network_1_id, _, router_1_id = test_utils.create_network(
+ image_ids.append(image_id)
+
+ network_1_id, subnet_1_id, router_1_id = test_utils.create_network(
neutron_client,
TESTCASE_CONFIG.net_1_name,
TESTCASE_CONFIG.subnet_1_name,
@@ -59,14 +64,21 @@ def main():
network_2_id = test_utils.create_net(
neutron_client,
TESTCASE_CONFIG.net_2_name)
- test_utils.create_subnet(neutron_client,
- TESTCASE_CONFIG.subnet_2_name,
- TESTCASE_CONFIG.subnet_2_cidr,
- network_2_id)
- sg_id = os_utils.create_security_group_full(neutron_client,
- TESTCASE_CONFIG.secgroup_name,
- TESTCASE_CONFIG.secgroup_descr)
+ subnet_2_id = test_utils.create_subnet(
+ neutron_client,
+ TESTCASE_CONFIG.subnet_2_name,
+ TESTCASE_CONFIG.subnet_2_cidr,
+ network_2_id)
+ interfaces.append(tuple((router_1_id, subnet_1_id)))
+ network_ids.extend([network_1_id, network_2_id])
+ router_ids.append(router_1_id)
+ subnet_ids.extend([subnet_1_id, subnet_2_id])
+
+ sg_id = os_utils.create_security_group_full(
+ neutron_client,
+ TESTCASE_CONFIG.secgroup_name,
+ TESTCASE_CONFIG.secgroup_descr)
compute_nodes = test_utils.assert_and_get_compute_nodes(nova_client)
@@ -133,6 +145,8 @@ def main():
compute_node=av_zone_1,
userdata=u1)
+ instance_ids.extend([vm_1.id, vm_2.id, vm_3.id, vm_4.id, vm_5.id])
+
msg = ("Create VPN with eRT<>iRT")
results.record_action(msg)
vpn_name = "sdnvpn-" + str(randint(100000, 999999))
@@ -143,6 +157,7 @@ def main():
bgpvpn = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn_id = bgpvpn['bgpvpn']['id']
logger.debug("VPN created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
msg = ("Associate router '%s' to the VPN." % TESTCASE_CONFIG.router_1_name)
results.record_action(msg)
@@ -204,6 +219,11 @@ def main():
results.add_to_summary(0, "=")
logger.info("\n%s" % results.summary)
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
+
return results.compile_summary()
diff --git a/sdnvpn/test/functest/testcase_7.py b/sdnvpn/test/functest/testcase_7.py
index 659f46a..48e26d5 100644
--- a/sdnvpn/test/functest/testcase_7.py
+++ b/sdnvpn/test/functest/testcase_7.py
@@ -52,25 +52,37 @@ def main():
neutron_client = os_utils.get_neutron_client()
glance_client = os_utils.get_glance_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
image_id = os_utils.create_glance_image(glance_client,
TESTCASE_CONFIG.image_name,
COMMON_CONFIG.image_path,
disk=COMMON_CONFIG.image_format,
container="bare",
public='public')
- network_1_id, _, _ = test_utils.create_network(
+ image_ids.append(image_id)
+
+ network_1_id, subnet_1_id, router_1_id = test_utils.create_network(
neutron_client,
TESTCASE_CONFIG.net_1_name,
TESTCASE_CONFIG.subnet_1_name,
TESTCASE_CONFIG.subnet_1_cidr,
TESTCASE_CONFIG.router_1_name)
- network_2_id, _, _ = test_utils.create_network(
+
+ network_2_id, subnet_2_id, router_2_id = test_utils.create_network(
neutron_client,
TESTCASE_CONFIG.net_2_name,
TESTCASE_CONFIG.subnet_2_name,
TESTCASE_CONFIG.subnet_2_cidr,
TESTCASE_CONFIG.router_2_name)
+ interfaces.append(tuple((router_1_id, subnet_1_id)))
+ interfaces.append(tuple((router_2_id, subnet_2_id)))
+ network_ids.extend([network_1_id, network_2_id])
+ router_ids.extend([router_1_id, router_2_id])
+ subnet_ids.extend([subnet_1_id, subnet_2_id])
+
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
TESTCASE_CONFIG.secgroup_descr)
@@ -96,6 +108,8 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
userdata=u1)
+ instance_ids.extend([vm_1.id, vm_2.id])
+
msg = ("Create VPN with eRT==iRT")
results.record_action(msg)
vpn_name = "sdnvpn-7"
@@ -106,6 +120,7 @@ def main():
bgpvpn = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn_id = bgpvpn['bgpvpn']['id']
logger.debug("VPN created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
msg = ("Associate networks '%s', '%s' to the VPN."
% (TESTCASE_CONFIG.net_1_name,
@@ -147,6 +162,12 @@ def main():
results.ping_ip_test(fip['fip_addr'])
+ floatingip_ids.append(fip['fip_id'])
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
+
return results.compile_summary()
diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py
index d1e34ed..f08ead2 100644
--- a/sdnvpn/test/functest/testcase_8.py
+++ b/sdnvpn/test/functest/testcase_8.py
@@ -52,13 +52,18 @@ def main():
neutron_client = os_utils.get_neutron_client()
glance_client = os_utils.get_glance_client()
+ (floatingip_ids, instance_ids, router_ids, network_ids, image_ids,
+ subnet_ids, interfaces, bgpvpn_ids) = ([] for i in range(8))
+
image_id = os_utils.create_glance_image(glance_client,
TESTCASE_CONFIG.image_name,
COMMON_CONFIG.image_path,
disk=COMMON_CONFIG.image_format,
container="bare",
public='public')
- network_1_id, _, router_1_id = test_utils.create_network(
+ image_ids.append(image_id)
+
+ network_1_id, subnet_1_id, router_1_id = test_utils.create_network(
neutron_client,
TESTCASE_CONFIG.net_1_name,
TESTCASE_CONFIG.subnet_1_name,
@@ -67,10 +72,17 @@ def main():
network_2_id = test_utils.create_net(
neutron_client,
TESTCASE_CONFIG.net_2_name)
- test_utils.create_subnet(neutron_client,
- TESTCASE_CONFIG.subnet_2_name,
- TESTCASE_CONFIG.subnet_2_cidr,
- network_2_id)
+
+ subnet_2_id = test_utils.create_subnet(
+ neutron_client,
+ TESTCASE_CONFIG.subnet_2_name,
+ TESTCASE_CONFIG.subnet_2_cidr,
+ network_2_id)
+
+ interfaces.append(tuple((router_1_id, subnet_1_id)))
+ network_ids.extend([network_1_id, network_2_id])
+ router_ids.append(router_1_id)
+ subnet_ids.extend([subnet_1_id, subnet_2_id])
sg_id = os_utils.create_security_group_full(neutron_client,
TESTCASE_CONFIG.secgroup_name,
@@ -96,9 +108,10 @@ def main():
sg_id,
secgroup_name=TESTCASE_CONFIG.secgroup_name,
userdata=u1)
+ instance_ids.extend([vm_1.id, vm_2.id])
results.record_action("Create VPN with eRT==iRT")
- vpn_name = "sdnvpn-7"
+ vpn_name = "sdnvpn-8"
kwargs = {"import_targets": TESTCASE_CONFIG.targets,
"export_targets": TESTCASE_CONFIG.targets,
"route_distinguishers": TESTCASE_CONFIG.route_distinguishers,
@@ -106,6 +119,7 @@ def main():
bgpvpn = os_utils.create_bgpvpn(neutron_client, **kwargs)
bgpvpn_id = bgpvpn['bgpvpn']['id']
logger.debug("VPN created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
msg = ("Associate router '%s' and net '%s' to the VPN."
% (TESTCASE_CONFIG.router_1_name,
@@ -138,6 +152,7 @@ def main():
results.record_action(msg)
fip = os_utils.create_floating_ip(neutron_client)
+
fip_added = os_utils.add_floating_ip(nova_client, vm_1.id, fip['fip_addr'])
if fip_added:
results.add_success(msg)
@@ -149,6 +164,12 @@ def main():
results.add_to_summary(0, "-")
results.ping_ip_test(fip['fip_addr'])
+ floatingip_ids.append(fip['fip_id'])
+
+ test_utils.cleanup_nova(nova_client, floatingip_ids, instance_ids,
+ image_ids)
+ test_utils.cleanup_neutron(neutron_client, bgpvpn_ids, interfaces,
+ subnet_ids, router_ids, network_ids)
return results.compile_summary()