summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-10-20 13:49:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-21 22:54:58 +0100
commitaa3b859524bb693d3b150a8873a2ee24c78eac0a (patch)
tree53e4c8207268cbf1abfb7335999d605bdccc6859 /meta/lib/oeqa/selftest
parent5eaa4fa30e2362e6dd572b8a6f7a909b608e14bf (diff)
downloadopenembedded-core-aa3b859524bb693d3b150a8873a2ee24c78eac0a.tar.gz
openembedded-core-aa3b859524bb693d3b150a8873a2ee24c78eac0a.tar.bz2
openembedded-core-aa3b859524bb693d3b150a8873a2ee24c78eac0a.zip
oeqa/selftest/bbtests: clean up local DL_DIR/SSTATE_DIR safely
Now that the selftests clean selftest.inc in the tearDown using bitbake in a function passed to addCleanup (which happens after teardown) will use the default configuration and not the customised one. As the intention was to clean away the temporary DL_DIR and SSTATE_DIR, simple use track_for_cleanup to delete the entire directory instead. Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/bbtests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py
index 3d6860f652..af0773df10 100644
--- a/meta/lib/oeqa/selftest/bbtests.py
+++ b/meta/lib/oeqa/selftest/bbtests.py
@@ -101,6 +101,8 @@ class BitbakeTests(oeSelfTest):
self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
SSTATE_DIR = \"${TOPDIR}/download-selftest\"
""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+
bitbake('-ccleanall man')
result = bitbake('-c fetch man', ignore_status=True)
bitbake('-ccleanall man')
@@ -116,12 +118,13 @@ doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result
self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
SSTATE_DIR = \"${TOPDIR}/download-selftest\"
""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+
data = 'SRC_URI_append = ";downloadfilename=test-aspell.tar.gz"'
self.write_recipeinc('aspell', data)
bitbake('-ccleanall aspell')
result = bitbake('-c fetch aspell', ignore_status=True)
self.delete_recipeinc('aspell')
- self.addCleanup(bitbake, '-ccleanall aspell')
self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output)
self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % str(get_bb_var("DL_DIR")))
self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % str(get_bb_var("DL_DIR")))
@@ -181,6 +184,7 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\"
self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
SSTATE_DIR = \"${TOPDIR}/download-selftest\"
""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" )
runCmd('bitbake -c cleanall man xcursor-transparent-theme')
result = runCmd('bitbake man xcursor-transparent-theme -k', ignore_status=True)