summaryrefslogtreecommitdiffstats
path: root/tests/test_sql_upgrade.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-16 22:55:46 +0000
committerGerrit Code Review <review@openstack.org>2013-01-16 22:55:46 +0000
commit9907ab59a0138c2d1aa00552feb51a259bb519f3 (patch)
tree5dbbe2ae925b59311584bbc5caf4e2b45083bc90 /tests/test_sql_upgrade.py
parent66dbbdcb9073bb9278f12175c8f996c2db074261 (diff)
parented252e0f92f0750a2f35871d72e52a2767569bef (diff)
downloadkeystone-9907ab59a0138c2d1aa00552feb51a259bb519f3.tar.gz
keystone-9907ab59a0138c2d1aa00552feb51a259bb519f3.tar.xz
keystone-9907ab59a0138c2d1aa00552feb51a259bb519f3.zip
Merge "Allow running of sql against the live DB."
Diffstat (limited to 'tests/test_sql_upgrade.py')
-rw-r--r--tests/test_sql_upgrade.py17
1 files changed, 16 insertions, 1 deletions
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):