diff options
author | William Kelly <the.william.kelly@gmail.com> | 2013-03-08 17:47:40 -0600 |
---|---|---|
committer | William Kelly <the.william.kelly@gmail.com> | 2013-03-08 18:54:39 -0600 |
commit | 42bd756c30d16a3e48c7821d0a5d5433de41a506 (patch) | |
tree | a8194c962df8d96a853d933527d53c7f360e920a /tests/test_sql_upgrade.py | |
parent | 756cd5a2972e076cdc9a119526e2038d0b838256 (diff) | |
download | keystone-42bd756c30d16a3e48c7821d0a5d5433de41a506.tar.gz keystone-42bd756c30d16a3e48c7821d0a5d5433de41a506.tar.xz keystone-42bd756c30d16a3e48c7821d0a5d5433de41a506.zip |
Fix folsom -> grizzly role table migration issues (bug 1119789)
Change-Id: Id7e5b3354d9139afa0a69b283924f363847cef56
Diffstat (limited to 'tests/test_sql_upgrade.py')
-rw-r--r-- | tests/test_sql_upgrade.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_sql_upgrade.py b/tests/test_sql_upgrade.py index 003fb4ec..62c69cc9 100644 --- a/tests/test_sql_upgrade.py +++ b/tests/test_sql_upgrade.py @@ -538,6 +538,23 @@ class SqlUpgradeTests(test.TestCase): self.assertTableColumns("trust_role", ["trust_id", "role_id"]) + def test_fixup_role(self): + session = self.Session() + self.assertEqual(self.schema.version, 0, "DB is at version 0") + self.upgrade(1) + self.insert_dict(session, "role", {"id": "test", "name": "test"}) + self.upgrade(18) + self.insert_dict(session, "role", {"id": "test2", + "name": "test2", + "extra": None}) + r = session.execute('select count(*) as c from role ' + 'where extra is null') + self.assertEqual(r.fetchone()['c'], 2) + self.upgrade(19) + r = session.execute('select count(*) as c from role ' + 'where extra is null') + self.assertEqual(r.fetchone()['c'], 0) + def populate_user_table(self, with_pass_enab=False, with_pass_enab_domain=False): # Populate the appropriate fields in the user |