summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2012-05-04 09:08:08 -0400
committerMark Washenberger <mark.washenberger@rackspace.com>2012-05-04 09:26:10 -0400
commit4e20178783c2d014b027e509fc26295eb5bc0768 (patch)
tree1ae829268c83961f9a43a5ae6e135f4d69be7c08
parent6dc62775d77c9879fa40e275811715004e7d9fae (diff)
downloadnova-4e20178783c2d014b027e509fc26295eb5bc0768.tar.gz
nova-4e20178783c2d014b027e509fc26295eb5bc0768.tar.xz
nova-4e20178783c2d014b027e509fc26295eb5bc0768.zip
Fix semantics for migration test environment var
Change-Id: I483f29d826fe1e1d1478e714524661aaf20c1cf3
-rw-r--r--nova/tests/test_migrations.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index cdc90a46e..95a76ce18 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -68,10 +68,11 @@ def _is_mysql_avail(user="openstack_citest",
return True
-def _missing_mysql():
- if "NOVA_TEST_MYSQL_PRESENT" in os.environ:
- return True
- return not _is_mysql_avail()
+def _have_mysql():
+ present = os.environ.get('NOVA_TEST_MYSQL_PRESENT')
+ if present is None:
+ return _is_mysql_avail()
+ return present.lower() in ('', 'true')
class TestMigrations(test.TestCase):
@@ -215,7 +216,7 @@ class TestMigrations(test.TestCase):
if _is_mysql_avail(user="openstack_cifail"):
self.fail("Shouldn't have connected")
- @test.skip_if(_missing_mysql(), "mysql not available")
+ @test.skip_unless(_have_mysql(), "mysql not available")
def test_mysql_innodb(self):
"""
Test that table creation on mysql only builds InnoDB tables