diff options
author | Hengqing Hu <hudayou@hotmail.com> | 2012-02-28 13:21:33 +0800 |
---|---|---|
committer | Hengqing Hu <hudayou@hotmail.com> | 2012-02-28 13:21:33 +0800 |
commit | bf5ce18c337d1ee1fb6cfb0e17115da97ebc5912 (patch) | |
tree | adc9d2df9b73f7469bae0a4ca98b96e56107d1c1 | |
parent | f01b9b8dd25d763e652259a0f99264d93661b29f (diff) | |
download | nova-bf5ce18c337d1ee1fb6cfb0e17115da97ebc5912.tar.gz nova-bf5ce18c337d1ee1fb6cfb0e17115da97ebc5912.tar.xz nova-bf5ce18c337d1ee1fb6cfb0e17115da97ebc5912.zip |
Check all migrations have downgrade in test_misc
Fixes bug #942406
Change-Id: Ifbc74c12a4c58d4e2117295c088051062a0b3b1c
-rw-r--r-- | nova/tests/test_misc.py | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/nova/tests/test_misc.py b/nova/tests/test_misc.py index 0a673e68e..7f2eb09cc 100644 --- a/nova/tests/test_misc.py +++ b/nova/tests/test_misc.py @@ -70,28 +70,7 @@ class ProjectTestCase(test.TestCase): self.assertTrue(len(missing) == 0, '%r not listed in Authors' % missing) - def test_all_new_migrations_have_downgrade(self): - # NOTE(sirp): These migrations are old enough so that a downgrade - # isn't a hard requirement. Would be nice to have, in these cases, - # though, too. - EXEMPT = """ - 002_bexar.py - 003_add_label_to_networks.py - 004_add_zone_tables.py - 005_add_instance_metadata.py - 006_add_provider_data_to_volumes.py - 007_add_ipv6_to_fixed_ips.py - 009_add_instance_migrations.py - 011_live_migration.py - 012_add_ipv6_flatmanager.py - 015_add_auto_assign_to_floating_ips.py - 020_add_snapshot_id_to_volumes.py - 026_add_agent_table.py - 027_add_provider_firewall_rules.py - """ - - exempt = [e.strip() for e in EXEMPT.splitlines() if e.strip()] - + def test_all_migrations_have_downgrade(self): topdir = os.path.normpath(os.path.dirname(__file__) + '/../../') py_glob = os.path.join(topdir, "nova", "db", "sqlalchemy", "migrate_repo", "versions", "*.py") @@ -108,8 +87,7 @@ class ProjectTestCase(test.TestCase): if has_upgrade and not has_downgrade: fname = os.path.basename(path) - if fname not in exempt: - missing_downgrade.append(fname) + missing_downgrade.append(fname) helpful_msg = (_("The following migrations are missing a downgrade:" "\n\t%s") % '\n\t'.join(sorted(missing_downgrade))) |