run all teh keystoneclient tests against sql too

This commit is contained in:
termie 2012-01-06 21:31:12 -08:00
parent 0f6a9a78d9
commit 4b4ada27ca
5 changed files with 46 additions and 6 deletions

View File

@ -0,0 +1,16 @@
import os
from keystonelight import config
from keystonelight.backends.sql import migration
CONF = config.CONF
def setup_test_database():
# TODO(termie): be smart about this
try:
os.unlink('bla.db')
except Exception:
pass
migration.db_sync()

9
tests/backend_sql.conf Normal file
View File

@ -0,0 +1,9 @@
[sql]
connection = sqlite:///bla.db
idle_timeout = 200
min_pool_size = 5
max_pool_size = 10
pool_timeout = 200
[identity]
driver = keystonelight.backends.sql.SqlIdentity

View File

@ -5,7 +5,7 @@ from keystonelight import config
from keystonelight import models
from keystonelight import test
from keystonelight.backends import sql
from keystonelight.backends.sql import migration
from keystonelight.backends.sql import util as sql_util
import test_backend
import default_fixtures
@ -22,8 +22,8 @@ class SqlIdentity(test.TestCase, test_backend.IdentityTests):
os.unlink('bla.db')
except Exception:
pass
CONF(config_files=['default.conf'])
migration.db_sync(1)
CONF(config_files=['default.conf', 'backend_sql.conf'])
sql_util.setup_test_database()
self.identity_api = sql.SqlIdentity()
self.load_fixtures(default_fixtures)

View File

@ -34,9 +34,9 @@ class CompatTestCase(test.TestCase):
return kc
class MasterCompatTestCase(CompatTestCase):
class KcMasterTestCase(CompatTestCase):
def setUp(self):
super(MasterCompatTestCase, self).setUp()
super(KcMasterTestCase, self).setUp()
revdir = test.checkout_vendor(KEYSTONECLIENT_REPO, 'master')
self.add_path(revdir)
@ -64,7 +64,6 @@ class MasterCompatTestCase(CompatTestCase):
def _config(self):
CONF(config_files=['default.conf'])
def foo_client(self):
return self._client(username='FOO',
password='foo2',

View File

@ -0,0 +1,16 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from keystonelight import config
from keystonelight import test
from keystonelight.backends.sql import util as sql_util
from keystonelight.backends.sql import migration
import test_keystoneclient
CONF = config.CONF
class KcMasterSqlTestCase(test_keystoneclient.KcMasterTestCase):
def _config(self):
CONF(config_files=['default.conf', 'backend_sql.conf'])
sql_util.setup_test_database()