summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehdi Abaakouk <sileht@redhat.com>2016-10-10 20:51:40 +0200
committerMehdi Abaakouk <sileht@redhat.com>2016-10-11 14:59:15 +0200
commit5881c525a383588c9d83dbb9aab0bd89df3997d0 (patch)
treeb5a300fbd1666954fe492c41a910cc2507b129eb
parent6291da84b9998e336aff08e554de0077c811f18a (diff)
downloadceilometer-5881c525a383588c9d83dbb9aab0bd89df3997d0.tar.gz
tests: fix tests for functional tests without dsvm
Currently functional tests pass in gate just because some calls are done on real devstack, and passed by chance. We don't need dsvm at all with pifpaf. This change fixes this tests and add bindep.txt file for new gate jobs without dsvm will be setup to ensure this doesn't happen again. The tox targets pyXX-psql are renamed pyXX-postgresql to match all other jobs names. Change-Id: I0e6cfb71cc53a47a11a12b5797fe262f9211ce22
-rw-r--r--bindep.txt8
-rw-r--r--ceilometer/tests/functional/api/__init__.py1
-rw-r--r--ceilometer/tests/functional/test_bin.py14
-rw-r--r--ceilometer/tests/functional/test_notification.py19
-rw-r--r--tox.ini4
5 files changed, 41 insertions, 5 deletions
diff --git a/bindep.txt b/bindep.txt
new file mode 100644
index 00000000..ced275c5
--- /dev/null
+++ b/bindep.txt
@@ -0,0 +1,8 @@
+libpq-dev [platform:dpkg]
+postgresql [platform:dpkg]
+mysql-client [platform:dpkg]
+mysql-server [platform:dpkg]
+build-essential [platform:dpkg]
+libffi-dev [platform:dpkg]
+mongodb [platform:dpkg]
+gettext [platform:dpkg]
diff --git a/ceilometer/tests/functional/api/__init__.py b/ceilometer/tests/functional/api/__init__.py
index 520009ca..65e98702 100644
--- a/ceilometer/tests/functional/api/__init__.py
+++ b/ceilometer/tests/functional/api/__init__.py
@@ -48,6 +48,7 @@ class FunctionalTest(db_test_base.TestBase):
self.CONF.set_override('gnocchi_is_enabled', False, group='api')
self.CONF.set_override('aodh_is_enabled', False, group='api')
+ self.CONF.set_override('panko_is_enabled', False, group='api')
self.app = self._make_app()
diff --git a/ceilometer/tests/functional/test_bin.py b/ceilometer/tests/functional/test_bin.py
index ef46a18e..0d8b2452 100644
--- a/ceilometer/tests/functional/test_bin.py
+++ b/ceilometer/tests/functional/test_bin.py
@@ -24,7 +24,9 @@ from ceilometer.tests import base
class BinTestCase(base.BaseTestCase):
def setUp(self):
super(BinTestCase, self).setUp()
- content = ("[database]\n"
+ content = ("[DEFAULT]\n"
+ "transport_url = fake://\n"
+ "[database]\n"
"connection=log://localhost\n")
if six.PY3:
content = content.encode('utf-8')
@@ -54,7 +56,9 @@ class BinTestCase(base.BaseTestCase):
b"time to live is disabled", err)
def _test_run_expirer_ttl_enabled(self, ttl_name, data_name):
- content = ("[database]\n"
+ content = ("[DEFAULT]\n"
+ "transport_url = fake://\n"
+ "[database]\n"
"%s=1\n"
"connection=log://localhost\n" % ttl_name)
if six.PY3:
@@ -85,6 +89,7 @@ class BinSendSampleTestCase(base.BaseTestCase):
super(BinSendSampleTestCase, self).setUp()
pipeline_cfg_file = self.path_get('etc/ceilometer/pipeline.yaml')
content = ("[DEFAULT]\n"
+ "transport_url = fake://\n"
"pipeline_cfg_file={0}\n".format(pipeline_cfg_file))
if six.PY3:
content = content.encode('utf-8')
@@ -121,7 +126,9 @@ class BinCeilometerPollingServiceTestCase(base.BaseTestCase):
super(BinCeilometerPollingServiceTestCase, self).tearDown()
def test_starting_with_duplication_namespaces(self):
- content = ("[database]\n"
+ content = ("[DEFAULT]\n"
+ "transport_url = fake://\n"
+ "[database]\n"
"connection=log://localhost\n")
if six.PY3:
content = content.encode('utf-8')
@@ -140,6 +147,7 @@ class BinCeilometerPollingServiceTestCase(base.BaseTestCase):
def test_polling_namespaces_invalid_value_in_config(self):
content = ("[DEFAULT]\n"
+ "transport_url = fake://\n"
"polling_namespaces = ['central']\n"
"[database]\n"
"connection=log://localhost\n")
diff --git a/ceilometer/tests/functional/test_notification.py b/ceilometer/tests/functional/test_notification.py
index 7f5cb286..67fe5611 100644
--- a/ceilometer/tests/functional/test_notification.py
+++ b/ceilometer/tests/functional/test_notification.py
@@ -104,6 +104,8 @@ class TestNotification(tests_base.BaseTestCase):
self.CONF.set_override("backend_url", None, group="coordination")
self.CONF.set_override("disable_non_metric_meters", False,
group="notification")
+ self.CONF.set_override("workload_partitioning", True,
+ group='notification')
self.setup_messaging(self.CONF)
self.srv = notification.NotificationService(0)
@@ -119,6 +121,7 @@ class TestNotification(tests_base.BaseTestCase):
)
@mock.patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock())
+ @mock.patch('ceilometer.pipeline.setup_event_pipeline', mock.MagicMock())
@mock.patch('ceilometer.event.endpoint.EventsNotificationEndpoint')
def _do_process_notification_manager_start(self,
fake_event_endpoint_class):
@@ -156,6 +159,7 @@ class TestNotification(tests_base.BaseTestCase):
self.srv.listeners[0].dispatcher.endpoints[0])
@mock.patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock())
+ @mock.patch('ceilometer.pipeline.setup_event_pipeline', mock.MagicMock())
@mock.patch('oslo_messaging.get_batch_notification_listener')
def test_unique_consumers(self, mock_listener):
@@ -505,6 +509,18 @@ class TestRealNotificationMultipleAgents(tests_base.BaseTestCase):
suffix="yaml")
return pipeline_cfg_file
+ def setup_event_pipeline(self):
+ pipeline = yaml.dump({
+ 'sources': [],
+ 'sinks': []
+ })
+ if six.PY3:
+ pipeline = pipeline.encode('utf-8')
+
+ pipeline_cfg_file = fileutils.write_to_tempfile(
+ content=pipeline, prefix="event_pipeline", suffix="yaml")
+ return pipeline_cfg_file
+
def setUp(self):
super(TestRealNotificationMultipleAgents, self).setUp()
self.CONF = self.useFixture(fixture_config.Config()).conf
@@ -512,7 +528,10 @@ class TestRealNotificationMultipleAgents(tests_base.BaseTestCase):
self.setup_messaging(self.CONF, 'nova')
pipeline_cfg_file = self.setup_pipeline(['instance', 'memory'])
+ event_pipeline_cfg_file = self.setup_event_pipeline()
self.CONF.set_override("pipeline_cfg_file", pipeline_cfg_file)
+ self.CONF.set_override("event_pipeline_cfg_file",
+ event_pipeline_cfg_file)
self.CONF.set_override("backend_url", None, group="coordination")
self.CONF.set_override("disable_non_metric_meters", False,
group="notification")
diff --git a/tox.ini b/tox.ini
index 9778c1e8..7a4c6f42 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
[tox]
minversion = 1.8
skipsdist = True
-envlist = py{34,27,35},{debug,py,py34,py27,py35}-{mongodb,mysql,pgsql,elastic,functional},pep8
+envlist = py{34,27,35},{debug,py,py34,py27,py35}-{mongodb,mysql,postgresql,elastic,functional},pep8
[testenv]
deps = .[mongo,mysql,postgresql,gnocchi]
@@ -16,7 +16,7 @@ setenv = VIRTUAL_ENV={envdir}
{mongodb,mysql,pgsql,elastic,functional}: OS_TEST_PATH=ceilometer/tests/functional/
mongodb: CEILOMETER_TEST_BACKEND=mongodb
mysql: CEILOMETER_TEST_BACKEND=mysql
- pgsql: CEILOMETER_TEST_BACKEND=postgresql
+ postgresql: CEILOMETER_TEST_BACKEND=postgresql
elastic: CEILOMETER_TEST_BACKEND=elasticsearch
functional: CEILOMETER_TEST_BACKEND={env:CEILOMETER_TEST_BACKEND:mongodb}
passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE CEILOMETER_*