summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-22 18:43:08 +0000
committerGerrit Code Review <review@openstack.org>2013-01-22 18:43:08 +0000
commitb512bba76cbed6b602a224521736d79aae3f6c4d (patch)
treeb8e38f7ad1776bafb858600b6fe14a2f59fc642c
parent81de5a055fcd7fd2ae8ad0adabe7a7aa2c809f2f (diff)
parent65b3b443503f993a8001e761b0768fe05c99bf68 (diff)
downloadnova-b512bba76cbed6b602a224521736d79aae3f6c4d.tar.gz
nova-b512bba76cbed6b602a224521736d79aae3f6c4d.tar.xz
nova-b512bba76cbed6b602a224521736d79aae3f6c4d.zip
Merge "fix mysql race in tests"
-rw-r--r--nova/tests/test_migrations.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index abd04a641..82c958898 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -222,7 +222,7 @@ class TestMigrations(test.TestCase):
if _is_backend_avail('mysql', user="openstack_cifail"):
self.fail("Shouldn't have connected")
- def test_mysql_innodb(self):
+ def test_mysql_opportunistically(self):
# Test that table creation on mysql only builds InnoDB tables
if not _is_backend_avail('mysql'):
self.skipTest("mysql not available")
@@ -233,6 +233,12 @@ class TestMigrations(test.TestCase):
self.engines["mysqlcitest"] = engine
self.test_databases["mysqlcitest"] = connect_string
+ # Test that we end in an innodb
+ self._check_mysql_innodb(engine)
+ # Test IP transition
+ self._check_mysql_migration_149(engine)
+
+ def _check_mysql_innodb(self, engine):
# build a fully populated mysql database with all the tables
self._reset_databases()
self._walk_versions(engine, False, False)
@@ -298,16 +304,8 @@ class TestMigrations(test.TestCase):
"AND column_name='cidr'").scalar())
connection.close()
- def test_migration_149_mysql(self):
+ def _check_mysql_migration_149(self, engine):
"""Test updating a table with IPAddress columns."""
- if not _have_mysql():
- self.skipTest("mysql not available")
-
- connect_string = _get_connect_string("mysql")
- engine = sqlalchemy.create_engine(connect_string)
- self.engines["mysqlcitest"] = engine
- self.test_databases["mysqlcitest"] = connect_string
-
self._reset_databases()
migration_api.version_control(engine, TestMigrations.REPOSITORY,
migration.INIT_VERSION)