avocado.job: Clean up tmp files after archive is done

We should avoid surprises made by misbehaved tests changing
the cwd directory and not setting it back, making cwd() to
point to an invalid dir.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 1500e11a
......@@ -222,11 +222,11 @@ class Job(object):
self.status = 'PASS'
# Let's clean up test artifacts
if self.args is not None:
if not self.args.keep_tmp_files:
data_dir.clean_tmp_files()
if self.args.archive:
name = os.path.basename(self.debugdir)
archive.create_zip(name, self.debugdir)
if not self.args.keep_tmp_files:
data_dir.clean_tmp_files()
tests_status = not bool(failures)
if tests_status:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册