diff options
-rw-r--r-- | nova/tests/test_migrations.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py index e2ab2df1f..239cc6fe0 100644 --- a/nova/tests/test_migrations.py +++ b/nova/tests/test_migrations.py @@ -109,6 +109,13 @@ def _have_mysql(): return present.lower() in ('', 'true') +def _have_postgresql(): + present = os.environ.get('NOVA_TEST_POSTGRESQL_PRESENT') + if present is None: + return _is_backend_avail('postgres') + return present.lower() in ('', 'true') + + def get_table(engine, name): """Returns an sqlalchemy table dynamically from db. @@ -257,7 +264,7 @@ class TestMigrations(BaseMigrationTestCase): def test_mysql_opportunistically(self): # Test that table creation on mysql only builds InnoDB tables - if not _is_backend_avail('mysql'): + if not _have_mysql(): self.skipTest("mysql not available") # add this to the global lists to make reset work with it, it's removed # automatically in tearDown so no need to clean it up here. @@ -296,7 +303,7 @@ class TestMigrations(BaseMigrationTestCase): def test_postgresql_opportunistically(self): # Test postgresql database migration walk - if not _is_backend_avail('postgres'): + if not _have_postgresql(): self.skipTest("postgresql not available") # add this to the global lists to make reset work with it, it's removed # automatically in tearDown so no need to clean it up here. |