diff options
-rw-r--r-- | sfc/tests/functest/run_tests.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sfc/tests/functest/run_tests.py b/sfc/tests/functest/run_tests.py index 204dd3a9..7060599d 100644 --- a/sfc/tests/functest/run_tests.py +++ b/sfc/tests/functest/run_tests.py @@ -58,6 +58,28 @@ def fetch_tackerc_file(controller_node): return rc_file +def disable_heat_resource_finder_cache(nodes): + controllers = [node for node in nodes if node.is_controller()] + remote_heat_conf = '/etc/heat/heat.conf' + local_heat_conf = '/tmp/heat.conf' + for controller in controllers: + logger.info("Fetch {0} from controller {1}" + .format(remote_heat_conf, controller.ip)) + controller.get_file(remote_heat_conf, local_heat_conf) + with open(local_heat_conf, 'a') as cfg: + cfg.write('\n[resource_finder_cache]\n') + cfg.write('caching=False\n') + logger.info("Replace {0} with {1} in controller {2}" + .format(remote_heat_conf, local_heat_conf, controller.ip)) + controller.run_cmd('rm -f {0}'.format(remote_heat_conf)) + controller.put_file(local_heat_conf, remote_heat_conf) + logger.info("Restart heat-engine in {0}".format(controller.ip)) + controller.run_cmd('service heat-engine restart') + os.remove(local_heat_conf) + logger.info("Waiting for heat-engine to restart in controllers") + time.sleep(10) + + def main(): deploymentHandler = DeploymentFactory.get_handler( COMMON_CONFIG.installer_type, @@ -73,6 +95,8 @@ def main(): a_controller = [node for node in nodes if node.is_controller()][0] + disable_heat_resource_finder_cache(nodes) + rc_file = fetch_tackerc_file(a_controller) os_utils.source_credentials(rc_file) |