aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xci/exec_test.sh2
-rwxr-xr-xtestcases/OpenStack/tempest/run_tempest.py44
2 files changed, 45 insertions, 1 deletions
diff --git a/ci/exec_test.sh b/ci/exec_test.sh
index 89e29662b..dbf941087 100755
--- a/ci/exec_test.sh
+++ b/ci/exec_test.sh
@@ -147,6 +147,8 @@ function run_test(){
;;
"multisite")
python ${FUNCTEST_REPO_DIR}/testcases/features/multisite.py
+ python ${FUNCTEST_REPO_DIR}/testcases/OpenStack/tempest/run_tempest.py \
+ $clean_flag -s -m feature_multisite $report
;;
*)
echo "The test case '${test_name}' does not exist."
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()