Ejemplo n.º 1
0
    def setUp(self):
        CONF.compute_driver = 'fake.FakeDriver'
        CONF.set_override('use_local', True, group='conductor')

        # Mock out all of the policy enforcement (the tests don't have a defined policy)
        utils.mock_policy()

        # Copy the clean database over
        shutil.copyfile(os.path.join(CONF.state_path, CONF.sqlite_clean_db),
                        os.path.join(CONF.state_path, CONF.sqlite_db))

        self.mock_rpc = utils.mock_rpc

        self.vmsconn = utils.MockVmsConn()
        self.cobalt = co_manager.CobaltManager(vmsconn=self.vmsconn)
        self.cobalt._instance_network_info = utils.fake_networkinfo

        self.context = nova_context.RequestContext('fake', 'fake', True)
Ejemplo n.º 2
0
    def setUp(self):
        CONF.compute_driver = 'fake.FakeDriver'
        CONF.set_override('use_local', True, group='conductor')

        # Mock out all of the policy enforcement (the tests don't have a defined policy)
        utils.mock_policy()

        # Copy the clean database over
        shutil.copyfile(os.path.join(CONF.state_path, CONF.sqlite_clean_db),
                        os.path.join(CONF.state_path, CONF.sqlite_db))

        self.mock_rpc = utils.mock_rpc

        self.vmsconn = utils.MockVmsConn()
        self.cobalt = co_manager.CobaltManager(vmsconn=self.vmsconn)
        self.cobalt._instance_network_info = utils.fake_networkinfo

        self.context = nova_context.RequestContext('fake', 'fake', True)
Ejemplo n.º 3
0
    def setUp(self):

        CONF.connection_type = 'fake'
        # Copy the clean database over
        shutil.copyfile(os.path.join(CONF.state_path, CONF.sqlite_clean_db),
                        os.path.join(CONF.state_path, CONF.sqlite_db))

        self.mock_rpc = utils.mock_rpc
        self.mock_rpc.reset()

        # Mock out all of the policy enforcement (the tests don't have a defined policy)
        utils.mock_policy()

        # Mock quota checking
        utils.mock_quota()

        self.cobalt_api = gc_api.API(image_service=utils.mock_image_service())
        utils.mock_scheduler_rpcapi(self.cobalt_api.scheduler_rpcapi)
        self.context = nova_context.RequestContext('fake', 'fake', True)
        self.cobalt_service = utils.create_cobalt_service(self.context)