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()
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()]
else:
if mode == 'smoke':
testr_mode = "smoke"
+ elif mode == 'feature_multisite':
+ testr_mode = " | grep kingbird "
elif mode == 'full':
testr_mode = ""
else:
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()