def test_wsgi_service_with_ssl_enabled(self, wsgi_server): self.config(enable_ssl_api=True, group='api') srv = service.WSGIService('ironic_api', CONF.api.enable_ssl_api) wsgi_server.assert_called_once_with(CONF, 'ironic_api', srv.app, host='0.0.0.0', port=6385, use_ssl=True)
def test_workers_set_default(self, wsgi_server): service_name = "ironic_api" test_service = service.WSGIService(service_name) self.assertEqual(processutils.get_worker_count(), test_service.workers) wsgi_server.assert_called_once_with(CONF, service_name, test_service.app, host='0.0.0.0', port=6385, use_ssl=False)
def main(): # Parse config file and command line options, then start logging ironic_service.prepare_service(sys.argv) # Enable object backporting via the conductor base.IronicObject.indirection_api = base.IronicObjectIndirectionAPI() # Build and start the WSGI app launcher = ironic_service.process_launcher() server = ironic_service.WSGIService('ironic_api', CONF.api.enable_ssl_api) launcher.launch_service(server, workers=server.workers) launcher.wait()
def test_workers_set_zero_setting(self, wsgi_server): self.config(api_workers=0, group='api') test_service = service.WSGIService("ironic_api") self.assertEqual(processutils.get_worker_count(), test_service.workers)
def test_workers_set_correct_setting(self, wsgi_server): self.config(api_workers=8, group='api') test_service = service.WSGIService("ironic_api") self.assertEqual(8, test_service.workers)
def test_workers_set_default(self, wsgi_server): test_service = service.WSGIService("ironic_api") self.assertEqual(processutils.get_worker_count(), test_service.workers)