From 551cb1892b32e8461d0d4ce556454528722f473f Mon Sep 17 00:00:00 2001 From: James Laska Date: Thu, 27 Feb 2014 11:44:13 -0500 Subject: [PATCH] Always run cleanup after running cloud_integration tests --- test/integration/Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/integration/Makefile b/test/integration/Makefile index 7cdae607df0..33ffc3a969b 100644 --- a/test/integration/Makefile +++ b/test/integration/Makefile @@ -15,14 +15,27 @@ test_hash: cloud: amazon rackspace +cloud_cleanup: amazon_cleanup rackspace_cleanup + +amazon_cleanup: + python cleanup_ec2.py -y + +rackspace_cleanup: + @echo "FIXME - cleanup_rax.py not yet implemented" + @#python cleanup_rax.py -y + credentials.yml: @echo "No credentials.yml file found. A file named 'credentials.yml' is needed to provide credentials needed to run cloud tests." @exit 1 amazon: credentials.yml - ansible-playbook amazon.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) - @# FIXME - Cleanup won't run if the previous tests fail - python cleanup_ec2.py -y + ansible-playbook amazon.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) ; \ + RC=$$? ; \ + make amazon_cleanup ; \ + exit $$RC; rackspace: credentials.yml - ansible-playbook rackspace.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) + ansible-playbook rackspace.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) ; \ + RC=$$? ; \ + make rackspace_cleanup ; \ + exit $$RC;