Beispiel #1
0
 def storage(self):
     if not hasattr(self, '_storage'):
         # Get a storage connection
         self._storage = storage.get_storage(
             CONF['service:mdns'].storage_driver
         )
     return self._storage
Beispiel #2
0
    def setUp(self):
        super(TestCase, self).setUp()

        self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf

        self.messaging_conf = messaging_fixture.ConfFixture(cfg.CONF)
        self.messaging_conf.transport_driver = 'fake'
        self.messaging_conf.response_timeout = 5
        self.useFixture(self.messaging_conf)

        self.config(notification_driver='test')

        self.useFixture(fixtures.RPCFixture(cfg.CONF))

        self.config(storage_driver='sqlalchemy', group='service:central')

        self.config(emitter_type="noop", group="heartbeat_emitter")

        self.config(auth_strategy='noauth', group='service:api')

        # The database fixture needs to be set up here (as opposed to isolated
        # in a storage test case) because many tests end up using storage.
        REPOSITORY = os.path.abspath(
            os.path.join(os.path.dirname(__file__), '..', 'storage',
                         'impl_sqlalchemy', 'migrate_repo'))
        self.db_fixture = self.useFixture(
            fixtures.DatabaseFixture.get_fixture(REPOSITORY,
                                                 manage_database.INIT_VERSION))

        if os.getenv('DESIGNATE_SQL_DEBUG', "False").lower() in _TRUE_VALUES:
            connection_debug = 50
        else:
            connection_debug = 0

        self.config(connection=self.db_fixture.url,
                    connection_debug=connection_debug,
                    group='storage:sqlalchemy')

        self._setup_pool_manager_cache()

        self.config(network_api='fake')

        self.config(scheduler_filters=['pool_id_attribute', 'random'],
                    group='service:central')

        # "Read" Configuration
        self.CONF([], project='designate')
        utils.register_plugin_opts()

        self.useFixture(fixtures.PolicyFixture())
        self.network_api = fixtures.NetworkAPIFixture()
        self.useFixture(self.network_api)
        self.central_service = self.start_service('central')

        self.admin_context = self.get_admin_context()
        storage_driver = cfg.CONF['service:central'].storage_driver
        self.storage = storage.get_storage(storage_driver)

        # Setup the Default Pool with some useful settings
        self._setup_default_pool()
Beispiel #3
0
 def storage(self):
     if not hasattr(self, '_storage'):
         # Get a storage connection
         self._storage = storage.get_storage(
             CONF['service:mdns'].storage_driver
         )
     return self._storage
Beispiel #4
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        storage_driver = cfg.CONF['service:zone_manager'].storage_driver
        self.storage = storage.get_storage(storage_driver)

        # Get a quota manager instance
        self.quota = quota.get_quota()
Beispiel #5
0
 def storage(self):
     if not hasattr(self, '_storage'):
         # TODO(timsim): Remove this when zone_mgr goes away
         storage_driver = cfg.CONF['service:zone_manager'].storage_driver
         if cfg.CONF['service:producer'].storage_driver != storage_driver:
             storage_driver = cfg.CONF['service:producer'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage
    def setUp(self):
        super(SqlalchemyStorageTest, self).setUp()

        self.config(
            storage_driver='sqlalchemy',
            group='service:central'
        )

        self.storage = storage.get_storage()
Beispiel #7
0
    def __init__(self):
        # Get a storage connection
        storage_driver = cfg.CONF['service:mdns'].storage_driver
        self.storage = storage.get_storage(storage_driver)
        self.admin_context = DesignateContext.get_admin_context(
            all_tenants=True)

        # Fake request is used to send a response when we cannot decipher the
        # request.
        self._fake_request = dns.message.make_query('unknown', dns.rdatatype.A)
Beispiel #8
0
    def __init__(self):
        super(StorageQuota, self).__init__()

        # TODO(kiall): Should this be tied to central's config?
        storage_driver = cfg.CONF['service:central'].storage_driver
        self.storage = storage.get_storage(storage_driver)
    def __init__(self):
        super(StorageQuota, self).__init__()

        # TODO(kiall): Should this be tied to central's config?
        storage_driver = cfg.CONF['service:central'].storage_driver
        self.storage = storage.get_storage(storage_driver)
Beispiel #10
0
 def __init__(self):
     self.storage = storage.get_storage()
Beispiel #11
0
 def setUp(self):
     super(StorageTestCase, self).setUp()
     self.storage = storage.get_storage()
Beispiel #12
0
    def __init__(self, threads=None):
        super(Service, self).__init__(threads=threads)

        # Get a storage connection
        self.storage = storage.get_storage(CONF['service:mdns'].storage_driver)
Beispiel #13
0
 def setUp(self):
     super(StorageTestCase, self).setUp()
     self.storage = storage.get_storage()
Beispiel #14
0
 def storage(self):
     if not self._storage:
         self._storage = storage.get_storage(
             CONF['service:mdns'].storage_driver)
     return self._storage
Beispiel #15
0
 def storage(self):
     if not hasattr(self, '_storage'):
         # Get a storage connection
         storage_driver = cfg.CONF['service:central'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage
Beispiel #16
0
    def __init__(self):
        super(StorageQuota, self).__init__()

        # Get a storage connection
        self.storage = storage.get_storage()
Beispiel #17
0
 def setUp(self):
     super(StorageFixture, self).setUp()
     self.storage = storage.get_storage()
     self.storage.setup_schema()
     self.addCleanup(self.storage.teardown_schema)
Beispiel #18
0
 def __init__(self):
     self.storage = storage.get_storage()
Beispiel #19
0
 def __init__(self):
     # Get a storage connection
     storage_driver = cfg.CONF['service:mdns'].storage_driver
     self.storage = storage.get_storage(storage_driver)
Beispiel #20
0
 def setUp(self):
     self.config(database_connection='sqlite://',
                 group='storage:sqlalchemy')
     super(SqlalchemyStorageTest, self).setUp()
     self.storage = storage.get_storage()
     self.REPOSITORY = repository.Repository(REPOSITORY)
Beispiel #21
0
 def __init__(self, storage_driver):
     self.storage = storage.get_storage(storage_driver)
Beispiel #22
0
    def setUp(self):
        super(SqlalchemyStorageTest, self).setUp()

        self.config(storage_driver='sqlalchemy', group='service:central')

        self.storage = storage.get_storage()
Beispiel #23
0
 def storage(self):
     if not hasattr(self, '_storage'):
         storage_driver = cfg.CONF['service:worker'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage
Beispiel #24
0
 def __init__(self, storage_driver):
     self.storage = storage.get_storage(storage_driver)
Beispiel #25
0
 def storage(self):
     if not hasattr(self, '_storage'):
         storage_driver = cfg.CONF['service:worker'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage
Beispiel #26
0
 def storage(self):
     if not self._storage:
         # Get a storage connection
         storage_driver = cfg.CONF['service:central'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage
Beispiel #27
0
    def setUp(self):
        super(TestCase, self).setUp()

        self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf

        self.messaging_conf = messaging_fixture.ConfFixture(cfg.CONF)
        self.messaging_conf.transport_driver = 'fake'
        self.messaging_conf.response_timeout = 5
        self.useFixture(self.messaging_conf)

        self.config(notification_driver='test')

        self.useFixture(fixtures.RPCFixture(cfg.CONF))

        self.config(
            storage_driver='sqlalchemy',
            group='service:central'
        )

        self.config(
            auth_strategy='noauth',
            group='service:api'
        )

        # The database fixture needs to be set up here (as opposed to isolated
        # in a storage test case) because many tests end up using storage.
        REPOSITORY = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                  '..', 'storage',
                                                  'impl_sqlalchemy',
                                                  'migrate_repo'))
        self.db_fixture = self.useFixture(
            fixtures.DatabaseFixture.get_fixture(
                REPOSITORY, manage_database.INIT_VERSION))

        if os.getenv('DESIGNATE_SQL_DEBUG', "True").lower() in _TRUE_VALUES:
            connection_debug = 50
        else:
            connection_debug = 0

        self.config(
            connection=self.db_fixture.url,
            connection_debug=connection_debug,
            group='storage:sqlalchemy'
        )

        self._setup_pool_manager_cache()

        self.config(network_api='fake')

        # "Read" Configuration
        self.CONF([], project='designate')
        utils.register_plugin_opts()

        self.useFixture(fixtures.PolicyFixture())
        self.network_api = fixtures.NetworkAPIFixture()
        self.useFixture(self.network_api)
        self.central_service = self.start_service('central')

        self.admin_context = self.get_admin_context()
        storage_driver = cfg.CONF['service:central'].storage_driver
        self.storage = storage.get_storage(storage_driver)

        # Setup the Default Pool with some useful settings
        self._setup_default_pool()
Beispiel #28
0
    def setUp(self):
        super(SqlalchemyStorageTest, self).setUp()

        self.storage = storage.get_storage('sqlalchemy')
Beispiel #29
0
    def setUp(self):
        super(SqlalchemyStorageTest, self).setUp()

        self.storage = storage.get_storage('sqlalchemy')
Beispiel #30
0
 def storage(self):
     if not self._storage:
         storage_driver = cfg.CONF['service:producer'].storage_driver
         self._storage = storage.get_storage(storage_driver)
     return self._storage