From 0f57de168bee905bf4585b6c128d92900d2027aa Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Fri, 16 Aug 2013 15:19:17 +0800 Subject: [PATCH] Added test case in test_migrations for migration 208 This patch is to add test case in test_migrations.py for migration 208. Migration 208 was brought by commit 74b024f75403c168b5c69ee67a16d1053965e5db (Change-Id: I72371260159c9fdffcdb57209095fc103b6dd79e) Change-Id: I153abf260716c8af61d7ccf554d91ba80f559e60 Signed-off-by: Shane Wang --- nova/tests/db/test_migrations.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nova/tests/db/test_migrations.py b/nova/tests/db/test_migrations.py index 31ebe4a40d31..02f992cb4500 100644 --- a/nova/tests/db/test_migrations.py +++ b/nova/tests/db/test_migrations.py @@ -2594,6 +2594,25 @@ class TestNovaMigrations(BaseMigrationTestCase, CommonTestsMixIn): def _post_downgrade_207(self, engine): self._207(engine) + def _check_208(self, engine, data): + self.assertColumnExists(engine, 'compute_nodes', 'host_ip') + self.assertColumnExists(engine, 'compute_nodes', 'supported_instances') + + compute_nodes = db_utils.get_table(engine, 'compute_nodes') + if engine.name == "postgresql": + self.assertTrue(isinstance(compute_nodes.c.host_ip.type, + sqlalchemy.dialects.postgresql.INET)) + else: + self.assertTrue(isinstance(compute_nodes.c.host_ip.type, + sqlalchemy.types.String)) + self.assertTrue(isinstance(compute_nodes.c.supported_instances.type, + sqlalchemy.types.Text)) + + def _post_downgrade_208(self, engine): + self.assertColumnNotExists(engine, 'compute_nodes', 'host_ip') + self.assertColumnNotExists(engine, 'compute_nodes', + 'supported_instance') + def _data_209(self): ret = {"compute_nodes": {"service_id": 999, "vcpus": 1, "memory_mb": 1, "local_gb": 1, "vcpus_used": 1,