def test_host_provisioning(infra_hosts_pg, host_provisioning_data, cfme_data, server_roles): prov_request_data = host_provisioning_data['provision_request'] provider_data = cfme_data['management_systems'][ prov_request_data['provider']] infra_hosts_pg = infra_hosts_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() infra_hosts_pg.select_host(host_provisioning_data['host']['name']) prov_pg = infra_hosts_pg.click_provision_host() tab_buttons = prov_pg.tabbutton_region fill_in_request(prov_request_data, provider_data, host_provisioning_data, tab_buttons) requests_pg = prov_pg.click_on_submit() Assert.equal( requests_pg.flash.message, "Host Request was Submitted, you will be notified when your Hosts are ready", "Flash message should inform of pending notification") requests_pg.wait_for_request_status('Last 7 Days', 'Ok', 30) infra_hosts_pg = requests_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() host_pg = infra_hosts_pg.click_host(host_provisioning_data['host']['name']) Assert.equal(host_pg.provider, provider_data['name'], "Provider name does not match") Assert.equal(host_pg.cluster, prov_request_data['environment']['cluster'], "Cluster does not match") ds_pg = host_pg.click_on_datastores() datastores = [ds.title for ds in ds_pg.quadicon_region.quadicons] Assert.true( set(prov_request_data['environment']['datastores']).issubset( set(datastores)), "Datastores are missing some members") mgmt_system = provider_factory(prov_request_data['provider']) mgmt_system.remove_host_from_cluster( host_provisioning_data['host']['ipaddress']) creds = ds_pg.testsetup.credentials[host_provisioning_data['host'] ['ipmi_credentials']] ipmi = IPMI(host_provisioning_data['host']['ipmi_address'], creds['username'], creds['password'], 'lanplus') ipmi.power_off() infra_hosts_pg = ds_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() infra_hosts_pg.select_host(host_provisioning_data['host']['name']) infra_hosts_pg.click_remove_host() wait_for(lambda func, host: not func(host), [ infra_hosts_pg.check_host_and_refresh, host_provisioning_data['host']['name'] ], message="wait for host delete")
def test_host_power_controls_reset(infra_hosts_pg, single_host_data): credentials = infra_hosts_pg.testsetup.credentials[single_host_data['ipmi_credentials']] ipmi_host = IPMI(hostname=single_host_data['ipmi_address'], username=credentials['username'], password=credentials['password']) ipmi_host.power_off() infra_hosts_pg.reset_host(single_host_data['name']) Assert.equal(infra_hosts_pg.flash.message, "\"%s\": Reset successfully initiated" % single_host_data['name'], "Flash message should name host as being reset") wait_for(ipmi_host.is_power_on, handle_exception=True)
def test_host_power_controls_reset(single_host_data, infra_hosts_pg): credentials = infra_hosts_pg.testsetup.credentials[ single_host_data['ipmi_credentials']] ipmi_host = IPMI(hostname=single_host_data['ipmi_address'], username=credentials['username'], password=credentials['password']) ipmi_host.power_off() infra_hosts_pg.reset_host(single_host_data['name']) Assert.equal( infra_hosts_pg.flash.message, "\"%s\": Reset successfully initiated" % single_host_data['name'], "Flash message should name host as being reset") wait_for(ipmi_host.is_power_on, handle_exception=True)
def get_ipmi(self): return IPMI( hostname=self.ipmi_address, username=self.ipmi_credentials.principal, password=self.ipmi_credentials.secret, interface_type=self.interface_type )
def test_host_provisioning(infra_hosts_pg, host_provisioning_data, cfme_data, server_roles): prov_request_data = host_provisioning_data['provision_request'] provider_data = cfme_data['management_systems'][prov_request_data['provider']] infra_hosts_pg = infra_hosts_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() infra_hosts_pg.select_host(host_provisioning_data['host']['name']) prov_pg = infra_hosts_pg.click_provision_host() tab_buttons = prov_pg.tabbutton_region fill_in_request(prov_request_data, provider_data, host_provisioning_data, tab_buttons) requests_pg = prov_pg.click_on_submit() Assert.equal(requests_pg.flash.message, "Host Request was Submitted, you will be notified when your Hosts are ready", "Flash message should inform of pending notification") requests_pg.wait_for_request_status('Last 7 Days', 'Ok', 30) infra_hosts_pg = requests_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() host_pg = infra_hosts_pg.click_host(host_provisioning_data['host']['name']) Assert.equal(host_pg.provider, provider_data['name'], "Provider name does not match") Assert.equal(host_pg.cluster, prov_request_data['environment']['cluster'], "Cluster does not match") ds_pg = host_pg.click_on_datastores() datastores = [ds.title for ds in ds_pg.quadicon_region.quadicons] Assert.true(set(prov_request_data['environment']['datastores']).issubset(set(datastores)), "Datastores are missing some members") mgmt_system = provider_factory(prov_request_data['provider']) mgmt_system.remove_host_from_cluster(host_provisioning_data['host']['ipaddress']) creds = ds_pg.testsetup.credentials[host_provisioning_data['host']['ipmi_credentials']] ipmi = IPMI(host_provisioning_data['host']['ipmi_address'], creds['username'], creds['password'], 'lanplus') ipmi.power_off() infra_hosts_pg = ds_pg.header.site_navigation_menu('Infrastructure')\ .sub_navigation_menu('Hosts').click() infra_hosts_pg.select_host(host_provisioning_data['host']['name']) infra_hosts_pg.click_remove_host() wait_for(lambda func, host: not func(host), [infra_hosts_pg.check_host_and_refresh, host_provisioning_data['host']['name']], message="wait for host delete")