diff options
-rw-r--r-- | meta/lib/oeqa/selftest/base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py index 47a8ea8271..43a1951be3 100644 --- a/meta/lib/oeqa/selftest/base.py +++ b/meta/lib/oeqa/selftest/base.py | |||
@@ -18,6 +18,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer | |||
18 | from oeqa.utils.decorators import LogResults | 18 | from oeqa.utils.decorators import LogResults |
19 | from random import choice | 19 | from random import choice |
20 | import glob | 20 | import glob |
21 | from unittest.util import safe_repr | ||
21 | 22 | ||
22 | @LogResults | 23 | @LogResults |
23 | class oeSelfTest(unittest.TestCase): | 24 | class oeSelfTest(unittest.TestCase): |
@@ -214,6 +215,18 @@ be re-executed from a clean environment to ensure accurate results.") | |||
214 | self.log.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data)) | 215 | self.log.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data)) |
215 | ftools.write_file(self.machineinc_path, data) | 216 | ftools.write_file(self.machineinc_path, data) |
216 | 217 | ||
218 | # check does path exist | ||
219 | def assertExists(self, expr, msg=None): | ||
220 | if not os.path.exists(expr): | ||
221 | msg = self._formatMessage(msg, "%s does not exist" % safe_repr(expr)) | ||
222 | raise self.failureException(msg) | ||
223 | |||
224 | # check does path not exist | ||
225 | def assertNotExists(self, expr, msg=None): | ||
226 | if os.path.exists(expr): | ||
227 | msg = self._formatMessage(msg, "%s exists when it should not" % safe_repr(expr)) | ||
228 | raise self.failureException(msg) | ||
229 | |||
217 | 230 | ||
218 | def get_available_machines(): | 231 | def get_available_machines(): |
219 | # Get a list of all available machines | 232 | # Get a list of all available machines |