def __init__(self, inputs, logger, project_name=None, username=None, password=None): self.inputs = inputs project_name = project_name or self.inputs.project_name self.username = username or self.inputs.stack_user self.password = password or self.inputs.stack_password self.project_name = project_name self.logger = logger self.nova_h = None self.quantum_h = None if self.inputs.orchestrator == 'openstack': if self.inputs.verify_thru_gui(): self.ui_login = UILogin(self, self.inputs, self.project_name, self.username, self.password) self.browser = self.ui_login.browser self.browser_openstack = self.ui_login.browser_openstack self.api_server_inspects = {} self.dnsagent_inspect = {} self.cn_inspect = {} self.agent_inspect = {} self.ops_inspects = {} self.ds_inspect = {}
def __init__(self, inputs=None, logger=None, project_name=None, username=None, password=None, domain_name=None, ini_file=None): self.inputs = inputs or ContrailTestInit(ini_file, stack_tenant=project_name) self.project_name = project_name or self.inputs.project_name self.domain_name = domain_name or self.inputs.domain_name self.username = username or self.inputs.stack_user self.password = password or self.inputs.stack_password self.logger = logger or self.inputs.logger self.nova_h = None self.quantum_h = None self.api_server_inspects = custom_dict(self.get_api_inspect_handle, 'api_inspect:'+self.project_name+':'+self.username) self.dnsagent_inspect = custom_dict(self.get_dns_agent_inspect_handle, 'dns_inspect') self.agent_inspect = custom_dict(self.get_vrouter_agent_inspect_handle, 'agent_inspect') self.ops_inspects = custom_dict(self.get_opserver_inspect_handle, 'ops_inspect') self.cn_inspect = custom_dict(self.get_control_node_inspect_handle, 'cn_inspect') self.ds_inspect = custom_dict(self.get_discovery_service_inspect_handle, 'ds_inspect') # ToDo: msenthil/sandipd rest of init needs to be better handled self.vnc_lib = self.get_vnc_lib_h() self.auth = self.get_auth_h() if self.inputs.orchestrator == 'openstack': self.project_id = self.get_project_id() if self.inputs.verify_thru_gui(): self.ui_login = UILogin(self, self.inputs, project_name, username, password) self.browser = self.ui_login.browser self.browser_openstack = self.ui_login.browser_openstack self.orch = OpenstackOrchestrator(username=self.username, password=self.password, project_id=self.project_id, project_name=self.project_name, inputs=self.inputs, vnclib=self.vnc_lib, logger=self.logger, auth_server_ip=self.inputs.auth_ip) self.nova_h = self.orch.get_compute_handler() self.quantum_h = self.orch.get_network_handler() else: # vcenter self.orch = VcenterOrchestrator(user=self.username, pwd=self.password, host=self.inputs.auth_ip, port=self.inputs.auth_port, dc_name=self.inputs.vcenter_dc, vnc=self.vnc_lib, inputs=self.inputs, logger=self.logger)
def __init__(self, inputs=None, logger=None, project_name=None, username=None, password=None, domain_name=None, input_file=None, domain_obj=None, scope='domain'): self.inputs = inputs or ContrailTestInit(input_file, stack_tenant=project_name) self.project_name = project_name or self.inputs.project_name self.domain_name = domain_name or self.inputs.domain_name self.orch_domain_name = domain_name or self.inputs.domain_name if self.orch_domain_name == 'Default': self.domain_name = 'default-domain' self.scope = scope self.username = username or self.inputs.stack_user self.password = password or self.inputs.stack_password self.logger = logger or self.inputs.logger self.nova_h = None self.quantum_h = None self.vnc_lib_fixture = None self.api_server_inspects = custom_dict( self.get_api_inspect_handle, 'api_inspect:' + self.project_name + ':' + self.username) self.dnsagent_inspect = custom_dict(self.get_dns_agent_inspect_handle, 'dns_inspect') self.agent_inspect = custom_dict(self.get_vrouter_agent_inspect_handle, 'agent_inspect') self.ops_inspects = custom_dict( self.get_opserver_inspect_handle, 'ops_inspect:' + self.project_name + ':' + self.username) self.cn_inspect = custom_dict(self.get_control_node_inspect_handle, 'cn_inspect') self.k8s_client = self.get_k8s_api_client_handle() # ToDo: msenthil/sandipd rest of init needs to be better handled self.domain_id = None if self.inputs.domain_isolation: #get admin auth to list domains and get domain_id auth = self.get_auth_h(username=self.inputs.admin_username, password=self.inputs.admin_password, project_name=self.inputs.admin_tenant, domain_name=self.inputs.admin_domain) self.domain_id = auth.get_domain_id(self.domain_name) self.auth = self.get_auth_h() self.vnc_lib = self.get_vnc_lib_h() self.project_id = self.get_project_id() if self.inputs.orchestrator == 'openstack': if self.inputs.verify_thru_gui(): self.ui_login = UILogin(self, self.inputs, project_name, username, password) self.browser = self.ui_login.browser self.browser_openstack = self.ui_login.browser_openstack self.orch = OpenstackOrchestrator(inputs=self.inputs, vnclib=self.vnc_lib, logger=self.logger, auth_h=self.auth) self.nova_h = self.orch.get_compute_handler() self.quantum_h = self.orch.get_network_handler() self.glance_h = self.orch.get_image_handler() elif self.inputs.orchestrator == 'vcenter' and self.inputs.slave_orchestrator == 'vro': self.orch = VroWorkflows(user=self.inputs.vcenter_username, pwd=self.inputs.vcenter_password, host=self.inputs.vcenter_server, port=self.inputs.vcenter_port, dc_name=self.inputs.vcenter_dc, vnc=self.vnc_lib, inputs=self.inputs, logger=self.logger) elif self.inputs.orchestrator == 'vcenter': # vcenter self.orch = VcenterOrchestrator(user=self.inputs.vcenter_username, pwd=self.inputs.vcenter_password, host=self.inputs.vcenter_server, port=self.inputs.vcenter_port, dc_name=self.inputs.vcenter_dc, vnc=self.vnc_lib, inputs=self.inputs, logger=self.logger) elif self.inputs.orchestrator == 'kubernetes': self.orch = None if self.inputs.vcenter_gw_setup: # vcenter_gateway self.slave_orch = VcenterGatewayOrch( user=self.inputs.vcenter_username, pwd=self.inputs.vcenter_password, host=self.inputs.vcenter_server, port=int(self.inputs.vcenter_port), dc_name=self.inputs.vcenter_dc, vnc=self.vnc_lib, inputs=self.inputs, logger=self.logger) self._kube_manager_inspect = None
def __init__(self, inputs, logger, project_name=None, username=None, password=None): self.inputs = inputs project_name = project_name or self.inputs.project_name username = username or self.inputs.stack_user password = password or self.inputs.stack_password self.username = username self.password = password self.project_name = project_name self.vnc_lib_fixture = VncLibFixture( username=username, password=password, domain=self.inputs.domain_name, project=project_name, inputs=self.inputs, cfgm_ip=self.inputs.cfgm_ip, api_port=self.inputs.api_server_port) self.vnc_lib_fixture.setUp() self.vnc_lib = self.vnc_lib_fixture.get_handle() self.nova_h = None self.quantum_h = None if self.inputs.orchestrator == 'openstack': self.auth = OpenstackAuth(username, password, project_name, self.inputs, logger) self.project_id = self.auth.get_project_id(self.inputs.domain_name, project_name) if self.inputs.verify_thru_gui(): self.ui_login = UILogin(self, self.inputs, project_name, username, password) self.browser = self.ui_login.browser self.browser_openstack = self.ui_login.browser_openstack self.orch = OpenstackOrchestrator(username=username, password=password, project_id=self.project_id, project_name=project_name, inputs=inputs, vnclib=self.vnc_lib, logger=logger) self.nova_h = self.orch.nova_h self.quantum_h = self.orch.quantum_h else: # vcenter self.auth = VcenterAuth(username, password, project_name, self.inputs) self.orch = VcenterOrchestrator(user=username, pwd=password, host=self.inputs.auth_ip, port=self.inputs.auth_port, dc_name=self.inputs.vcenter_dc, vnc=self.vnc_lib, inputs=self.inputs, logger=logger) self.api_server_inspects = {} self.dnsagent_inspect = {} self.cn_inspect = {} self.agent_inspect = {} self.ops_inspects = {} self.ds_inspect = {} self.update_inspect_handles()