aboutsummaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'testcases')
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/clean_openstack.py27
-rwxr-xr-xtestcases/VIM/OpenStack/CI/libraries/run_rally-cert.py4
-rw-r--r--testcases/functest_utils.py13
3 files changed, 23 insertions, 21 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
index 8a49843d5..464defcc9 100644
--- a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
+++ b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
@@ -91,7 +91,7 @@ def remove_instances(nova_client):
if functest_utils.delete_instance(nova_client, instance_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"instance %s..." % instance_id)
timeout = 50
@@ -121,7 +121,7 @@ def remove_images(nova_client):
if functest_utils.delete_glance_image(nova_client, image_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the"
+ logger.error("There has been a problem removing the"
"image %s..." % image_id)
else:
logger.debug(" > this is a default image and will NOT be deleted.")
@@ -146,7 +146,7 @@ def remove_volumes(cinder_client):
forced=True):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"volume %s..." % volume_id)
@@ -163,7 +163,7 @@ def remove_floatingips(nova_client):
if functest_utils.delete_floating_ip(nova_client, fip_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"floating IP %s..." % fip_id)
timeout = 50
@@ -218,7 +218,7 @@ def remove_networks(neutron_client):
if functest_utils.delete_neutron_net(neutron_client, net_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"network %s..." % net_id)
@@ -237,7 +237,7 @@ def remove_ports(neutron_client, ports, network_ids):
if functest_utils.delete_neutron_port(neutron_client, port_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"port %s ..." %port_id)
force_remove_port(neutron_client, port_id)
@@ -249,7 +249,7 @@ def remove_ports(neutron_client, ports, network_ids):
time.sleep(5) # leave 5 seconds to detach before doing anything else
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"interface %s from router %s..." %(subnet_id,router_id))
force_remove_port(neutron_client, port_id)
else:
@@ -265,7 +265,8 @@ def force_remove_port(neutron_client, port_id):
if functest_utils.delete_neutron_port(neutron_client, port_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: Deleting port %s failed" % port_id)
+ logger.error("There has been a problem removing "
+ "the port %s..." % port_id)
def remove_routers(neutron_client, routers):
@@ -279,7 +280,7 @@ def remove_routers(neutron_client, routers):
if functest_utils.remove_gateway_router(neutron_client, router_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing "
+ logger.error("There has been a problem removing "
"the gateway...")
else:
logger.debug("Router is not connected to anything. Ready to remove...")
@@ -287,7 +288,7 @@ def remove_routers(neutron_client, routers):
if functest_utils.delete_neutron_router(neutron_client, router_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"router '%s'(%s)..." % (router_name, router_id))
@@ -307,7 +308,7 @@ def remove_security_groups(neutron_client):
if functest_utils.delete_security_group(neutron_client, secgroup_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"security group %s..." % secgroup_id)
else:
logger.debug(" > this is a default security group and will NOT "
@@ -330,7 +331,7 @@ def remove_users(keystone_client):
if functest_utils.delete_user(keystone_client,user_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"user '%s'(%s)..." % (user_name,user_id))
else:
logger.debug(" > this is a default user and will NOT be deleted.")
@@ -352,7 +353,7 @@ def remove_tenants(keystone_client):
if functest_utils.delete_tenant(keystone_client,tenant_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
+ logger.error("There has been a problem removing the "
"tenant '%s'(%s)..." % (tenant_name,tenant_id))
else:
logger.debug(" > this is a default tenant and will NOT be deleted.")
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
index d2ac62ac1..d77cd4083 100755
--- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
+++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
@@ -277,9 +277,9 @@ def run_task(test_name):
""" parse JSON operation result """
if task_succeed(json_results):
- logger.info("Test OK.")
+ logger.info('{} test OK.'.format(test_name) + "\n")
else:
- logger.info("Test Failed.")
+ logger.info('{} test Failed.'.format(test_name) + "\n")
def main():
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index c548c899a..da79c2c9a 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -284,7 +284,7 @@ def create_neutron_router(neutron_client, name):
router = neutron_client.create_router(json_body)
return router['router']['id']
except Exception, e:
- print "Error [create_neutron_router(neutron_client, name)]:" % name, e
+ print "Error [create_neutron_router(neutron_client, '%s')]:" % name, e
return False
@@ -435,7 +435,7 @@ def update_sg_quota(neutron_client, tenant_id, sg_quota, sg_rule_quota):
return True
except Exception, e:
print "Error [update_sg_quota(neutron_client, '%s', '%s', "\
- "'%s')]:" %(tenant_id,sg_quota, sg_rule_quota), e
+ "'%s')]:" %(tenant_id, sg_quota, sg_rule_quota), e
return False
@@ -485,7 +485,7 @@ def create_glance_image(glance_client, image_name, file_path, public=True):
return image.id
except Exception, e:
print "Error [create_glance_image(glance_client, '%s', '%s', "\
- "'%s')]:" %(image_name,file_path, str(public)), e
+ "'%s')]:" %(image_name, file_path, str(public)), e
return False
@@ -494,7 +494,7 @@ def delete_glance_image(nova_client, image_id):
nova_client.images.delete(image_id)
return True
except Exception, e:
- print "Error [delete_glance_image(nova_client, image_id)]:" % image_id, e
+ print "Error [delete_glance_image(nova_client, '%s')]:" % image_id, e
return False
@@ -792,7 +792,8 @@ def push_results_to_db(db_url, case_name, logger, pod_name,
logger.debug(r)
return True
except Exception, e:
- print "Error []:", e
+ print "Error [push_results_to_db('%s', '%s', '%s', '%s', '%s')]:" \
+ % (db_url, case_name, pod_name, version, payload), e
return False
@@ -836,7 +837,7 @@ def getTestEnv(test, functest_yaml):
# if not defined in dependencies => no dependencies
config_test = ""
except Exception, e:
- print "Error []:", e
+ print "Error [getTestEnv]:", e
return config_test