mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: toaster: tts: delete the database only if created
To allow the tests to run on different databases (in case of manual runs), the HTML5 test will only delete the database file if it was created in the setUp. (Bitbake rev: 2b04165f6a70fad5beb8e4c7053a2b2053a51cde) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ef70e137b2
commit
ada494d3dd
@@ -59,8 +59,10 @@ class TestHTML5Compliance(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.origdir = os.getcwd()
|
||||
self.crtdir = os.path.dirname(config.TESTDIR)
|
||||
self.cleanup_database = False
|
||||
os.chdir(self.crtdir)
|
||||
if not os.path.exists(os.path.join(self.crtdir, "toaster.sqlite")):
|
||||
self.cleanup_database = False
|
||||
run_shell_cmd("%s/bitbake/lib/toaster/manage.py syncdb --noinput" % config.TESTDIR)
|
||||
run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate orm" % config.TESTDIR)
|
||||
run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate bldcontrol" % config.TESTDIR)
|
||||
@@ -102,5 +104,5 @@ class TestHTML5Compliance(unittest.TestCase):
|
||||
time.sleep(1)
|
||||
os.chdir(self.origdir)
|
||||
toaster_sqlite_path = os.path.join(self.crtdir, "toaster.sqlite")
|
||||
if os.path.exists(toaster_sqlite_path):
|
||||
if self.cleanup_database and os.path.exists(toaster_sqlite_path):
|
||||
os.remove(toaster_sqlite_path)
|
||||
|
||||
Reference in New Issue
Block a user