Пример #1
0
 def setUp(self):
     super(UserPolicyTestCase, self).setUp()
     config.register_engine_opts()
     username = utils.PhysName('test_stack', 'CfnUser')
     self.fc = fakes.FakeKeystoneClient(username=username)
     cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')
     setup_dummy_db()
Пример #2
0
 def setUp(self):
     super(UserPolicyTestCase, self).setUp()
     config.register_engine_opts()
     username = utils.PhysName('test_stack', 'CfnUser')
     self.fc = fakes.FakeKeystoneClient(username=username)
     cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')
     setup_dummy_db()
Пример #3
0
    def setUp(self):
        setup_dummy_db()
        config.register_engine_opts()
        m = mox.Mox()
        self.username = '******'
        ctx = create_context(m, self.username, self.tenant)
        self.stack_name = 'service_test_stack'

        cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')

        stack = get_wordpress_stack(self.stack_name, ctx)

        setup_mocks(m, stack)
        m.ReplayAll()

        stack.store()
        stack.create()
        self.stack = stack
        self.stack_identity = stack.identifier()

        m.UnsetStubs()

        super(stackServiceTestBase, self).setUp()
        self.m.UnsetStubs()
        self.ctx = create_context(self.m, self.username, self.tenant)
        setup_mocks(self.m, self.stack)
Пример #4
0
    def setUp(self):
        setup_dummy_db()
        config.register_engine_opts()
        m = mox.Mox()
        self.username = '******'
        ctx = create_context(m, self.username, self.tenant)
        self.stack_name = 'service_test_stack'

        cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')

        stack = get_wordpress_stack(self.stack_name, ctx)

        setup_mocks(m, stack)
        m.ReplayAll()

        stack.store()
        stack.create()
        self.stack = stack
        self.stack_identity = stack.identifier()

        m.UnsetStubs()

        super(stackServiceTestBase, self).setUp()
        self.m.UnsetStubs()
        self.ctx = create_context(self.m, self.username, self.tenant)
        setup_mocks(self.m, self.stack)
Пример #5
0
 def setUp(self):
     self.m = mox.Mox()
     self.fc = fakes.FakeClient()
     self.m.StubOutWithMock(lb.LoadBalancer, 'nova')
     self.m.StubOutWithMock(instance.Instance, 'nova')
     self.m.StubOutWithMock(self.fc.servers, 'create')
     self.m.StubOutWithMock(Metadata, '__set__')
     config.register_engine_opts()
Пример #6
0
 def setUp(self):
     self.m = mox.Mox()
     self.fc = fakes.FakeClient()
     self.m.StubOutWithMock(lb.LoadBalancer, 'nova')
     self.m.StubOutWithMock(instance.Instance, 'nova')
     self.m.StubOutWithMock(self.fc.servers, 'create')
     self.m.StubOutWithMock(Metadata, '__set__')
     config.register_engine_opts()
Пример #7
0
    def setUp(self):
        super(WaitConditionHandleTest, self).setUp()
        config.register_engine_opts()
        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')

        self.fc = fakes.FakeKeystoneClient()
        setup_dummy_db()
        self.stack = self.create_stack()
Пример #8
0
    def setUp(self):
        super(WaitConditionHandleTest, self).setUp()
        config.register_engine_opts()
        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')

        self.fc = fakes.FakeKeystoneClient()
        setup_dummy_db()
        self.stack = self.create_stack()
Пример #9
0
    def setUp(self):
        self.context = context.get_admin_context()
        config.register_engine_opts()
        cfg.CONF.set_default("rpc_backend", "heat.openstack.common.rpc.impl_fake")
        cfg.CONF.set_default("verbose", True)
        cfg.CONF.set_default("engine_topic", "engine")
        cfg.CONF.set_default("host", "host")

        self.stubs = stubout.StubOutForTesting()
        super(EngineRpcAPITestCase, self).setUp()
Пример #10
0
    def setUp(self):
        self.context = context.get_admin_context()
        config.register_engine_opts()
        cfg.CONF.set_default('rpc_backend',
                             'heat.openstack.common.rpc.impl_fake')
        cfg.CONF.set_default('verbose', True)
        cfg.CONF.set_default('engine_topic', 'engine')
        cfg.CONF.set_default('host', 'host')

        self.stubs = stubout.StubOutForTesting()
        super(EngineRpcAPITestCase, self).setUp()
Пример #11
0
    def setUp(self):
        super(WaitConditionTest, self).setUp()
        config.register_engine_opts()
        setup_dummy_db()
        self.m.StubOutWithMock(wc.WaitConditionHandle, 'get_status')
        self.m.StubOutWithMock(eventlet, 'sleep')

        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')

        self.fc = fakes.FakeKeystoneClient()
Пример #12
0
    def setUp(self):
        self.context = context.get_admin_context()
        config.register_engine_opts()
        cfg.CONF.set_default('rpc_backend',
                             'heat.openstack.common.rpc.impl_fake')
        cfg.CONF.set_default('verbose', True)
        cfg.CONF.set_default('engine_topic', 'engine')
        cfg.CONF.set_default('host', 'host')

        self.stubs = stubout.StubOutForTesting()
        super(EngineRpcAPITestCase, self).setUp()
Пример #13
0
    def setUp(self):
        super(stackServiceTest, self).setUp()

        config.register_engine_opts()
        self.username = '******'
        self.tenant = 'stack_service_test_tenant'

        self.ctx = create_context(self.m, self.username, self.tenant)
        self.eng = service.EngineService('a-host', 'a-topic')
        cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')

        setup_dummy_db()
Пример #14
0
    def setUp(self):
        config.register_engine_opts()
        self.context = context.get_admin_context()
        cfg.CONF.set_default('rpc_backend',
                             'heat.openstack.common.rpc.impl_fake')
        cfg.CONF.set_default('verbose', True)
        cfg.CONF.set_default('host', 'host')

        self.stubs = stubout.StubOutForTesting()
        self.identity = dict(
            identifier.HeatIdentifier('engine_test_tenant', '6', 'wordpress'))
        super(EngineRpcAPITestCase, self).setUp()
Пример #15
0
    def setUp(self):
        super(WaitConditionTest, self).setUp()
        config.register_engine_opts()
        setup_dummy_db()
        self.m.StubOutWithMock(wc.WaitConditionHandle,
                               'get_status')

        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')

        self.stack_id = 'STACKABCD1234'
        self.fc = fakes.FakeKeystoneClient()
Пример #16
0
    def setUp(self):
        super(stackServiceTest, self).setUp()

        config.register_engine_opts()
        self.username = '******'
        self.tenant = 'stack_service_test_tenant'

        self.ctx = create_context(self.m, self.username, self.tenant)
        self.eng = service.EngineService('a-host', 'a-topic')
        cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')

        setup_dummy_db()
Пример #17
0
    def setUp(self):
        super(LoadBalancerTest, self).setUp()
        config.register_engine_opts()
        self.fc = fakes.FakeClient()
        self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
        self.m.StubOutWithMock(self.fc.servers, 'create')
        self.m.StubOutWithMock(Metadata, '__set__')
        self.fkc = test_fakes.FakeKeystoneClient(
            username='******')

        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')
        setup_dummy_db()
Пример #18
0
    def setUp(self):
        super(LoadBalancerTest, self).setUp()
        config.register_engine_opts()
        self.fc = fakes.FakeClient()
        self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
        self.m.StubOutWithMock(self.fc.servers, 'create')
        self.m.StubOutWithMock(Metadata, '__set__')
        self.fkc = test_fakes.FakeKeystoneClient(
            username='******')

        cfg.CONF.set_default('heat_waitcondition_server_url',
                             'http://127.0.0.1:8000/v1/waitcondition')
        setup_dummy_db()
Пример #19
0
    def setUp(self):
        config.register_engine_opts()
        self.context = context.get_admin_context()
        cfg.CONF.set_default('rpc_backend',
                             'heat.openstack.common.rpc.impl_fake')
        cfg.CONF.set_default('verbose', True)
        cfg.CONF.set_default('host', 'host')

        self.stubs = stubout.StubOutForTesting()
        self.identity = dict(identifier.HeatIdentifier('engine_test_tenant',
                                                       '6',
                                                       'wordpress'))
        super(EngineRpcAPITestCase, self).setUp()
Пример #20
0
    def setUp(self):
        self.maxDiff = None
        self.m = mox.Mox()

        config.register_engine_opts()
        cfg.CONF.set_default('engine_topic', 'engine')
        cfg.CONF.set_default('host', 'host')
        self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host)
        self.api_version = '1.0'

        # Create WSGI controller instance
        class DummyConfig():
            bind_port = 8000
        cfgopts = DummyConfig()
        self.controller = stacks.StackController(options=cfgopts)
        print "setup complete"
Пример #21
0
    def setUp(self):
        self.maxDiff = None
        self.m = mox.Mox()

        config.register_engine_opts()
        cfg.CONF.set_default('engine_topic', 'engine')
        cfg.CONF.set_default('host', 'host')
        self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host)
        self.api_version = '1.0'
        self.tenant = 't'

        # Create WSGI controller instance
        class DummyConfig():
            bind_port = 8004

        cfgopts = DummyConfig()
        self.controller = stacks.StackController(options=cfgopts)
Пример #22
0
    def setUp(self):
        self.maxDiff = None
        self.m = mox.Mox()

        config.register_engine_opts()
        cfg.CONF.set_default("engine_topic", "engine")
        cfg.CONF.set_default("host", "host")
        self.topic = "%s.%s" % (cfg.CONF.engine_topic, cfg.CONF.host)
        self.api_version = "1.0"

        # Create WSGI controller instance
        class DummyConfig:
            bind_port = 8000

        cfgopts = DummyConfig()
        self.controller = stacks.StackController(options=cfgopts)
        print "setup complete"
Пример #23
0
    def setUp(self):
        self.maxDiff = None
        self.m = mox.Mox()

        config.register_engine_opts()
        cfg.CONF.set_default('engine_topic', 'engine')
        cfg.CONF.set_default('host', 'host')
        self.topic = '%s.%s' % (cfg.CONF.engine_topic, cfg.CONF.host)
        self.api_version = '1.0'

        # Create WSGI controller instance
        class DummyConfig():
            bind_port = 8003

        cfgopts = DummyConfig()
        self.controller = watches.WatchController(options=cfgopts)
        print "setup complete"
Пример #24
0
def initialise():
    global _initialized
    if _initialized:
        return
    import sys
    from heat.common import config
    from heat.common import plugin_loader

    config.register_engine_opts()

    _register_modules(plugin_loader.load_modules(sys.modules[__name__]))

    from oslo.config import cfg

    plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs,
                                                 'heat.engine')
    _register_modules(plugin_loader.load_modules(plugin_pkg, True))
    _initialized = True
Пример #25
0
def initialise():
    global _initialized
    if _initialized:
        return
    import sys
    from heat.common import config
    from heat.common import plugin_loader

    config.register_engine_opts()

    _register_modules(plugin_loader.load_modules(sys.modules[__name__]))

    from oslo.config import cfg

    plugin_pkg = plugin_loader.create_subpackage(cfg.CONF.plugin_dirs,
                                                 'heat.engine')
    _register_modules(plugin_loader.load_modules(plugin_pkg, True))
    _initialized = True
Пример #26
0
 def setUp(self):
     self.m = mox.Mox()
     self.fc = fakes.FakeClient()
     self.fc.users = users.UserManager(None)
     self.fc.roles = roles.RoleManager(None)
     self.fc.ec2 = ec2.CredentialsManager(None)
     self.m.StubOutWithMock(user.User, 'keystone')
     self.m.StubOutWithMock(user.AccessKey, 'keystone')
     self.m.StubOutWithMock(self.fc.users, 'create')
     self.m.StubOutWithMock(self.fc.users, 'get')
     self.m.StubOutWithMock(self.fc.users, 'delete')
     self.m.StubOutWithMock(self.fc.users, 'list')
     self.m.StubOutWithMock(self.fc.roles, 'list')
     self.m.StubOutWithMock(self.fc.roles, 'add_user_role')
     self.m.StubOutWithMock(self.fc.ec2, 'create')
     self.m.StubOutWithMock(self.fc.ec2, 'get')
     self.m.StubOutWithMock(self.fc.ec2, 'delete')
     self.m.StubOutWithMock(eventlet, 'sleep')
     config.register_engine_opts()
     cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role')
Пример #27
0
 def setUp(self):
     self.m = mox.Mox()
     config.register_engine_opts()
Пример #28
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from heat.common import config

config.register_engine_opts()

from heat import db  # pyflakes_bypass register DB options
Пример #29
0
 def setUp(self):
     super(UserPolicyTestCase, self).setUp()
     config.register_engine_opts()
     self.fc = fakes.FakeKeystoneClient(username="******")
     cfg.CONF.set_default("heat_stack_user_role", "stack_user_role")
     setup_dummy_db()