diff --git a/keystone/tests/backend_sql_disk.conf b/keystone/tests/backend_sql_disk.conf deleted file mode 100644 index 31ce195f51..0000000000 --- a/keystone/tests/backend_sql_disk.conf +++ /dev/null @@ -1,2 +0,0 @@ -[database] -connection = sqlite:///keystone/tests/tmp/test.db diff --git a/keystone/tests/core.py b/keystone/tests/core.py index 56a8ddcd95..5a6472cedb 100644 --- a/keystone/tests/core.py +++ b/keystone/tests/core.py @@ -81,7 +81,16 @@ TESTSDIR = os.path.dirname(os.path.abspath(__file__)) ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..')) VENDOR = os.path.join(ROOTDIR, 'vendor') ETCDIR = os.path.join(ROOTDIR, 'etc') -TMPDIR = os.path.join(TESTSDIR, 'tmp') + + +def _calc_tmpdir(): + env_val = os.environ.get('KEYSTONE_TEST_TEMP_DIR') + if env_val: + return env_val + return os.path.join(TESTSDIR, 'tmp') + + +TMPDIR = _calc_tmpdir() CONF = config.CONF diff --git a/keystone/tests/test_auth_plugin.py b/keystone/tests/test_auth_plugin.py index 222f09897b..4f7a2a37a6 100644 --- a/keystone/tests/test_auth_plugin.py +++ b/keystone/tests/test_auth_plugin.py @@ -69,9 +69,13 @@ class TestAuthPlugin(tests.TestCase): return [tests.dirs.etc('keystone.conf.sample'), tests.dirs.tests('test_overrides.conf'), tests.dirs.tests('backend_sql.conf'), - tests.dirs.tests('backend_sql_disk.conf'), tests.dirs.tests('test_auth_plugin.conf')] + def config(self, config_files): + super(TestAuthPlugin, self).config(config_files) + db_conn = 'sqlite:///%s' % tests.dirs.tmp('test.db') + self.config_fixture.config(group='database', connection=db_conn) + def test_unsupported_auth_method(self): method_name = uuid.uuid4().hex auth_data = {'methods': [method_name]} @@ -126,7 +130,6 @@ class TestByClassNameAuthMethodRegistration(TestAuthPlugin): return [tests.dirs.etc('keystone.conf.sample'), tests.dirs.tests('test_overrides.conf'), tests.dirs.tests('backend_sql.conf'), - tests.dirs.tests('backend_sql_disk.conf'), tests.dirs.tests('test_auth_plugin_by_class_name.conf')] diff --git a/keystone/tests/test_v3.py b/keystone/tests/test_v3.py index d810f20ea7..19fa31b627 100644 --- a/keystone/tests/test_v3.py +++ b/keystone/tests/test_v3.py @@ -40,8 +40,7 @@ TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ' class RestfulTestCase(rest.RestfulTestCase): _config_file_list = [tests.dirs.etc('keystone.conf.sample'), tests.dirs.tests('test_overrides.conf'), - tests.dirs.tests('backend_sql.conf'), - tests.dirs.tests('backend_sql_disk.conf')] + tests.dirs.tests('backend_sql.conf')] #Subclasses can override this to specify the complete list of configuration #files. The base version makes a copy of the original values, otherwise @@ -90,6 +89,11 @@ class RestfulTestCase(rest.RestfulTestCase): self.addCleanup(self.teardown_database) + def config(self, config_files): + super(RestfulTestCase, self).config(config_files) + db_conn = 'sqlite:///%s' % tests.dirs.tmp('test.db') + self.config_fixture.config(group='database', connection=db_conn) + def load_backends(self): self.setup_database()