diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index 33003f05..feb2ac14 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -40,7 +40,7 @@ def initialize(uri): class FakeLDAP(object): def __init__(self, _uri): - self.keeper = datastore.SqliteKeeper('fakeldap') #Redis keeper never works here... + self.keeper = datastore.Keeper('fakeldap') if self.keeper['objects'] is None: self.keeper['objects'] = {} diff --git a/run_tests.py b/run_tests.py index 957e5d20..d03dbb98 100644 --- a/run_tests.py +++ b/run_tests.py @@ -60,6 +60,8 @@ from nova.tests.validator_unittest import * FLAGS = flags.FLAGS +flags.DEFINE_bool('flush_db', True, + 'Flush the database before running fake tests') if __name__ == '__main__': OptionsClass = twistd.WrapTwistedOptions(trial_script.Options) @@ -71,6 +73,12 @@ if __name__ == '__main__': # TODO(termie): these should make a call instead of doing work on import if FLAGS.fake_tests: from nova.tests.fake_flags import * + # use db 8 for fake tests + FLAGS.redis_db = 8 + if FLAGS.flush_db: + logging.info("Flushing redis datastore") + r = datastore.Redis.instance() + r.flushdb() else: from nova.tests.real_flags import *