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
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index fe4959b..0ff01a1 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 d24ab34..7bcb295 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -591,7 +591,12 @@
                 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 d4689c4..3715636 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -220,7 +220,7 @@
     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: