diff --git a/nova/test.py b/nova/test.py index e3ecb6563c3d..1bcffd44ba24 100644 --- a/nova/test.py +++ b/nova/test.py @@ -387,15 +387,6 @@ class TestCase(base.BaseTestCase): engine = sqlalchemy_api.get_engine() dialect = 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') engine.connect().execute("PRAGMA foreign_keys = ON") def start_service(self, name, host=None, cell_name=None, **kwargs): diff --git a/nova/tests/unit/db/test_db_api.py b/nova/tests/unit/db/test_db_api.py index 8e14179f61c2..eebfffe7cbf8 100644 --- a/nova/tests/unit/db/test_db_api.py +++ b/nova/tests/unit/db/test_db_api.py @@ -6224,13 +6224,12 @@ class ArchiveTestCase(test.TestCase, ModelsObjectComparatorMixin): # Verify the insertions into shadow is same as deletions from main self.assertEqual(len(shadow_rows), len(rows) - len(main_rows)) - def _check_sqlite_version_less_than_3_7(self): + def test_archive_deleted_rows_for_migrations(self): + # migrations.instance_uuid depends on instances.uuid + # SQLite doesn't enforce foreign key constraints without a pragma. self.enforce_fk_constraints(engine=self.engine) - def test_archive_deleted_rows_for_migrations(self): - # migrations.instance_uuid depends on instances.uuid - self._check_sqlite_version_less_than_3_7() instance_uuid = uuidsentinel.instance ins_stmt = self.instances.insert().values( uuid=instance_uuid,