summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-09-20 00:33:48 +0000
committerGerrit Code Review <review@openstack.org>2012-09-20 00:33:48 +0000
commite7e1cfc8ab9792654c8c09f35f8cf98fe463ba66 (patch)
treebd08e73525fd2d9be6132eaec4dcaf4720f96477 /nova/tests
parent848af020a1f91b4638c07206667e48570fe7d2d6 (diff)
parenta5dbdb53da470916248c8ef8715ef6e06dfa1d0f (diff)
Merge "Fix aggregate_hosts.host migration for sqlite"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_migrations.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index 73b50c280..1e8714b94 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -456,3 +456,27 @@ class TestMigrations(test.TestCase):
sm_vols = sqlalchemy.select([sm_volume.c.id]).execute().fetchall()
self.assertEqual(set([sm_vol.id for sm_vol in sm_vols]),
set([vol1_id]))
+
+ def test_migration_111(self):
+ for key, engine in self.engines.items():
+ migration_api.version_control(engine, TestMigrations.REPOSITORY,
+ migration.INIT_VERSION)
+ migration_api.upgrade(engine, TestMigrations.REPOSITORY, 110)
+
+ metadata = sqlalchemy.schema.MetaData()
+ metadata.bind = engine
+ aggregate_hosts = sqlalchemy.Table('aggregate_hosts', metadata,
+ autoload=True)
+ host = 'host'
+ aggregate_hosts.insert().values(id=1,
+ aggregate_id=1, host=host).execute()
+
+ migration_api.upgrade(engine, TestMigrations.REPOSITORY, 111)
+ agg = sqlalchemy.select([aggregate_hosts.c.host]).execute().first()
+ self.assertEqual(host, agg.host)
+ aggregate_hosts.insert().values(id=2,
+ aggregate_id=2, host=host).execute()
+
+ migration_api.downgrade(engine, TestMigrations.REPOSITORY, 111)
+ agg = sqlalchemy.select([aggregate_hosts.c.host]).execute().first()
+ self.assertEqual(host, agg.host)