aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-03-20 10:33:32 +0200
committerManuel Buil <mbuil@suse.com>2017-03-20 11:23:47 +0000
commit9727edd0a8d5297c0d7ac54af52e6572e8a9b2f2 (patch)
tree372993686e2e8a606e4cac489827d91b96977b74
parent247498e3ea26d4de127de9f1c296fd80408b8a55 (diff)
Disable resource_finder_cache in controllers
Heat caching somehow messes our tests so we disable it before the tests start. For instance, if we do: 1. create example-net with NET_ID1 2. create VNFD1 with example-net 3. delete VNFD1 4. delete NET_ID1 5. create example-net with NET_ID2 6. create VNFD2 with example-net heat has NET_ID1 cached as the id of example-net and tries to use that instead of NET_ID2 to create VNFD2. This off course leads to a crash since NET_ID1 does not exist anymore. In the future we should investigate further why heat cache does not play well for us (probably bc of tacker). Change-Id: Iac07d78641e2d1ff0c2d67e46752d551833f19fd Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com> (cherry picked from commit d0fec46322915ef8b49e1f7ab9c485ea2cdd399a)
-rw-r--r--sfc/tests/functest/run_tests.py24
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)