diff options
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index fe18181f2b..c1dc86e5db 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py | |||
@@ -23,6 +23,7 @@ import unittest | |||
23 | from datetime import datetime, timedelta | 23 | from datetime import datetime, timedelta |
24 | from functools import partial | 24 | from functools import partial |
25 | 25 | ||
26 | import oe.path | ||
26 | from oeqa.utils.commands import CommandError, runCmd, get_bb_vars | 27 | from oeqa.utils.commands import CommandError, runCmd, get_bb_vars |
27 | from oeqa.utils.git import GitError, GitRepo | 28 | from oeqa.utils.git import GitError, GitRepo |
28 | 29 | ||
@@ -297,29 +298,21 @@ class BuildPerfTestCase(unittest.TestCase): | |||
297 | shutil.move(self.bb_vars['BUILDSTATS_BASE'], | 298 | shutil.move(self.bb_vars['BUILDSTATS_BASE'], |
298 | os.path.join(self.out_dir, 'buildstats-' + self.name)) | 299 | os.path.join(self.out_dir, 'buildstats-' + self.name)) |
299 | 300 | ||
300 | @staticmethod | ||
301 | def force_rm(path): | ||
302 | """Equivalent of 'rm -rf'""" | ||
303 | if os.path.isfile(path) or os.path.islink(path): | ||
304 | os.unlink(path) | ||
305 | elif os.path.isdir(path): | ||
306 | shutil.rmtree(path) | ||
307 | |||
308 | def rm_tmp(self): | 301 | def rm_tmp(self): |
309 | """Cleanup temporary/intermediate files and directories""" | 302 | """Cleanup temporary/intermediate files and directories""" |
310 | log.debug("Removing temporary and cache files") | 303 | log.debug("Removing temporary and cache files") |
311 | for name in ['bitbake.lock', 'conf/sanity_info', | 304 | for name in ['bitbake.lock', 'conf/sanity_info', |
312 | self.bb_vars['TMPDIR']]: | 305 | self.bb_vars['TMPDIR']]: |
313 | self.force_rm(name) | 306 | oe.path.remove(name, recurse=True) |
314 | 307 | ||
315 | def rm_sstate(self): | 308 | def rm_sstate(self): |
316 | """Remove sstate directory""" | 309 | """Remove sstate directory""" |
317 | log.debug("Removing sstate-cache") | 310 | log.debug("Removing sstate-cache") |
318 | self.force_rm(self.bb_vars['SSTATE_DIR']) | 311 | oe.path.remove(self.bb_vars['SSTATE_DIR'], recurse=True) |
319 | 312 | ||
320 | def rm_cache(self): | 313 | def rm_cache(self): |
321 | """Drop bitbake caches""" | 314 | """Drop bitbake caches""" |
322 | self.force_rm(self.bb_vars['PERSISTENT_DIR']) | 315 | oe.path.remove(self.bb_vars['PERSISTENT_DIR'], recurse=True) |
323 | 316 | ||
324 | @staticmethod | 317 | @staticmethod |
325 | def sync(): | 318 | def sync(): |