From a5ee542bc03697f56a6d6f495aa2465b96ab01b3 Mon Sep 17 00:00:00 2001 From: Julien Leloup Date: Thu, 13 Feb 2014 14:29:02 +0100 Subject: [PATCH] cleanUp() removing all test resources as an admin Add a parameter in tempest.conf "full_clean_stack" to allow/prevent the use of cleanup() method at the end of a stress test run. This is mandatory to use stress tests in a multi-user environment since the actual cleanup() is designed to remove every object of every tenant (and thus will impact other users on the same openstack) Change-Id: I42dc9592617aeeca9660f670940ecbf50b6108ab Closes-Bug: #1273254 --- etc/tempest.conf.sample | 5 +++++ tempest/config.py | 7 ++++++- tempest/stress/driver.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index fe4959bd46..0ff01a151a 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -757,6 +757,11 @@ # value) #leave_dirty_stack=false +# Allows a full cleaning process after a stress test. Caution +# : this cleanup will remove every objects of every tenant. +# (boolean value) +#full_clean_stack=false + [telemetry] diff --git a/tempest/config.py b/tempest/config.py index d24ab34728..7bcb2954d4 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -591,7 +591,12 @@ StressGroup = [ default=False, help='Prevent the cleaning (tearDownClass()) between' ' each stress test run if an exception occurs' - ' during this run.') + ' during this run.'), + cfg.BoolOpt('full_clean_stack', + default=False, + help='Allows a full cleaning process after a stress test.' + ' Caution : this cleanup will remove every objects of' + ' every tenant.') ] diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py index d4689c4aa0..3715636bf4 100644 --- a/tempest/stress/driver.py +++ b/tempest/stress/driver.py @@ -220,7 +220,7 @@ def stress_openstack(tests, duration, max_runs=None, stop_on_error=False): LOG.info("Run %d actions (%d failed)" % (sum_runs, sum_fails)) - if not had_errors: + if not had_errors and CONF.stress.full_clean_stack: LOG.info("cleaning up") cleanup.cleanup() if had_errors: