summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomanos Skiadas <rski@intracom-telecom.com>2016-12-02 10:01:12 +0200
committerRomanos Skiadas <rski@intracom-telecom.com>2016-12-02 10:24:02 +0200
commit1709d20268322703a3fa31bc0d3df8a5c669d488 (patch)
tree8a7f186bbfee2efbfb7bf9e259418f929763e199
parentecec8d640a8ac1f2c82a63326073bb6baddb9b6f (diff)
Move logging instance creation to create_instance
Change-Id: I299f2be3b127aefdd7036fa68fb934b09d278692 Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
-rw-r--r--test/functest/testcase_1.py10
-rw-r--r--test/functest/testcase_2.py10
-rw-r--r--test/functest/testcase_4.py11
-rw-r--r--test/functest/utils.py3
4 files changed, 4 insertions, 30 deletions
diff --git a/test/functest/testcase_1.py b/test/functest/testcase_1.py
index 1d19924..eba39bb 100644
--- a/test/functest/testcase_1.py
+++ b/test/functest/testcase_1.py
@@ -83,8 +83,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1)
vm_2_ip = vm_2.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_2_name, vm_2_ip))
vm_3 = test_utils.create_instance(
nova_client,
@@ -95,8 +93,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2)
vm_3_ip = vm_3.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_3_name, vm_3_ip))
vm_5 = test_utils.create_instance(
nova_client,
@@ -107,8 +103,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2)
vm_5_ip = vm_5.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_5_name, vm_5_ip))
# We boot vm5 first because we need vm5_ip for vm4 userdata
u4 = test_utils.generate_ping_userdata([vm_5_ip])
@@ -122,8 +116,6 @@ def main():
compute_node=av_zone_1,
userdata=u4)
vm_4_ip = vm_4.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_4_name, vm_4_ip))
# We boot VM1 at the end because we need to get the IPs first to generate
# the userdata
@@ -141,8 +133,6 @@ def main():
compute_node=av_zone_1,
userdata=u1)
vm_1_ip = vm_1.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_1_name, vm_1_ip))
msg = ("Create VPN with eRT<>iRT")
logger.info(msg)
diff --git a/test/functest/testcase_2.py b/test/functest/testcase_2.py
index e1b6863..d1f7001 100644
--- a/test/functest/testcase_2.py
+++ b/test/functest/testcase_2.py
@@ -97,8 +97,6 @@ def main():
compute_node=av_zone_1,
userdata=userdata_common)
vm_2_ip = vm_2.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_2_name, vm_2_ip))
vm_3 = test_utils.create_instance(
nova_client,
@@ -111,8 +109,6 @@ def main():
compute_node=av_zone_2,
userdata=userdata_common)
vm_3_ip = vm_3.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_3_name, vm_3_ip))
vm_5 = test_utils.create_instance(
nova_client,
@@ -125,8 +121,6 @@ def main():
compute_node=av_zone_2,
userdata=userdata_common)
vm_5_ip = vm_5.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_5_name, vm_5_ip))
# We boot vm5 first because we need vm5_ip for vm4 userdata
u4 = test_utils.generate_userdata_with_ssh(
@@ -145,8 +139,6 @@ def main():
userdata=u4,
files=files)
vm_4_ip = vm_4.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_4_name, vm_4_ip))
# We boot VM1 at the end because we need to get the IPs first to generate
# the userdata
@@ -167,8 +159,6 @@ def main():
userdata=u1,
files=files)
vm_1_ip = vm_1.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_1_name, vm_1_ip))
msg = ("Create VPN1 with eRT=iRT")
logger.info(msg)
diff --git a/test/functest/testcase_4.py b/test/functest/testcase_4.py
index 6866b1d..bb25cce 100644
--- a/test/functest/testcase_4.py
+++ b/test/functest/testcase_4.py
@@ -83,8 +83,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_1)
vm_2_ip = vm_2.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_2_name, vm_2_ip))
vm_3 = test_utils.create_instance(
nova_client,
@@ -95,8 +93,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2)
vm_3_ip = vm_3.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_3_name, vm_3_ip))
vm_5 = test_utils.create_instance(
nova_client,
@@ -107,8 +103,6 @@ def main():
secgroup_name=TESTCASE_CONFIG.secgroup_name,
compute_node=av_zone_2)
vm_5_ip = vm_5.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_5_name, vm_5_ip))
# We boot vm5 first because we need vm5_ip for vm4 userdata
u4 = test_utils.generate_ping_userdata([vm_5_ip])
@@ -122,8 +116,6 @@ def main():
compute_node=av_zone_1,
userdata=u4)
vm_4_ip = vm_4.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_4_name, vm_4_ip))
# We boot VM1 at the end because we need to get the IPs first to generate
# the userdata
@@ -141,8 +133,7 @@ def main():
compute_node=av_zone_1,
userdata=u1)
vm_1_ip = vm_1.networks.itervalues().next()[0]
- logger.debug("Instance '%s' booted successfully. IP='%s'." %
- (TESTCASE_CONFIG.instance_1_name, vm_1_ip))
+
msg = ("Create VPN with eRT<>iRT")
logger.info(msg)
results.add_to_summary(1, msg)
diff --git a/test/functest/utils.py b/test/functest/utils.py
index 351797b..90dfe93 100644
--- a/test/functest/utils.py
+++ b/test/functest/utils.py
@@ -112,6 +112,9 @@ def create_instance(nova_client,
if instance is None:
logger.error("Error while booting instance.")
sys.exit(-1)
+ else:
+ logger.debug("Instance '%s' booted successfully. IP='%s'." %
+ (name, instance.networks.itervalues().next()[0]))
# Retrieve IP of INSTANCE
# instance_ip = instance.networks.get(network_id)[0]