diff options
| author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2013-12-04 13:42:58 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-05 14:24:43 +0000 |
| commit | f17a6937ab50452834dc85fab4e9712576e0c840 (patch) | |
| tree | 96a9820a8fec0ef1e0d5f80f6993dcbd6003e30d | |
| parent | c3c2cc4180118fef377b7f4ce92b920a6589cf48 (diff) | |
| download | poky-f17a6937ab50452834dc85fab4e9712576e0c840.tar.gz | |
lib/oeqa/selftest/base, scripts/oe-selftest: fix wrong remove path and do a complete cleanup at the end
The script should clean-up all the .inc files that might
have been created by tests regardless of the outcome or if
the script is interrupted. (currently the
last test will leave a conf/selftest.inc around, even
if it's not included anywhere)
Also fix delete_recipeinc to actually delete what's supposed to.
(From OE-Core rev: 6008745c56800e0f5f01a756be0701cebd9de4ae)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/selftest/base.py | 2 | ||||
| -rwxr-xr-x | scripts/oe-selftest | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py index 30a71e886f..c3474a3da6 100644 --- a/meta/lib/oeqa/selftest/base.py +++ b/meta/lib/oeqa/selftest/base.py | |||
| @@ -92,7 +92,7 @@ class oeSelfTest(unittest.TestCase): | |||
| 92 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') | 92 | inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') |
| 93 | self.log.debug("Deleting file: %s" % inc_file) | 93 | self.log.debug("Deleting file: %s" % inc_file) |
| 94 | try: | 94 | try: |
| 95 | os.remove(self.testinc_path) | 95 | os.remove(inc_file) |
| 96 | except OSError as e: | 96 | except OSError as e: |
| 97 | if e.errno != errno.ENOENT: | 97 | if e.errno != errno.ENOENT: |
| 98 | raise | 98 | raise |
diff --git a/scripts/oe-selftest b/scripts/oe-selftest index db42e73470..29fe0100de 100755 --- a/scripts/oe-selftest +++ b/scripts/oe-selftest | |||
| @@ -97,6 +97,17 @@ def remove_include(): | |||
| 97 | ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \ | 97 | ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \ |
| 98 | "#include added by oe-selftest.py\ninclude selftest.inc") | 98 | "#include added by oe-selftest.py\ninclude selftest.inc") |
| 99 | 99 | ||
| 100 | |||
| 101 | def remove_inc_files(): | ||
| 102 | try: | ||
| 103 | os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/selftest.inc")) | ||
| 104 | for root, _, files in os.walk(get_test_layer()): | ||
| 105 | for f in files: | ||
| 106 | if f == 'test_recipe.inc': | ||
| 107 | os.remove(os.path.join(root, f)) | ||
| 108 | except OSError as e: | ||
| 109 | pass | ||
| 110 | |||
| 100 | def get_tests(): | 111 | def get_tests(): |
| 101 | testslist = [] | 112 | testslist = [] |
| 102 | for x in sys.argv[1:]: | 113 | for x in sys.argv[1:]: |
| @@ -145,4 +156,5 @@ if __name__ == "__main__": | |||
| 145 | traceback.print_exc(5) | 156 | traceback.print_exc(5) |
| 146 | finally: | 157 | finally: |
| 147 | remove_include() | 158 | remove_include() |
| 159 | remove_inc_files() | ||
| 148 | sys.exit(ret) | 160 | sys.exit(ret) |
