summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test/functest
diff options
context:
space:
mode:
authortomsou <soth@intracom-telecom.com>2017-10-24 17:37:37 +0300
committertomsou <soth@intracom-telecom.com>2017-11-06 13:10:38 +0200
commita6e207c16430055eba8bcc8586b09a7081db3d04 (patch)
treea9d7c527e7292d714f5bca534d6d203ba4ad461e /sdnvpn/test/functest
parent4245d81de9226f64321dcd828e2a91ac912cf7d7 (diff)
Fix instance boot when metadata exists
The way that a instance is considered as UP is pretty strict and returns ERROR in case of instances with userdata This patch differentiates the instances that are supposed to boot till login prompt and those with userdata parameter JIRA: SDNVPN-177 Change-Id: Ic4755366df006669475c90cc0693ac802256f379 Signed-off-by: tomsou <soth@intracom-telecom.com>
Diffstat (limited to 'sdnvpn/test/functest')
-rw-r--r--sdnvpn/test/functest/testcase_1.py11
-rw-r--r--sdnvpn/test/functest/testcase_10.py13
-rw-r--r--sdnvpn/test/functest/testcase_2.py16
-rw-r--r--sdnvpn/test/functest/testcase_4.py11
-rw-r--r--sdnvpn/test/functest/testcase_7.py10
-rw-r--r--sdnvpn/test/functest/testcase_8.py10
6 files changed, 37 insertions, 34 deletions
diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py
index 718f305..2c4ddbe 100644
--- a/sdnvpn/test/functest/testcase_1.py
+++ b/sdnvpn/test/functest/testcase_1.py
@@ -154,13 +154,12 @@ def main():
test_utils.create_network_association(
neutron_client, bgpvpn_id, network_1_id)
- # Wait for VMs to get ips.
- instances_up = test_utils.wait_for_instances_up(vm_1, vm_2,
- vm_3, vm_4,
- vm_5)
+ # Wait for VMs to be ready.
+ instances_up = test_utils.wait_for_instances_up(vm_2, vm_3, vm_5)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1, vm_4)
- if not instances_up:
- logger.error("One or more instances is down")
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
# TODO: Handle this appropriately
results.get_ping_status(vm_1, vm_2, expected="PASS", timeout=200)
diff --git a/sdnvpn/test/functest/testcase_10.py b/sdnvpn/test/functest/testcase_10.py
index 557b658..5a88603 100644
--- a/sdnvpn/test/functest/testcase_10.py
+++ b/sdnvpn/test/functest/testcase_10.py
@@ -142,11 +142,11 @@ def main():
instance_ids.extend([vm_1.id, vm_3.id])
# Wait for VMs to get ips.
- instances_up = test_utils.wait_for_instances_up(vm_1, vm_2,
- vm_3)
+ instances_up = test_utils.wait_for_instances_up(vm_2)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1, vm_3)
- if not instances_up:
- logger.error("One or more instances is down")
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
# TODO: Handle this appropriately
# Create monitor threads to monitor traffic between vm_1, vm_2 and vm_3
m = Manager()
@@ -208,9 +208,10 @@ def main():
compute_node=av_zone_1,
userdata=u4)
instance_ids.append(vm_4.id)
+
# Wait for VMs to get ips.
- instances_up = test_utils.wait_for_instances_up(vm_4)
- if not instances_up:
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_4)
+ if not instances_dhcp_up:
logger.error("Instance vm_4 failed to start.")
# TODO: Handle this appropriately
# Create and start a new monitor thread for vm_4
diff --git a/sdnvpn/test/functest/testcase_2.py b/sdnvpn/test/functest/testcase_2.py
index bc37c5c..928656e 100644
--- a/sdnvpn/test/functest/testcase_2.py
+++ b/sdnvpn/test/functest/testcase_2.py
@@ -200,16 +200,12 @@ def main():
neutron_client, bgpvpn1_id, network_1_id)
# Wait for VMs to get ips.
- instances_up = test_utils.wait_for_instances_up(vm_1,
- vm_2,
- # vm_3,
- vm_4,
- # vm_5
- )
-
- if not instances_up:
- logger.error("One or more instances is down")
- sys.exit(-1)
+ instances_up = test_utils.wait_for_instances_up(vm_2)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1, vm_4)
+
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
+ # TODO: Handle this appropriately
logger.info("Waiting for the VMs to connect to each other using the"
" updated network configuration")
diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py
index f6748f9..9b1c1fa 100644
--- a/sdnvpn/test/functest/testcase_4.py
+++ b/sdnvpn/test/functest/testcase_4.py
@@ -162,13 +162,12 @@ def main():
neutron_client, bgpvpn_id, router_1_id)
# Wait for VMs to get ips.
- instances_up = test_utils.wait_for_instances_up(vm_1, vm_2,
- vm_3, vm_4,
- vm_5)
+ instances_up = test_utils.wait_for_instances_up(vm_2, vm_3, vm_5)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1, vm_4)
- if not instances_up:
- logger.error("One or more instances is down")
- # TODO Handle appropriately
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
+ # TODO: Handle this appropriately
results.get_ping_status(vm_1, vm_2, expected="PASS", timeout=200)
results.get_ping_status(vm_1, vm_3, expected="PASS", timeout=30)
diff --git a/sdnvpn/test/functest/testcase_7.py b/sdnvpn/test/functest/testcase_7.py
index 65a77b6..e018022 100644
--- a/sdnvpn/test/functest/testcase_7.py
+++ b/sdnvpn/test/functest/testcase_7.py
@@ -132,9 +132,13 @@ def main():
test_utils.wait_for_bgp_net_assoc(
neutron_client, bgpvpn_id, network_2_id)
- instances_up = test_utils.wait_for_instances_up(vm_1, vm_2)
- if not instances_up:
- logger.error("One or more instances is down")
+ # Wait for VMs to get ips.
+ instances_up = test_utils.wait_for_instances_up(vm_2)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1)
+
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
+ # TODO: Handle this appropriately
logger.info("Waiting for the VMs to connect to each other using the"
" updated network configuration")
diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py
index abb111f..b166362 100644
--- a/sdnvpn/test/functest/testcase_8.py
+++ b/sdnvpn/test/functest/testcase_8.py
@@ -131,9 +131,13 @@ def main():
test_utils.wait_for_bgp_net_assoc(
neutron_client, bgpvpn_id, network_2_id)
- instances_up = test_utils.wait_for_instances_up(vm_1, vm_2)
- if not instances_up:
- logger.error("One or more instances is down")
+ # Wait for VMs to get ips.
+ instances_up = test_utils.wait_for_instances_up(vm_2)
+ instances_dhcp_up = test_utils.wait_for_instances_get_dhcp(vm_1)
+
+ if (not instances_up or not instances_dhcp_up):
+ logger.error("One or more instances are down")
+ # TODO: Handle this appropriately
logger.info("Waiting for the VMs to connect to each other using the"
" updated network configuration")