def servers_in_mgmt(cls, provider=None, server_group=None): if provider is None: servers = [] for _provider in list_providers_by_class(HawkularProvider): servers.extend(cls._servers_in_mgmt(_provider, server_group)) return servers else: return cls._servers_in_mgmt(provider, server_group)
def messagings_in_mgmt(cls, provider=None, server=None): if provider is None: messagings = [] for _provider in list_providers_by_class(HawkularProvider): messagings.extend(cls._messagings_in_mgmt(_provider, server)) return messagings else: return cls._messagings_in_mgmt(provider, server)
def deployments_in_mgmt(cls, provider=None, server=None): if provider is None: deployments = [] for _provider in list_providers_by_class(HawkularProvider): deployments.extend(cls._deployments_in_mgmt(_provider, server)) return deployments else: return cls._deployments_in_mgmt(provider, server)
def domains_in_mgmt(cls, provider=None): if provider is None: deployments = [] for _provider in list_providers_by_class(HawkularProvider): deployments.extend(cls._domains_in_mgmt(_provider)) return deployments else: return cls._domains_in_mgmt(provider)
def servers_in_mgmt(cls, provider=None, server_group=None): if provider is None: servers = [] for _provider in list_providers_by_class(HawkularProvider): servers.extend(cls._servers_in_mgmt(_provider, server_group)) return servers else: return cls._servers_in_mgmt(provider, server_group)
def datasources_in_mgmt(cls, provider=None, server=None): if provider is None: datasources = [] for _provider in list_providers_by_class(HawkularProvider): datasources.extend(cls._datasources_in_mgmt(_provider, server)) return datasources else: return cls._datasources_in_mgmt(provider, server)
def datasources_in_mgmt(cls, provider=None, server=None): if provider is None: datasources = [] for _provider in list_providers_by_class(HawkularProvider): datasources.extend(cls._datasources_in_mgmt(_provider, server)) return datasources else: return cls._datasources_in_mgmt(provider, server)
def messagings_in_mgmt(cls, provider=None, server=None): if provider is None: messagings = [] for _provider in list_providers_by_class(HawkularProvider): messagings.extend(cls._messagings_in_mgmt(_provider, server)) return messagings else: return cls._messagings_in_mgmt(provider, server)
def test_containers_overview_data_integrity(provider): """Test data integrity of status boxes in containers dashboard. Steps: * Go to Containers / Overview * All cells should contain the correct relevant information # of nodes # of providers # ... """ navigate_to(ContainersOverview, 'All') # We should wait ~2 seconds for the StatusBox population # (until we find a better solution) # Since we collect images from Openshift and from the pods, # images are tested separately # image registries are also tested separately time.sleep(2) statusbox_values = {data_set.object: int(StatusBox(data_set.name).value()) for data_set in DATA_SETS} api_values = get_api_object_counts( list_providers_by_class(ContainersProvider)) list_img_from_registry = provider.mgmt.list_image() list_img_from_registry_splitted = [i.id.split( '@sha256:')[-1] for i in list_img_from_registry] list_img_from_openshift = provider.mgmt.list_image_openshift() list_img_from_openshift_splitted = [d['name'] for d in list_img_from_openshift] list_img_from_openshift_parsed = [i[7:].split( '@sha256:')[-1] for i in list_img_from_openshift_splitted] list_img_from_registry_splitted_new = set(list_img_from_registry_splitted) list_img_from_openshift_parsed_new = set(list_img_from_openshift_parsed) list_img_from_openshift_parsed_new.update(list_img_from_registry_splitted_new) num_img_cfme_56 = len(provider.mgmt.list_image()) num_img_cfme_57 = len(list_img_from_openshift_parsed_new) assert StatusBox('images').value() == version.pick({version.LOWEST: num_img_cfme_56, '5.7': num_img_cfme_57}) list_all_rgstr = provider.mgmt.list_image_registry() list_all_rgstr_revised = [i.host for i in list_all_rgstr] list_all_rgstr_new = filter(lambda ch: 'openshift3' not in ch, list_all_rgstr_revised) assert len(list_all_rgstr_new) == StatusBox('registries').value() results = {} for cls in DATA_SETS: results[cls.object] = api_values[cls.object] == statusbox_values[cls.object] if not all(results.values()): pytest.fail('There is a mismatch between API and UI values:\n{}'.format( '\n'.join(['{}: {} (API) != {} (UI)'.format( obj.__name__, api_values[obj], statusbox_values[obj]) for obj, is_pass in results.items() if not is_pass])))
def test_containers_overview_data_integrity(provider): """Test data integrity of status boxes in containers dashboard. Steps: * Go to Containers / Overview * All cells should contain the correct relevant information # of nodes # of providers # ... """ navigate_to(ContainersOverview, 'All') # We should wait ~2 seconds for the StatusBox population # (until we find a better solution) # Since we collect images from Openshift and from the pods, # images are tested separately time.sleep(2) statusbox_values = { data_set.object: int(StatusBox(data_set.name).value()) for data_set in DATA_SETS } api_values = get_api_object_counts( list_providers_by_class(ContainersProvider)) list_img_from_registry = provider.mgmt.list_image() list_img_from_registry_splitted = [ i.id.split('@sha256:')[-1] for i in list_img_from_registry ] list_img_from_openshift = provider.mgmt.list_image_openshift() list_img_from_openshift_splitted = [ d['name'] for d in list_img_from_openshift ] list_img_from_openshift_parsed = [ i[7:].split('@sha256:')[-1] for i in list_img_from_openshift_splitted ] list_img_from_registry_splitted_new = set(list_img_from_registry_splitted) list_img_from_openshift_parsed_new = set(list_img_from_openshift_parsed) list_img_from_openshift_parsed_new.update( list_img_from_registry_splitted_new) num_img_cfme_56 = len(provider.mgmt.list_image()) num_img_cfme_57 = len(list_img_from_openshift_parsed_new) assert StatusBox('images').value() == version.pick({ version.LOWEST: num_img_cfme_56, '5.7': num_img_cfme_57 }) results = {} for cls in DATA_SETS: results[cls.object] = api_values[cls.object] == statusbox_values[ cls.object] if not all(results.values()): pytest.fail( 'There is a mismatch between API and UI values:\n{}'.format( '\n'.join([ '{}: {} (API) != {} (UI)'.format(obj.__name__, api_values[obj], statusbox_values[obj]) for obj, is_pass in results.items() if not is_pass ])))
def ec2_provider_crud(): try: return list_providers_by_class(EC2Provider)[0] except IndexError: pytest.skip("No EC2 provider available (required)")
def virtualcenter_provider_crud(): try: return list_providers_by_class(VMwareProvider)[0] except IndexError: pytest.skip("No VMware providers available (required)")