aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack/rally
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-07 22:13:42 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-09-08 10:45:45 +0800
commit55d301a2622ff5b63d431b9272caa68224d53843 (patch)
treeb540f05ba3ed45e15260ee7131ce90dc93af753d /testcases/OpenStack/rally
parent227afb8285b8f178987a7d6eb1d28a74201a5d1b (diff)
make use of functest_utils.get_parameter_from_yaml
JIRA: FUNCTEST-463 Change-Id: I1d54a65c5bfa2542f2fd3a2e408967641e6e4ac9 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testcases/OpenStack/rally')
-rwxr-xr-xtestcases/OpenStack/rally/run_rally-cert.py74
1 files changed, 37 insertions, 37 deletions
diff --git a/testcases/OpenStack/rally/run_rally-cert.py b/testcases/OpenStack/rally/run_rally-cert.py
index 536b4a5c..29fd0a33 100755
--- a/testcases/OpenStack/rally/run_rally-cert.py
+++ b/testcases/OpenStack/rally/run_rally-cert.py
@@ -26,7 +26,7 @@ import iniparse
import yaml
import functest.utils.functest_logger as ft_logger
-import functest.utils.functest_utils as functest_utils
+import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
tests = ['authenticate', 'glance', 'cinder', 'heat', 'keystone',
@@ -72,11 +72,9 @@ else:
logger = ft_logger.Logger("run_rally").getLogger()
-functest_yaml = functest_utils.get_functest_yaml()
-
HOME = os.environ['HOME'] + "/"
-RALLY_DIR = functest_utils.FUNCTEST_REPO + '/' + \
- functest_yaml.get("general").get("directories").get("dir_rally")
+RALLY_DIR = ft_utils.FUNCTEST_REPO + '/' + \
+ ft_utils.get_functest_config('general.directories.dir_rally')
TEMPLATE_DIR = RALLY_DIR + "scenario/templates"
SUPPORT_DIR = RALLY_DIR + "scenario/support"
TEMP_DIR = RALLY_DIR + "var"
@@ -88,25 +86,27 @@ TENANTS_AMOUNT = 3
ITERATIONS_AMOUNT = 10
CONCURRENCY = 4
-RESULTS_DIR = functest_yaml.get("general").get("directories").get(
- "dir_rally_res")
-TEMPEST_CONF_FILE = functest_yaml.get("general").get("directories").get(
- "dir_results") + '/tempest/tempest.conf'
-TEST_DB = functest_yaml.get("results").get("test_db_url")
-
-PRIVATE_NET_NAME = functest_yaml.get("rally").get("network_name")
-PRIVATE_SUBNET_NAME = functest_yaml.get("rally").get("subnet_name")
-PRIVATE_SUBNET_CIDR = functest_yaml.get("rally").get("subnet_cidr")
-ROUTER_NAME = functest_yaml.get("rally").get("router_name")
-
-GLANCE_IMAGE_NAME = functest_yaml.get("general").get("openstack").get(
- "image_name")
-GLANCE_IMAGE_FILENAME = functest_yaml.get("general").get("openstack").get(
- "image_file_name")
-GLANCE_IMAGE_FORMAT = functest_yaml.get("general").get("openstack").get(
- "image_disk_format")
-GLANCE_IMAGE_PATH = functest_yaml.get("general").get("directories").get(
- "dir_functest_data") + "/" + GLANCE_IMAGE_FILENAME
+RESULTS_DIR = \
+ ft_utils.get_functest_config('general.directories.dir_rally_res')
+TEMPEST_CONF_FILE = \
+ ft_utils.get_functest_config('general.directories.dir_results') + \
+ '/tempest/tempest.conf'
+TEST_DB = ft_utils.get_functest_config('results.test_db_url')
+
+PRIVATE_NET_NAME = ft_utils.get_functest_config('rally.network_name')
+PRIVATE_SUBNET_NAME = ft_utils.get_functest_config('rally.subnet_name')
+PRIVATE_SUBNET_CIDR = ft_utils.get_functest_config('rally.subnet_cidr')
+ROUTER_NAME = ft_utils.get_functest_config('rally.router_name')
+
+GLANCE_IMAGE_NAME = \
+ ft_utils.get_functest_config('general.openstack.image_name')
+GLANCE_IMAGE_FILENAME = \
+ ft_utils.get_functest_config('general.openstack.image_file_name')
+GLANCE_IMAGE_FORMAT = \
+ ft_utils.get_functest_config('general.openstack.image_disk_format')
+GLANCE_IMAGE_PATH = \
+ ft_utils.get_functest_config('general.directories.dir_functest_data') + \
+ "/" + GLANCE_IMAGE_FILENAME
CINDER_VOLUME_TYPE_NAME = "volume_test"
@@ -409,12 +409,12 @@ def run_task(test_name):
if args.report:
stop_time = time.time()
logger.debug("Push Rally detailed results into DB")
- functest_utils.push_results_to_db("functest",
- "Rally_details",
- start_time,
- stop_time,
- status,
- json_data)
+ ft_utils.push_results_to_db("functest",
+ "Rally_details",
+ start_time,
+ stop_time,
+ status,
+ json_data)
def main():
@@ -533,7 +533,7 @@ def main():
case_name = "rally_full"
# Evaluation of the success criteria
- status = functest_utils.check_success_rate(case_name, success_rate)
+ status = ft_utils.check_success_rate(case_name, success_rate)
exit_code = -1
if status == "PASS":
@@ -541,12 +541,12 @@ def main():
if args.report:
logger.debug("Pushing Rally summary into DB...")
- functest_utils.push_results_to_db("functest",
- case_name,
- start_time,
- stop_time,
- status,
- payload)
+ ft_utils.push_results_to_db("functest",
+ case_name,
+ start_time,
+ stop_time,
+ status,
+ payload)
if args.noclean:
exit(exit_code)