summaryrefslogtreecommitdiffstats
path: root/tests/test_keystoneclient_sql.py
diff options
context:
space:
mode:
authorJamie Lennox <jlennox@redhat.com>2013-05-08 10:51:27 +1000
committerAdam Young <ayoung@redhat.com>2013-05-10 15:12:05 -0400
commitefc30beab10faf4720a96322adb135726662b025 (patch)
tree60e5aabd2132aeb2aa24d0541ce71b452478954c /tests/test_keystoneclient_sql.py
parentd6dc64c43f40d143ec231ad485be5e77515d8e62 (diff)
downloadkeystone-efc30beab10faf4720a96322adb135726662b025.tar.gz
keystone-efc30beab10faf4720a96322adb135726662b025.tar.xz
keystone-efc30beab10faf4720a96322adb135726662b025.zip
Allow backend & client SQL tests on mysql and pg.
Currently the tables are not created which means that it isn't possible for these tests to run on anything other than sqlite. Fix test issues where the token id that is used to create the token is not the same as the id that the token is saved with. Fix a number of foreign key constraints issues. Bug 1178041 Change-Id: Ib67eb97836e4224940abdeae4bba66748bfe4ca5
Diffstat (limited to 'tests/test_keystoneclient_sql.py')
-rw-r--r--tests/test_keystoneclient_sql.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_keystoneclient_sql.py b/tests/test_keystoneclient_sql.py
index 69c667ed..30f59022 100644
--- a/tests/test_keystoneclient_sql.py
+++ b/tests/test_keystoneclient_sql.py
@@ -28,14 +28,20 @@ import test_keystoneclient
CONF = config.CONF
-class KcMasterSqlTestCase(test_keystoneclient.KcMasterTestCase):
+class KcMasterSqlTestCase(test_keystoneclient.KcMasterTestCase, sql.Base):
def config(self, config_files):
super(KcMasterSqlTestCase, self).config([
test.etcdir('keystone.conf.sample'),
test.testsdir('test_overrides.conf'),
test.testsdir('backend_sql.conf')])
+ self.load_backends()
+ self.engine = self.get_engine()
+ sql.ModelBase.metadata.create_all(bind=self.engine)
+
def tearDown(self):
+ sql.ModelBase.metadata.drop_all(bind=self.engine)
+ self.engine.dispose()
sql.set_global_engine(None)
super(KcMasterSqlTestCase, self).tearDown()