Leave any cleanup for the end

This commit is contained in:
Pedro Algarvio 2014-06-14 14:03:38 +01:00
parent c2ab05bc56
commit ccdd70750c
2 changed files with 7 additions and 11 deletions

View file

@ -591,7 +591,6 @@ class TestDaemon(object):
pass
self._exit_mockbin()
self._exit_ssh()
self._clean()
def pre_setup_minions(self):
'''
@ -693,19 +692,11 @@ class TestDaemon(object):
pass
os.environ['PATH'] = os.pathsep.join(path_items)
def _clean(self):
@classmethod
def clean(cls):
'''
Clean out the tmp files
'''
if not self.parser.options.clean:
return
if os.path.isdir(self.sub_minion_opts['root_dir']):
shutil.rmtree(self.sub_minion_opts['root_dir'])
if os.path.isdir(self.master_opts['root_dir']):
shutil.rmtree(self.master_opts['root_dir'])
if os.path.isdir(self.syndic_master_opts['root_dir']):
shutil.rmtree(self.syndic_master_opts['root_dir'])
for dirname in (TMP, TMP_STATE_TREE, TMP_PRODENV_STATE_TREE):
if os.path.isdir(dirname):
shutil.rmtree(dirname)

View file

@ -195,6 +195,11 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
# Transplant configuration
TestDaemon.transplant_configs(transport=self.options.transport)
def post_execution_cleanup(self):
SaltTestsuiteParser.post_execution_cleanup(self)
if self.options.clean:
TestDaemon.clean()
def run_integration_suite(self, suite_folder, display_name):
'''
Run an integration test suite