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
This commit is contained in:
Mehdi Abaakouk 2016-10-10 20:51:40 +02:00
parent 6291da84b9
commit 5881c525a3
5 changed files with 41 additions and 5 deletions

8
bindep.txt Normal file
View File

@ -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]

View File

@ -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()

View File

@ -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")

View File

@ -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")

View File

@ -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_*