+
+def backup_tempest_config(conf_file):
+ """
+ Copy config file to tempest results directory
+ """
+ if not os.path.exists(TEMPEST_RESULTS_DIR):
+ os.makedirs(TEMPEST_RESULTS_DIR)
+
+ shutil.copyfile(conf_file,
+ os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
+
+
+def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None,
+ MODE=None):
+ """
+ Calls rally verify and updates the generated tempest.conf with
+ given parameters
+ """
+ conf_file = configure_verifier(deployment_dir)
+ configure_tempest_update_params(conf_file,
+ IMAGE_ID, FLAVOR_ID)
+ if MODE == 'feature_multisite':
+ configure_tempest_multisite_params(conf_file)
+
+
+def configure_tempest_defcore(deployment_dir, img_flavor_dict):
+ """
+ Add/update needed parameters into tempest.conf file
+ """
+ conf_file = configure_verifier(deployment_dir)
+ configure_tempest_update_params(conf_file,
+ img_flavor_dict.get("image_id"),
+ img_flavor_dict.get("flavor_id"))
+
+ logger.debug("Updating selected tempest.conf parameters for defcore...")
+ config = ConfigParser.RawConfigParser()
+ config.read(conf_file)
+ config.set('compute', 'image_ref', img_flavor_dict.get("image_id"))
+ config.set('compute', 'image_ref_alt',
+ img_flavor_dict['image_id_alt'])
+ config.set('compute', 'flavor_ref', img_flavor_dict.get("flavor_id"))
+ config.set('compute', 'flavor_ref_alt',
+ img_flavor_dict['flavor_id_alt'])
+
+ with open(conf_file, 'wb') as config_file:
+ config.write(config_file)
+
+ confpath = os.path.join(CONST.dir_functest_test,
+ CONST.refstack_tempest_conf_path)
+ shutil.copyfile(conf_file, confpath)
+
+
+def configure_tempest_update_params(tempest_conf_file,
+ IMAGE_ID=None, FLAVOR_ID=None):
+ """
+ Add/update needed parameters into tempest.conf file
+ """