diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/case.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py index 871009c568..e09915b495 100644 --- a/meta/lib/oeqa/selftest/case.py +++ b/meta/lib/oeqa/selftest/case.py | |||
| @@ -212,27 +212,33 @@ to ensure accurate results.") | |||
| 212 | self.logger.debug("Removing from: %s\n%s\n" % (self.testinc_path, data)) | 212 | self.logger.debug("Removing from: %s\n%s\n" % (self.testinc_path, data)) |
| 213 | ftools.remove_from_file(self.testinc_path, data) | 213 | ftools.remove_from_file(self.testinc_path, data) |
| 214 | 214 | ||
| 215 | def recipeinc(self, recipe): | ||
| 216 | """Return absolute path of meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" | ||
| 217 | return os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | ||
| 218 | |||
| 215 | def write_recipeinc(self, recipe, data): | 219 | def write_recipeinc(self, recipe, data): |
| 216 | """Write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" | 220 | """Write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" |
| 217 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | 221 | inc_file = self.recipeinc(recipe) |
| 218 | self.logger.debug("Writing to: %s\n%s\n" % (inc_file, data)) | 222 | self.logger.debug("Writing to: %s\n%s\n" % (inc_file, data)) |
| 219 | ftools.write_file(inc_file, data) | 223 | ftools.write_file(inc_file, data) |
| 224 | return inc_file | ||
| 220 | 225 | ||
| 221 | def append_recipeinc(self, recipe, data): | 226 | def append_recipeinc(self, recipe, data): |
| 222 | """Append data to meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" | 227 | """Append data to meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" |
| 223 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | 228 | inc_file = self.recipeinc(recipe) |
| 224 | self.logger.debug("Appending to: %s\n%s\n" % (inc_file, data)) | 229 | self.logger.debug("Appending to: %s\n%s\n" % (inc_file, data)) |
| 225 | ftools.append_file(inc_file, data) | 230 | ftools.append_file(inc_file, data) |
| 231 | return inc_file | ||
| 226 | 232 | ||
| 227 | def remove_recipeinc(self, recipe, data): | 233 | def remove_recipeinc(self, recipe, data): |
| 228 | """Remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" | 234 | """Remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" |
| 229 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | 235 | inc_file = self.recipeinc(recipe) |
| 230 | self.logger.debug("Removing from: %s\n%s\n" % (inc_file, data)) | 236 | self.logger.debug("Removing from: %s\n%s\n" % (inc_file, data)) |
| 231 | ftools.remove_from_file(inc_file, data) | 237 | ftools.remove_from_file(inc_file, data) |
| 232 | 238 | ||
| 233 | def delete_recipeinc(self, recipe): | 239 | def delete_recipeinc(self, recipe): |
| 234 | """Delete meta-sefltest/recipes-test/<recipe>/test_recipe.inc file""" | 240 | """Delete meta-sefltest/recipes-test/<recipe>/test_recipe.inc file""" |
| 235 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | 241 | inc_file = self.recipeinc(recipe) |
| 236 | self.logger.debug("Deleting file: %s" % inc_file) | 242 | self.logger.debug("Deleting file: %s" % inc_file) |
| 237 | try: | 243 | try: |
| 238 | os.remove(inc_file) | 244 | os.remove(inc_file) |
| @@ -259,13 +265,13 @@ to ensure accurate results.") | |||
| 259 | self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data)) | 265 | self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data)) |
| 260 | ftools.write_file(self.machineinc_path, data) | 266 | ftools.write_file(self.machineinc_path, data) |
| 261 | 267 | ||
| 262 | # check does path exist | 268 | # check does path exist |
| 263 | def assertExists(self, expr, msg=None): | 269 | def assertExists(self, expr, msg=None): |
| 264 | if not os.path.exists(expr): | 270 | if not os.path.exists(expr): |
| 265 | msg = self._formatMessage(msg, "%s does not exist" % safe_repr(expr)) | 271 | msg = self._formatMessage(msg, "%s does not exist" % safe_repr(expr)) |
| 266 | raise self.failureException(msg) | 272 | raise self.failureException(msg) |
| 267 | 273 | ||
| 268 | # check does path not exist | 274 | # check does path not exist |
| 269 | def assertNotExists(self, expr, msg=None): | 275 | def assertNotExists(self, expr, msg=None): |
| 270 | if os.path.exists(expr): | 276 | if os.path.exists(expr): |
| 271 | msg = self._formatMessage(msg, "%s exists when it should not" % safe_repr(expr)) | 277 | msg = self._formatMessage(msg, "%s exists when it should not" % safe_repr(expr)) |
