aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-06-19 10:33:03 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-06-23 15:55:46 -0400
commit9e72f7601e8da3847bd6fab5e9542f1343e73130 (patch)
tree2f1aa921e1648209e3d6efd6dec316e2a4bfbca6 /meta-openstack
parent6847948b8fe689af980c92469588c6dc7727d26e (diff)
downloadmeta-cloud-services-9e72f7601e8da3847bd6fab5e9542f1343e73130.tar.gz
meta-cloud-services-9e72f7601e8da3847bd6fab5e9542f1343e73130.tar.bz2
meta-cloud-services-9e72f7601e8da3847bd6fab5e9542f1343e73130.zip
ceilometer builtin skip failed unsupported db tests
ceilometer tests against various databases: mongodb, db2, sqlalchemy, hbase. For mongodb and db2, tests use environment variables: CEILOMETER_TEST_MONGODB_URL and CEILOMETER_TEST_DB2_URL for supplying URL database connection into tests. As we do not support mangodb or db2, by not setting or setting bogus URLs to these two environment variables will cause tests to fail. These tests should be skipped as prerequisite is not satisfied. Therefore we modify ceilometer testcases for mongodb and db2 to be skipped instead of failed if CEILOMETER_TEST_MONGODB_URL and CEILOMETER_TEST_DB2_URL are not set. Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack')
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer/skip-failed-unsupported-db-ceilometer-builtin-tests.patch51
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer_git.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/skip-failed-unsupported-db-ceilometer-builtin-tests.patch b/meta-openstack/recipes-devtools/python/python-ceilometer/skip-failed-unsupported-db-ceilometer-builtin-tests.patch
new file mode 100644
index 0000000..196f71e
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-ceilometer/skip-failed-unsupported-db-ceilometer-builtin-tests.patch
@@ -0,0 +1,51 @@
+skip failed unsupported db ceilometer builtin tests
+
+Some ceilometer builtin testcases failed because they try to
+test ceilometer functionalities on top of unsupported database,
+e.g. mongodb or db2. These testcases should be skipped instead
+of letting them fail as the prerequisite is not satisfied.
+
+Signed-off-by: Vu Tran <vu.tran@windriver.com>
+
+diff --git a/ceilometer/tests/db.py b/ceilometer/tests/db.py
+index 293e022..d64c61c 100644
+--- a/ceilometer/tests/db.py
++++ b/ceilometer/tests/db.py
+@@ -35,7 +35,7 @@
+ def setUp(self):
+ super(TestBase, self).setUp()
+
+- if self.database_connection is None:
++ if self.database_connection is None or str(self.database_connection) == "":
+ self.skipTest("No connection URL set")
+
+ self.CONF = self.useFixture(config.Config()).conf
+@@ -75,13 +75,12 @@ class MongoDBFakeConnectionUrl(object):
+
+ def __init__(self):
+ self.url = os.environ.get('CEILOMETER_TEST_MONGODB_URL')
+- if not self.url:
+- raise RuntimeError(
+- "No MongoDB test URL set,"
+- "export CEILOMETER_TEST_MONGODB_URL environment variable")
+
+ def __str__(self):
+- return '%(url)s_%(db)s' % dict(url=self.url, db=uuid.uuid4().hex)
++ if not self.url:
++ return ""
++ else:
++ return '%(url)s_%(db)s' % dict(url=self.url, db=uuid.uuid4().hex)
+
+
+ class DB2FakeConnectionUrl(MongoDBFakeConnectionUrl):
+@@ -89,9 +88,7 @@ class DB2FakeConnectionUrl(MongoDBFakeConnectionUrl):
+ self.url = (os.environ.get('CEILOMETER_TEST_DB2_URL') or
+ os.environ.get('CEILOMETER_TEST_MONGODB_URL'))
+ if not self.url:
+- raise RuntimeError(
+- "No DB2 test URL set, "
+- "export CEILOMETER_TEST_DB2_URL environment variable")
++ pass
+ else:
+ # This is to make sure that the db2 driver is used when
+ # CEILOMETER_TEST_DB2_URL was not set
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
index 3d99d05..d76d0b2 100644
--- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
@@ -14,6 +14,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \
file://fix_ceilometer_memory_leak.patch \
file://ceilometer-builtin-tests-config-location.patch \
file://Use-known-protocol-scheme-in-keystone-tests.patch \
+ file://skip-failed-unsupported-db-ceilometer-builtin-tests.patch \
"
SRCREV="faada69444988c66a09ade812e10fa2ab5a0adae"