summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/backend_sql.conf4
-rw-r--r--tests/test_sql_upgrade.py17
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/backend_sql.conf b/tests/backend_sql.conf
index 79bb3405..f42eba65 100644
--- a/tests/backend_sql.conf
+++ b/tests/backend_sql.conf
@@ -1,5 +1,9 @@
[sql]
connection = sqlite://
+#To Test MySQL:
+#connection = mysql://root:keystone@localhost/keystone?charset=utf8
+#To Test PostgreSQL:
+#connection = postgresql://keystone:keystone@localhost/keystone?client_encoding=utf8
idle_timeout = 200
[identity]
diff --git a/tests/test_sql_upgrade.py b/tests/test_sql_upgrade.py
index 6d94b258..156b420a 100644
--- a/tests/test_sql_upgrade.py
+++ b/tests/test_sql_upgrade.py
@@ -13,7 +13,18 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-
+"""
+To run these tests against a live database:
+1. Modify the file `tests/backend_sql.conf` to use the connection for your
+ live database
+2. Set up a blank, live database.
+3. run the tests using
+ ./run_tests.sh -N test_sql_upgrade
+ WARNING::
+ Your database will be wiped.
+ Do not do this against a Database with valuable data as
+ all data will be lost.
+"""
import copy
import json
import uuid
@@ -57,6 +68,10 @@ class SqlUpgradeTests(test.TestCase):
self.max_version = self.schema.repository.version().version
def tearDown(self):
+ table = sqlalchemy.Table("migrate_version", self.metadata,
+ autoload=True)
+ self.downgrade(0)
+ table.drop(self.engine, checkfirst=True)
super(SqlUpgradeTests, self).tearDown()
def test_blank_db_to_start(self):