From ada494d3dd2ab3e51c33781ee59fb2b716039aec Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Thu, 30 Jul 2015 19:25:16 +0300 Subject: 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 Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/contrib/tts/tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/toaster/contrib/tts/tests.py b/bitbake/lib/toaster/contrib/tts/tests.py index fd6aa3b8bb..8d1964790f 100644 --- a/bitbake/lib/toaster/contrib/tts/tests.py +++ b/bitbake/lib/toaster/contrib/tts/tests.py @@ -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) -- cgit v1.2.3-54-g00ecf