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>
This commit is contained in:
parent
c3c2cc4180
commit
f17a6937ab
|
@ -92,7 +92,7 @@ class oeSelfTest(unittest.TestCase):
|
||||||
inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
|
inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
|
||||||
self.log.debug("Deleting file: %s" % inc_file)
|
self.log.debug("Deleting file: %s" % inc_file)
|
||||||
try:
|
try:
|
||||||
os.remove(self.testinc_path)
|
os.remove(inc_file)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != errno.ENOENT:
|
if e.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -97,6 +97,17 @@ def remove_include():
|
||||||
ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
|
ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
|
||||||
"#include added by oe-selftest.py\ninclude selftest.inc")
|
"#include added by oe-selftest.py\ninclude selftest.inc")
|
||||||
|
|
||||||
|
|
||||||
|
def remove_inc_files():
|
||||||
|
try:
|
||||||
|
os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/selftest.inc"))
|
||||||
|
for root, _, files in os.walk(get_test_layer()):
|
||||||
|
for f in files:
|
||||||
|
if f == 'test_recipe.inc':
|
||||||
|
os.remove(os.path.join(root, f))
|
||||||
|
except OSError as e:
|
||||||
|
pass
|
||||||
|
|
||||||
def get_tests():
|
def get_tests():
|
||||||
testslist = []
|
testslist = []
|
||||||
for x in sys.argv[1:]:
|
for x in sys.argv[1:]:
|
||||||
|
@ -145,4 +156,5 @@ if __name__ == "__main__":
|
||||||
traceback.print_exc(5)
|
traceback.print_exc(5)
|
||||||
finally:
|
finally:
|
||||||
remove_include()
|
remove_include()
|
||||||
|
remove_inc_files()
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|
Loading…
Reference in New Issue