def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.Context() self.project_id = 'test_project' self.context.tenant = self.project_id self.controller = action.VolumeActionController(self.project_id, '')
def main(argv=None, config_files=None): core.initialize() cfg.CONF(args=argv[2:], project='trio2o', default_config_files=config_files) migration_helpers.find_migrate_repo() migration_helpers.sync_repo(2)
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) # enforce foreign key constraint for sqlite core.get_engine().execute('pragma foreign_keys=on') self.context = context.Context() pod_dict = { 'pod_id': FAKE_SITE_ID, 'pod_name': FAKE_SITE_NAME, 'az_name': FAKE_AZ } config_dict = { 'service_id': FAKE_SERVICE_ID, 'pod_id': FAKE_SITE_ID, 'service_type': FAKE_TYPE, 'service_url': FAKE_URL } api.create_pod(self.context, pod_dict) api.create_pod_service_configuration(self.context, config_dict) global FAKE_RESOURCES FAKE_RESOURCES = [{'name': 'res1'}, {'name': 'res2'}] cfg.CONF.set_override(name='top_pod_name', override=FAKE_SITE_NAME, group='client') self.client = client.Client() self.client.resource_service_map[FAKE_RESOURCE] = FAKE_TYPE self.client.operation_resources_map['list'].add(FAKE_RESOURCE) self.client.operation_resources_map['create'].add(FAKE_RESOURCE) self.client.operation_resources_map['delete'].add(FAKE_RESOURCE) self.client.operation_resources_map['action'].add(FAKE_RESOURCE) self.client.service_handle_map[FAKE_TYPE] = FakeResHandle(None)
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.Context() self.project_id = 'test_pm_project' self.az_name_2 = 'b_az_pm_2' self.az_name_1 = 'b_az_pm_1' self.pod_manager = driver.DriverManager( namespace='trio2o.common.schedulers', name='pod_manager', invoke_on_load=True).driver self.b_pod_1 = { 'pod_id': 'b_pod_pm_uuid_1', 'pod_name': 'b_region_pm_1', 'az_name': self.az_name_1 } self.b_pod_2 = { 'pod_id': 'b_pod_pm_uuid_2', 'pod_name': 'b_region_pm_2', 'az_name': self.az_name_2 } self.b_pod_3 = { 'pod_id': 'b_pod_pm_uuid_3', 'pod_name': 'b_region_pm_3', 'az_name': self.az_name_2 } self.b_pod_4 = { 'pod_id': 'b_pod_pm_uuid_4', 'pod_name': 'b_region_pm_4', 'az_name': self.az_name_2 }
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) # enforce foreign key constraint for sqlite core.get_engine().execute('pragma foreign_keys=on') for opt in xservice.common_opts: if opt.name in ('worker_handle_timeout', 'job_run_expire', 'worker_sleep_time'): cfg.CONF.register_opt(opt) self.context = context.Context() self.xmanager = FakeXManager()
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) # enforce foreign key constraint for sqlite core.get_engine().execute('pragma foreign_keys=on') self.context = context.Context() top_pod = { 'pod_id': FAKE_TOP_ID, 'pod_name': FAKE_TOP_NAME, 'az_name': '' } config_dict_top = { 'service_id': FAKE_TOP_SERVICE_ID, 'pod_id': FAKE_TOP_ID, 'service_type': FAKE_SERVICE_TYPE, 'service_url': FAKE_TOP_ENDPOINT } pod_dict = { 'pod_id': FAKE_SITE_ID, 'pod_name': FAKE_SITE_NAME, 'az_name': FAKE_AZ } pod_dict2 = { 'pod_id': FAKE_SITE_ID_2, 'pod_name': FAKE_SITE_NAME_2, 'az_name': FAKE_AZ } config_dict = { 'service_id': FAKE_SERVICE_ID, 'pod_id': FAKE_SITE_ID, 'service_type': FAKE_SERVICE_TYPE, 'service_url': FAKE_SERVICE_ENDPOINT } config_dict2 = { 'service_id': FAKE_SERVICE_ID_2, 'pod_id': FAKE_SITE_ID_2, 'service_type': FAKE_SERVICE_TYPE, 'service_url': FAKE_SERVICE_ENDPOINT_2 } api.create_pod(self.context, pod_dict) api.create_pod(self.context, pod_dict2) api.create_pod(self.context, top_pod) api.create_pod_service_configuration(self.context, config_dict) api.create_pod_service_configuration(self.context, config_dict2) api.create_pod_service_configuration(self.context, config_dict_top)
def _init_db(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) # enforce foreign key constraint for sqlite core.get_engine().execute('pragma foreign_keys=on') self.context = context.Context() pod_dict = { 'pod_id': 'fake_pod_id', 'pod_name': 'fake_pod_name', 'az_name': FAKE_AZ } config_dict = { 'service_id': 'fake_service_id', 'pod_id': 'fake_pod_id', 'service_type': cons.ST_NOVA, 'service_url': 'http://127.0.0.1:8774/v2/$(tenant_id)s' } pod_dict2 = { 'pod_id': 'fake_pod_id' + '2', 'pod_name': 'fake_pod_name' + '2', 'az_name': FAKE_AZ + '2' } config_dict2 = { 'service_id': 'fake_service_id' + '2', 'pod_id': 'fake_pod_id' + '2', 'service_type': cons.ST_CINDER, 'service_url': 'http://10.0.0.2:8774/v2/$(tenant_id)s' } top_pod = { 'pod_id': 'fake_top_pod_id', 'pod_name': 'RegionOne', 'az_name': '' } top_config = { 'service_id': 'fake_top_service_id', 'pod_id': 'fake_top_pod_id', 'service_type': cons.ST_CINDER, 'service_url': 'http://127.0.0.1:19998/v2/$(tenant_id)s' } db_api.create_pod(self.context, pod_dict) db_api.create_pod(self.context, pod_dict2) db_api.create_pod(self.context, top_pod) db_api.create_pod_service_configuration(self.context, config_dict) db_api.create_pod_service_configuration(self.context, config_dict2) db_api.create_pod_service_configuration(self.context, top_config)
def setUp(self): super(MicroVersionFunctionTest, self).setUp() self.addCleanup(set_config, {}, overwrite=True) cfg.CONF.register_opts(app.common_opts) self.CONF = self.useFixture(fixture_config.Config()).conf self.CONF.set_override('auth_strategy', 'noauth') self.CONF.set_override('trio2o_db_connection', 'sqlite:///:memory:') core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.app = self._make_app() self._init_db()
def setUp(self): super(API_FunctionalTest, self).setUp() self.addCleanup(set_config, {}, overwrite=True) cfg.CONF.clear() cfg.CONF.register_opts(app.common_opts) self.CONF = self.useFixture(fixture_config.Config()).conf self.CONF.set_override('auth_strategy', 'noauth') self.CONF.set_override('trio2o_db_connection', 'sqlite:///:memory:') core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.get_admin_context() policy.populate_default_rules() self.app = self._make_app()
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.controller = pod.PodsController() self.context = context.get_admin_context()
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.Context()
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) # enforce foreign key constraint for sqlite core.get_engine().execute('pragma foreign_keys=on') self.context = context.Context()
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.get_admin_context() self.project_id = 'test_project' self.controller = aggregate.AggregateController(self.project_id)
def setUp(self): core.initialize() core.ModelBase.metadata.create_all(core.get_engine()) self.context = context.Context() self.project_id = 'test_project' self.controller = FakeServerController(self.project_id)