diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-31 22:16:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-31 22:16:51 +0000 |
| commit | cd349711bc6210bf35952c5f71bb92ab7676bd2d (patch) | |
| tree | e225e8bb9f770d2a6950055bf17a3a2fb5c032c9 | |
| parent | e023ed252a8eb454e6dee90fb2ca42d68ee7286c (diff) | |
| parent | 62abd5d85384416dc05aa0a449dab1694caec3e8 (diff) | |
| download | keystone-cd349711bc6210bf35952c5f71bb92ab7676bd2d.tar.gz keystone-cd349711bc6210bf35952c5f71bb92ab7676bd2d.tar.xz keystone-cd349711bc6210bf35952c5f71bb92ab7676bd2d.zip | |
Merge "Live SQL migration tests"
| -rw-r--r-- | tests/_sql_livetest.py | 37 | ||||
| -rw-r--r-- | tests/backend_mysql.conf | 4 | ||||
| -rw-r--r-- | tests/backend_postgresql.conf | 4 | ||||
| -rw-r--r-- | tests/test_sql_upgrade.py | 13 |
4 files changed, 55 insertions, 3 deletions
diff --git a/tests/_sql_livetest.py b/tests/_sql_livetest.py new file mode 100644 index 00000000..d9890979 --- /dev/null +++ b/tests/_sql_livetest.py @@ -0,0 +1,37 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2013 Red Hat, Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import test_sql_upgrade + +from keystone import config + +CONF = config.CONF + + +class PostgresqlMigrateTests(test_sql_upgrade.SqlUpgradeTests): + def config_files(self): + files = (test_sql_upgrade.SqlUpgradeTests. + _config_file_list[:]) + files.append("backend_postgresql.conf") + return files + + +class MysqlMigrateTests(test_sql_upgrade.SqlUpgradeTests): + def config_files(self): + files = (test_sql_upgrade.SqlUpgradeTests. + _config_file_list[:]) + files.append("backend_mysql.conf") + return files diff --git a/tests/backend_mysql.conf b/tests/backend_mysql.conf new file mode 100644 index 00000000..ee3b276e --- /dev/null +++ b/tests/backend_mysql.conf @@ -0,0 +1,4 @@ +#Used for running the Migrate tests against a live Mysql Server +#See _sql_livetest.py +[sql] +connection = mysql://keystone:keystone@localhost/keystone_test?charset=utf8 diff --git a/tests/backend_postgresql.conf b/tests/backend_postgresql.conf new file mode 100644 index 00000000..8468ad33 --- /dev/null +++ b/tests/backend_postgresql.conf @@ -0,0 +1,4 @@ +#Used for running the Migrate tests against a live Postgresql Server +#See _sql_livetest.py +[sql] +connection = postgresql://keystone:keystone@localhost/keystone_test?client_encoding=utf8 diff --git a/tests/test_sql_upgrade.py b/tests/test_sql_upgrade.py index 51ac2b7d..59a8800c 100644 --- a/tests/test_sql_upgrade.py +++ b/tests/test_sql_upgrade.py @@ -50,11 +50,18 @@ class SqlUpgradeTests(test.TestCase): self.metadata = sqlalchemy.MetaData() self.metadata.bind = self.engine + _config_file_list = [test.etcdir('keystone.conf.sample'), + test.testsdir('test_overrides.conf'), + test.testsdir('backend_sql.conf')] + + #override this to sepcify the complete list of configuration files + def config_files(self): + return self._config_file_list + def setUp(self): super(SqlUpgradeTests, self).setUp() - self.config([test.etcdir('keystone.conf.sample'), - test.testsdir('test_overrides.conf'), - test.testsdir('backend_sql.conf')]) + + self.config(self.config_files()) self.base = sql.Base() # create and share a single sqlalchemy engine for testing |
