예제 #1
0
 def test_wsgi_service_with_ssl_enabled(self, wsgi_server):
     self.config(enable_ssl_api=True, group='api')
     service_name = 'mogan_api'
     srv = service.WSGIService('mogan_api', CONF.api.enable_ssl_api)
     wsgi_server.assert_called_once_with(CONF,
                                         service_name,
                                         srv.app,
                                         host='0.0.0.0',
                                         port=6688,
                                         use_ssl=True)
예제 #2
0
 def test_workers_set_default(self, wsgi_server):
     service_name = "mogan_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=6688,
                                         use_ssl=False)
예제 #3
0
def main():
    gmr_opts.set_defaults(CONF)
    # Parse config file and command line options, then start logging
    mogan_service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)

    # Build and start the WSGI app
    launcher = mogan_service.process_launcher()
    server = mogan_service.WSGIService('mogan_api', CONF.api.enable_ssl_api)
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
예제 #4
0
 def test_workers_set_zero_setting(self, wsgi_server):
     self.config(api_workers=0, group='api')
     test_service = service.WSGIService("mogan_api")
     self.assertEqual(processutils.get_worker_count(), test_service.workers)
예제 #5
0
 def test_workers_set_correct_setting(self, wsgi_server):
     self.config(api_workers=8, group='api')
     test_service = service.WSGIService("mogan_api")
     self.assertEqual(8, test_service.workers)