diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-18 23:29:38 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-18 23:29:38 +0000 |
commit | 1a0dd5515f19a3a8db2ed5d929e2e682a15beccb (patch) | |
tree | 4eff7184fe1b3ef28dad29be40a1e1fcaeeb9744 /tests | |
parent | be21b8713956c3cdf6b7f3ef74b84107a36c6abc (diff) | |
parent | 85910ce347e618d604a7421e95e5984c13f73f10 (diff) | |
download | keystone-1a0dd5515f19a3a8db2ed5d929e2e682a15beccb.tar.gz keystone-1a0dd5515f19a3a8db2ed5d929e2e682a15beccb.tar.xz keystone-1a0dd5515f19a3a8db2ed5d929e2e682a15beccb.zip |
Merge "Utilize legacy_endpoint_id column (bug 1154918)"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_sql_upgrade.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test_sql_upgrade.py b/tests/test_sql_upgrade.py index 754561c8..b3d601f6 100644 --- a/tests/test_sql_upgrade.py +++ b/tests/test_sql_upgrade.py @@ -691,6 +691,43 @@ class SqlUpgradeTests(test.TestCase): 'where extra is null') self.assertEqual(r.fetchone()['c'], 0) + def test_legacy_endpoint_id(self): + session = self.Session() + self.upgrade(21) + + service = { + 'id': uuid.uuid4().hex, + 'name': 'keystone', + 'type': 'identity'} + self.insert_dict(session, 'service', service) + + legacy_endpoint_id = uuid.uuid4().hex + endpoint = { + 'id': uuid.uuid4().hex, + 'service_id': service['id'], + 'interface': uuid.uuid4().hex[:8], + 'url': uuid.uuid4().hex, + 'extra': json.dumps({ + 'legacy_endpoint_id': legacy_endpoint_id})} + self.insert_dict(session, 'endpoint', endpoint) + + self.upgrade(22) + session.commit() + session.close() + + session = self.Session() + endpoint_table = sqlalchemy.Table( + 'endpoint', self.metadata, autoload=True) + + self.assertEqual(session.query(endpoint_table).count(), 1) + ref = session.query(endpoint_table).one() + self.assertEqual(ref.id, endpoint['id'], ref) + self.assertEqual(ref.service_id, endpoint['service_id']) + self.assertEqual(ref.interface, endpoint['interface']) + self.assertEqual(ref.url, endpoint['url']) + self.assertEqual(ref.legacy_endpoint_id, legacy_endpoint_id) + self.assertEqual(ref.extra, '{}') + def populate_user_table(self, with_pass_enab=False, with_pass_enab_domain=False): # Populate the appropriate fields in the user |