From: Tomas Sedovic Date: Thu, 30 Aug 2012 13:44:41 +0000 (+0200) Subject: Make sure the functional test always cleans up X-Git-Tag: 2014.1~1494^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=384a865bcb18dc62a9f719b2c94ea7f4301fbbd1;p=openstack-build%2Fheat-build.git Make sure the functional test always cleans up Change-Id: I740f676452905d3aceb3d2df37e4c4cdb6b81d7e Signed-off-by: Tomas Sedovic --- diff --git a/heat/tests/functional/test_WordPress_Single_Instance.py b/heat/tests/functional/test_WordPress_Single_Instance.py index c14d99a4..48623961 100644 --- a/heat/tests/functional/test_WordPress_Single_Instance.py +++ b/heat/tests/functional/test_WordPress_Single_Instance.py @@ -20,24 +20,24 @@ from nose.plugins.attrib import attr @attr(speed='slow') @attr(tag=['func', 'wordpress']) def test_template(): - - template = 'WordPress_Single_Instance.template' - - func_utils = util.FuncUtils() - - func_utils.prepare_jeos('F17', 'x86_64', 'cfntools') - func_utils.create_stack(template, 'F17') - func_utils.check_cfntools() - func_utils.wait_for_provisioning() - func_utils.check_user_data(template) - - ssh = func_utils.get_ssh_client() - - # ensure wordpress was installed - wp_file = '/etc/wordpress/wp-config.php' - stdin, stdout, sterr = ssh.exec_command('ls ' + wp_file) - result = stdout.readlines().pop().rstrip() - assert result == wp_file - print "Wordpress installation detected" - - func_utils.cleanup() + try: + template = 'WordPress_Single_Instance.template' + + func_utils = util.FuncUtils() + + func_utils.prepare_jeos('F17', 'x86_64', 'cfntools') + func_utils.create_stack(template, 'F17') + func_utils.check_cfntools() + func_utils.wait_for_provisioning() + func_utils.check_user_data(template) + + ssh = func_utils.get_ssh_client() + + # ensure wordpress was installed + wp_file = '/etc/wordpress/wp-config.php' + stdin, stdout, sterr = ssh.exec_command('ls ' + wp_file) + result = stdout.readlines().pop().rstrip() + assert result == wp_file + print "Wordpress installation detected" + finally: + func_utils.cleanup()