aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack/tempest/run_tempest.py
diff options
context:
space:
mode:
authormeimei <meimei@huawei.com>2016-07-14 12:04:37 +0800
committermei mei <meimei@huawei.com>2016-07-14 08:51:46 +0000
commita11fa0a172000d106b6168b3a0ecde3bc1e82163 (patch)
tree052bbf08034a4c431ebe17f4177a91d44fd3aa1b /testcases/OpenStack/tempest/run_tempest.py
parent4cc4bc0f88091246ac1bf3dcea89e4b281d64e1e (diff)
[multisite] integrate kingbird tempest testcases
JIRA: FUNCTEST-179 Change-Id: I4a8ae43e2814b3d859c32a6278671f87155aa855 Signed-off-by: meimei <meimei@huawei.com>
Diffstat (limited to 'testcases/OpenStack/tempest/run_tempest.py')
-rwxr-xr-xtestcases/OpenStack/tempest/run_tempest.py44
1 files changed, 43 insertions, 1 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py
index a16ba26f7..ab79a8768 100755
--- a/testcases/OpenStack/tempest/run_tempest.py
+++ b/testcases/OpenStack/tempest/run_tempest.py
@@ -33,7 +33,7 @@ import functest.utils.openstack_utils as os_utils
modes = ['full', 'smoke', 'baremetal', 'compute', 'data_processing',
'identity', 'image', 'network', 'object_storage', 'orchestration',
- 'telemetry', 'volume', 'custom', 'defcore']
+ 'telemetry', 'volume', 'custom', 'defcore', 'feature_multisite']
""" tests configuration """
parser = argparse.ArgumentParser()
@@ -211,6 +211,45 @@ def configure_tempest(deployment_dir):
return True
+def configure_tempest_feature(deployment_dir, mode):
+ """
+ Add/update needed parameters into tempest.conf file generated by Rally
+ """
+
+ logger.debug("Finding tempest.conf file...")
+ tempest_conf_file = deployment_dir + "/tempest.conf"
+ if not os.path.isfile(tempest_conf_file):
+ logger.error("Tempest configuration file %s NOT found."
+ % tempest_conf_file)
+ exit(-1)
+
+ logger.debug("Updating selected tempest.conf parameters...")
+ config = ConfigParser.RawConfigParser()
+ config.read(tempest_conf_file)
+ if mode == 'feature_multisite':
+ config.set('service_available', 'kingbird', 'true')
+ cmd = "openstack endpoint show kingbird | grep publicurl |\
+ awk '{print $4}' | awk -F '/' '{print $3}'"
+ kingbird_endpoint_url = os.popen(cmd).read()
+ cmd = "openstack endpoint show kingbird | grep publicurl |\
+ awk '{print $4}' | awk -F '/' '{print $4}'"
+ kingbird_api_version = os.popen(cmd).read()
+ try:
+ config.add_section("kingbird")
+ except:
+ logger.info('kingbird section exist')
+ config.set('kingbird', 'endpoint_type', 'publicURL')
+ config.set('kingbird', 'TIME_TO_SYNC', '20')
+ config.set('kingbird', 'endpoint_url', kingbird_endpoint_url)
+ config.set('kingbird', 'api_version', kingbird_api_version)
+ with open(tempest_conf_file, 'wb') as config_file:
+ config.write(config_file)
+
+ # Copy tempest.conf to /home/opnfv/functest/results/tempest/
+ shutil.copyfile(tempest_conf_file, TEMPEST_RESULTS_DIR + '/tempest.conf')
+ return True
+
+
def read_file(filename):
with open(filename) as src:
return [line.strip() for line in src.readlines()]
@@ -230,6 +269,8 @@ def generate_test_list(deployment_dir, mode):
else:
if mode == 'smoke':
testr_mode = "smoke"
+ elif mode == 'feature_multisite':
+ testr_mode = " | grep kingbird "
elif mode == 'full':
testr_mode = ""
else:
@@ -365,6 +406,7 @@ def main():
deployment_dir = ft_utils.get_deployment_dir(logger)
configure_tempest(deployment_dir)
+ configure_tempest_feature(deployment_dir, args.mode)
create_tempest_resources()
generate_test_list(deployment_dir, args.mode)
apply_tempest_blacklist()