summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/contrib/tts
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-07-30 19:25:16 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:27:54 +0100
commitada494d3dd2ab3e51c33781ee59fb2b716039aec (patch)
tree24c4dffa82b4e8ea20e087e82b72cdc76db7fe50 /bitbake/lib/toaster/contrib/tts
parentef70e137b23e4c5add7b9561ebc5ef9393608a9b (diff)
downloadpoky-ada494d3dd2ab3e51c33781ee59fb2b716039aec.tar.gz
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>
Diffstat (limited to 'bitbake/lib/toaster/contrib/tts')
-rw-r--r--bitbake/lib/toaster/contrib/tts/tests.py4
1 files changed, 3 insertions, 1 deletions
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):
59 def setUp(self): 59 def setUp(self):
60 self.origdir = os.getcwd() 60 self.origdir = os.getcwd()
61 self.crtdir = os.path.dirname(config.TESTDIR) 61 self.crtdir = os.path.dirname(config.TESTDIR)
62 self.cleanup_database = False
62 os.chdir(self.crtdir) 63 os.chdir(self.crtdir)
63 if not os.path.exists(os.path.join(self.crtdir, "toaster.sqlite")): 64 if not os.path.exists(os.path.join(self.crtdir, "toaster.sqlite")):
65 self.cleanup_database = False
64 run_shell_cmd("%s/bitbake/lib/toaster/manage.py syncdb --noinput" % config.TESTDIR) 66 run_shell_cmd("%s/bitbake/lib/toaster/manage.py syncdb --noinput" % config.TESTDIR)
65 run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate orm" % config.TESTDIR) 67 run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate orm" % config.TESTDIR)
66 run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate bldcontrol" % config.TESTDIR) 68 run_shell_cmd("%s/bitbake/lib/toaster/manage.py migrate bldcontrol" % config.TESTDIR)
@@ -102,5 +104,5 @@ class TestHTML5Compliance(unittest.TestCase):
102 time.sleep(1) 104 time.sleep(1)
103 os.chdir(self.origdir) 105 os.chdir(self.origdir)
104 toaster_sqlite_path = os.path.join(self.crtdir, "toaster.sqlite") 106 toaster_sqlite_path = os.path.join(self.crtdir, "toaster.sqlite")
105 if os.path.exists(toaster_sqlite_path): 107 if self.cleanup_database and os.path.exists(toaster_sqlite_path):
106 os.remove(toaster_sqlite_path) 108 os.remove(toaster_sqlite_path)