def test_type_required_validation_infra(): """Test to validate type while adding a provider""" prov = InfraProvider() with pytest.raises(AssertionError): prov.create() view = prov.create_view(InfraProviderAddView) assert not view.add.active
def test_type_required_validation(): """Test to validate type while adding a provider""" prov = InfraProvider() with error.expected(FlashMessageException): prov.create() view = prov.create_view(ProviderAddView) assert not view.add.active
def test_type_required_validation(): """Test to validate type while adding a provider""" prov = InfraProvider() err = version.pick( {version.LOWEST: 'Type is required', '5.6': FlashMessageException}) with error.expected(err): prov.create() if version.current_version() >= 5.6: assert prov.add_provider_button.is_dimmed
def test_type_required_validation(): """Test to validate type while adding a provider""" prov = InfraProvider() err = version.pick({ version.LOWEST: 'Type is required', '5.6': FlashMessageException }) with error.expected(err): prov.create() if version.current_version() >= 5.6: assert prov.add_provider_button.is_dimmed
def test_providers_summary(soft_assert): """Checks some informations about the provider. Does not check memory/frequency as there is presence of units and rounding.""" path = ["Configuration Management", "Providers", "Providers Summary"] report = CannedSavedReport.new(path) for provider in report.data.rows: if any(ptype in provider["MS Type"] for ptype in {"ec2", "openstack"}): # Skip cloud continue details_view = navigate_to(InfraProvider(name=provider["Name"]), 'Details') props = details_view.entities.properties hostname = ("Host Name", "Hostname") soft_assert( props.get_text_of(hostname[0]) == provider[hostname[1]], "Hostname does not match at {}".format(provider["Name"])) cpu_cores = props.get_text_of("Aggregate Host CPU Cores") soft_assert( cpu_cores == provider["Total Number of Logical CPUs"], "Logical CPU count does not match at {}".format(provider["Name"])) host_cpu = props.get_text_of("Aggregate Host CPUs") soft_assert( host_cpu == provider["Total Number of Physical CPUs"], "Physical CPU count does not match at {}".format(provider["Name"]))
def test_providers_summary(appliance, soft_assert): """Checks some informations about the provider. Does not check memory/frequency as there is presence of units and rounding.""" report = appliance.collections.reports.instantiate( type="Configuration Management", subtype="Providers", menu_name="Providers Summary").queue(wait_for_finish=True) # Skip cloud and network providers as they don't share some attributes with infra providers skipped_providers = {"ec2", "openstack", "redhat_network"} for provider in report.data.rows: if provider["MS Type"] in skipped_providers: continue details_view = navigate_to(InfraProvider(name=provider["Name"]), 'Details') props = details_view.entities.summary("Properties") hostname = ("Host Name", "Hostname") soft_assert( props.get_text_of(hostname[0]) == provider[hostname[1]], "Hostname does not match at {}".format(provider["Name"])) cpu_cores = props.get_text_of("Aggregate Host CPU Cores") soft_assert( cpu_cores == provider["Total Number of Logical CPUs"], "Logical CPU count does not match at {}".format(provider["Name"])) host_cpu = props.get_text_of("Aggregate Host CPUs") soft_assert( host_cpu == provider["Total Number of Physical CPUs"], "Physical CPU count does not match at {}".format(provider["Name"]))
def delete_providers_after_test(): yield InfraProvider.clear_providers()