summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-09 16:37:36 +0000
committerGerrit Code Review <review@openstack.org>2013-05-09 16:37:36 +0000
commitbe94dd25bf64df3151013c08ed925d68fcf85190 (patch)
treec51abb7965af815fdc6b137e09588886f28f6c35
parent7bf3e8d3e254d817ff5ae7ef1f2884b10410ca60 (diff)
parente49e38cbd9d8df2281c0bfddfe6e4aaea90b889b (diff)
downloadnova-be94dd25bf64df3151013c08ed925d68fcf85190.tar.gz
Merge "Do not test foreign keys with SQLite version < 3.7" into stable/grizzly2013.1.1
-rw-r--r--nova/tests/test_db_api.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py
index 8c27525fb7..f4075873a0 100644
--- a/nova/tests/test_db_api.py
+++ b/nova/tests/test_db_api.py
@@ -2619,6 +2619,15 @@ class ArchiveTestCase(test.TestCase):
# SQLite doesn't enforce foreign key constraints without a pragma.
dialect = self.engine.url.get_dialect()
if dialect == sqlite.dialect:
+ # We're seeing issues with foreign key support in SQLite 3.6.20
+ # SQLAlchemy doesn't support it at all with < SQLite 3.6.19
+ # It works fine in SQLite 3.7.
+ # So return early to skip this test if running SQLite < 3.7
+ import sqlite3
+ tup = sqlite3.sqlite_version_info
+ if tup[0] < 3 or (tup[0] == 3 and tup[1] < 7):
+ self.skipTest(
+ 'sqlite version too old for reliable SQLA foreign_keys')
self.conn.execute("PRAGMA foreign_keys = ON")
insert_statement = self.console_pools.insert().values(deleted=1)
result = self.conn.execute(insert_statement)