def configure_threading(): monkeypatch_thread = not CONF.standard_threads pydev_debug_url = utils.setup_remote_pydev_debug() if pydev_debug_url: # in order to work around errors caused by monkey patching we have to # set the thread to False. An explanation is here: # http://lists.openstack.org/pipermail/openstack-dev/2012-August/ # 000794.html monkeypatch_thread = False environment.use_eventlet(monkeypatch_thread)
def setUp(self): self.useFixture(database.Database()) super(AuthTest, self).setUp() self.load_backends() self.load_fixtures(default_fixtures) self.context_with_remote_user = {"environment": {"REMOTE_USER": "******", "AUTH_TYPE": "Negotiate"}} self.empty_context = {"environment": {}} self.controller = token.controllers.Auth() # This call sets up, among other things, the call to popen # that will be used to run the CMS command. These tests were # passing only due to the global nature of the call. If the # tests in this file are run alone, API calls return unauthorized. environment.use_eventlet(monkeypatch_thread=False)
def run(possible_topdir): dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') config_files = None if os.path.exists(dev_conf): config_files = [dev_conf] common.configure( version=pbr.version.VersionInfo('keystone').version_string(), config_files=config_files) paste_config = config.find_paste_config() monkeypatch_thread = not CONF.standard_threads pydev_debug_url = utils.setup_remote_pydev_debug() if pydev_debug_url: # in order to work around errors caused by monkey patching we have to # set the thread to False. An explanation is here: # http://lists.openstack.org/pipermail/openstack-dev/2012-August/ # 000794.html monkeypatch_thread = False environment.use_eventlet(monkeypatch_thread) def create_servers(): admin_worker_count = _get_workers('admin_workers') public_worker_count = _get_workers('public_workers') servers = [] servers.append(create_server(paste_config, 'admin', CONF.eventlet_server.admin_bind_host, CONF.eventlet_server.admin_port, admin_worker_count)) servers.append(create_server(paste_config, 'main', CONF.eventlet_server.public_bind_host, CONF.eventlet_server.public_port, public_worker_count)) return servers _unused, servers = common.setup_backends( startup_application_fn=create_servers) serve(*servers)
def setUp(self): super(AuthTest, self).setUp() self.load_backends() self.load_fixtures(default_fixtures) # need to register the token provider first because auth controller # depends on it token.provider.Manager() self.context_with_remote_user = {'environment': {'REMOTE_USER': '******', 'AUTH_TYPE': 'Negotiate'}} self.empty_context = {'environment': {}} self.controller = token.controllers.Auth() #This call sets up, among other things, the call to popen #that will be used to run the CMS command. These tests were #passing only due to the global nature of the call. If the #tests in this file are run alone, API calls return unauthorized. environment.use_eventlet(monkeypatch_thread=False)
def setUp(self): super(AuthTest, self).setUp() self.load_backends() self.load_fixtures(default_fixtures) self.context_with_remote_user = { 'environment': { 'REMOTE_USER': '******', 'AUTH_TYPE': 'Negotiate' } } self.empty_context = {'environment': {}} self.controller = token.controllers.Auth() #This call sets up, among other things, the call to popen #that will be used to run the CMS command. These tests were #passing only due to the global nature of the call. If the #tests in this file are run alone, API calls return unauthorized. environment.use_eventlet(monkeypatch_thread=False)
def run(possible_topdir): dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf') config_files = None if os.path.exists(dev_conf): config_files = [dev_conf] common.configure( version=pbr.version.VersionInfo('keystone').version_string(), config_files=config_files) paste_config = config.find_paste_config() monkeypatch_thread = not CONF.standard_threads pydev_debug_url = utils.setup_remote_pydev_debug() if pydev_debug_url: # in order to work around errors caused by monkey patching we have to # set the thread to False. An explanation is here: # http://lists.openstack.org/pipermail/openstack-dev/2012-August/ # 000794.html monkeypatch_thread = False environment.use_eventlet(monkeypatch_thread) def create_servers(): admin_worker_count = _get_workers('admin_workers') public_worker_count = _get_workers('public_workers') servers = [] servers.append( create_server(paste_config, 'admin', CONF.eventlet_server.admin_bind_host, CONF.eventlet_server.admin_port, admin_worker_count)) servers.append( create_server(paste_config, 'main', CONF.eventlet_server.public_bind_host, CONF.eventlet_server.public_port, public_worker_count)) return servers _unused, servers = common.setup_backends( startup_application_fn=create_servers) serve(*servers)
import sys import time import gettext from lxml import etree import mox import nose.exc from paste import deploy import stubout import unittest2 as unittest gettext.install('keystone', unicode=1) from keystone.common import environment environment.use_eventlet() from keystone import assignment from keystone import catalog from keystone.common import dependency from keystone.common import kvs from keystone.common import logging from keystone.common import sql from keystone.common import utils from keystone.common import wsgi from keystone import config from keystone.contrib import ec2 from keystone import credential from keystone import exception from keystone import identity from keystone.openstack.common import timeutils
import fixtures from oslo_config import cfg from oslo_config import fixture as config_fixture from oslo_log import log import oslotest.base as oslotest from oslotest import mockpatch import six from sqlalchemy import exc from testtools import testcase import webob # NOTE(ayoung) # environment.use_eventlet must run before any of the code that will # call the eventlet monkeypatching. from keystone.common import environment # noqa environment.use_eventlet() from keystone import auth from keystone.common import config as common_cfg from keystone.common import dependency from keystone.common import kvs from keystone.common.kvs import core as kvs_core from keystone import config from keystone import controllers from keystone import exception from keystone import notifications from keystone.policy.backends import rules from keystone.server import common from keystone import service from keystone.tests.unit import ksfixtures
def setUp(self): super(ServerTest, self).setUp() environment.use_eventlet() self.host = '127.0.0.1' self.port = '1234'