From 0168056eb32f4830bf031bde132304f3cb64a85f Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 10 Feb 2016 15:10:48 -0500 Subject: [PATCH] Tests: Set volume listen port to test_service_listen_port These tests can fail with an error binding to port 8776. Using the same setting used by other tests allows these to work reliably. Change-Id: I64cc8a6e1cfc5fbae253d81d35b5edd1a03887ac --- cinder/tests/unit/test_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cinder/tests/unit/test_service.py b/cinder/tests/unit/test_service.py index 995d07bd1..585287f0b 100644 --- a/cinder/tests/unit/test_service.py +++ b/cinder/tests/unit/test_service.py @@ -277,6 +277,8 @@ class TestWSGIService(test.TestCase): @mock.patch('oslo_service.wsgi.Loader') def test_workers_set_default(self, mock_loader): + self.override_config('osapi_volume_listen_port', + CONF.test_service_listen_port) test_service = service.WSGIService("osapi_volume") self.assertEqual(processutils.get_worker_count(), test_service.workers) @@ -284,6 +286,8 @@ class TestWSGIService(test.TestCase): @mock.patch('oslo_service.wsgi.Loader') def test_workers_set_good_user_setting(self, mock_loader): + self.override_config('osapi_volume_listen_port', + CONF.test_service_listen_port) self.override_config('osapi_volume_workers', 8) test_service = service.WSGIService("osapi_volume") self.assertEqual(8, test_service.workers) @@ -291,6 +295,8 @@ class TestWSGIService(test.TestCase): @mock.patch('oslo_service.wsgi.Loader') def test_workers_set_zero_user_setting(self, mock_loader): + self.override_config('osapi_volume_listen_port', + CONF.test_service_listen_port) self.override_config('osapi_volume_workers', 0) test_service = service.WSGIService("osapi_volume") # If a value less than 1 is used, defaults to number of procs -- 2.45.2