コード例 #1
0
def test_tagwise(candu_db_restore, interval, graph_type, gp_by, host):
    """Tests for grouping host graphs by VM tag for hourly and Daily intervals

    prerequisites:
        * DB from an appliance on which C&U is enabled
        * DB should have C&U data collection enabled for Tag category
        * DB should have a VM tagged with proper tag category

    Steps:
        * Navigate to Host Utilization Page
        * Select interval(Hourly or Daily)
        * Select group by option with VM tag
        * Check graph displayed or not
        * Zoom graph to get Table
        * Check tag assigned to VM available in chart legends
        * Compare table and graph data

    Bugzilla:
        1367560

    Polarion:
        assignee: nachandr
        initialEstimate: 1/4h
        casecomponent: CandU
    """
    view = navigate_to(host, 'candu')
    data = {'interval': interval, 'group_by': gp_by}
    view.options.fill(data)

    # Check graph displayed or not
    try:
        graph = getattr(view.interval_type, graph_type)
    except AttributeError:
        pytest.fail('{} graph was not displayed'.format(graph_type))
    assert graph.is_displayed

    graph.zoom_in()
    view = view.browser.create_view(UtilizationZoomView)

    # check for chart and tag London available or not in legend list.
    view.flush_widget_cache()
    assert view.chart.is_displayed
    legends = view.chart.all_legends
    assert "London" in legends

    # compare graph and table data
    graph_data = view.chart.all_data
    # Clear cache of table widget before read else it will mismatch headers.
    view.table.clear_cache()
    table_data = view.table.read()
    compare_data_with_unit(table_data=table_data,
                           graph_data=graph_data,
                           legends=legends)
コード例 #2
0
def test_tagwise(candu_db_restore, interval, graph_type, gp_by, host):
    """Tests for grouping host graphs by VM tag for hourly and Daily intervals

    prerequisites:
        * DB from an appliance on which C&U is enabled
        * DB should have C&U data collection enabled for Tag category
        * DB should have a VM tagged with proper tag category

    Steps:
        * Navigate to Host Utilization Page
        * Select interval(Hourly or Daily)
        * Select group by option with VM tag
        * Check graph displayed or not
        * Zoom graph to get Table
        * Check tag assigned to VM available in chart legends
        * Compare table and graph data

    Bugzillas:
        * 1367560

    Polarion:
        assignee: nachandr
        initialEstimate: 1/4h
        casecomponent: CandU
    """
    view = navigate_to(host, 'candu')
    data = {'interval': interval, 'group_by': gp_by}
    view.options.fill(data)

    # Check graph displayed or not
    try:
        graph = getattr(view.interval_type, graph_type)
    except AttributeError:
        pytest.fail('{} graph was not displayed'.format(graph_type))
    assert graph.is_displayed

    graph.zoom_in()
    view = view.browser.create_view(UtilizationZoomView)

    # check for chart and tag London available or not in legend list.
    view.flush_widget_cache()
    assert view.chart.is_displayed
    legends = view.chart.all_legends
    assert "London" in legends

    # compare graph and table data
    graph_data = view.chart.all_data
    # Clear cache of table widget before read else it will mismatch headers.
    view.table.clear_cache()
    table_data = view.table.read()
    compare_data_with_unit(table_data=table_data, graph_data=graph_data, legends=legends)
コード例 #3
0
def test_tagwise(provider, interval, graph_type, gp_by, candu_tag_vm,
                 enable_candu):
    """Test Host graphs group by VM tag for hourly and Daily

    prerequisites:
        * C&U enabled appliance
        * C&U data collection enabled for Tag category
        * VM should be taged with proper tag category

    Steps:
        * Capture historical data for host and vm
        * Navigate to Host Utilization Page
        * Select interval(Hourly or Daily)
        * Select group by option with VM tag
        * Check graph displayed or not
        * Zoom graph to get Table
        * Check tag assigned to VM available in chart legends
        * Compare table and graph data

    Bugzillas:
        * 1367560
    """
    # Capture historical data for cu-24x7 and its host
    candu_tag_vm.capture_historical_data()
    host = candu_tag_vm.host
    host.capture_historical_data()
    host.wait_candu_data_available(timeout=1500)
    provider.refresh_provider_relationships()

    view = navigate_to(host, 'candu')
    back_date = datetime.now() - timedelta(days=1)
    data = {'interval': interval, 'group_by': gp_by}

    # Note: If we won't choose backdate then  we have wait for 30min at least for metric collection
    if interval == "Hourly":
        data.update({"calendar": back_date})
    view.options.fill(data)

    # Check graph displayed or not
    try:
        graph = getattr(view.interval_type, graph_type)
    except AttributeError as e:
        logger.error(e)
    assert graph.is_displayed

    def refresh():
        provider.refresh_provider_relationships()
        host.capture_historical_data()
        provider.browser.refresh()
        view.wait_displayed(timeout='20s')
        view.options.fill(data)

    # wait, for specific vm tag data. It take time to reload metrics with specific vm tag.
    wait_for(lambda: "London" in graph.all_legends,
             delay=120,
             timeout=1500,
             fail_func=refresh)

    graph.zoom_in()
    view = view.browser.create_view(UtilizationZoomView)

    # check for chart and tag London available or not in legend list.
    view.flush_widget_cache()
    assert view.chart.is_displayed
    legends = view.chart.all_legends
    assert "London" in legends

    # compare graph and table data
    graph_data = view.chart.all_data
    # Clear cache of table widget before read else it will mismatch headers.
    view.table.clear_cache()
    table_data = view.table.read()
    compare_data_with_unit(table_data=table_data,
                           graph_data=graph_data,
                           legends=legends)
コード例 #4
0
ファイル: test_host_graph.py プロジェクト: mkoura/cfme_tests
def test_tagwise(provider, interval, graph_type, gp_by, candu_tag_vm, enable_candu):
    """Test Host graphs group by VM tag for hourly and Daily

    prerequisites:
        * C&U enabled appliance
        * C&U data collection enabled for Tag category
        * VM should be taged with proper tag category

    Steps:
        * Capture historical data for host and vm
        * Navigate to Host Utilization Page
        * Select interval(Hourly or Daily)
        * Select group by option with VM tag
        * Check graph displayed or not
        * Zoom graph to get Table
        * Check tag assigned to VM available in chart legends
        * Compare table and graph data

    Bugzillas:
        * 1367560

    Polarion:
        assignee: nachandr
        initialEstimate: 1/4h
    """
    # Capture historical data for cu-24x7 and its host
    candu_tag_vm.capture_historical_data()
    host = candu_tag_vm.host
    host.capture_historical_data()
    host.wait_candu_data_available(timeout=1500)
    provider.refresh_provider_relationships()

    view = navigate_to(host, 'candu')
    back_date = datetime.now() - timedelta(days=1)
    data = {'interval': interval, 'group_by': gp_by}

    # Note: If we won't choose backdate then  we have wait for 30min at least for metric collection
    if interval == "Hourly":
        data.update({"calendar": back_date})
    view.options.fill(data)

    # Check graph displayed or not
    try:
        graph = getattr(view.interval_type, graph_type)
    except AttributeError as e:
        logger.error(e)
    assert graph.is_displayed

    def refresh():
        provider.refresh_provider_relationships()
        host.capture_historical_data()
        provider.browser.refresh()
        view.wait_displayed(timeout='20s')
        view.options.fill(data)

    # wait, for specific vm tag data. It take time to reload metrics with specific vm tag.
    wait_for(lambda: "London" in graph.all_legends,
    delay=120, timeout=1500, fail_func=refresh)

    graph.zoom_in()
    view = view.browser.create_view(UtilizationZoomView)

    # check for chart and tag London available or not in legend list.
    view.flush_widget_cache()
    assert view.chart.is_displayed
    legends = view.chart.all_legends
    assert "London" in legends

    # compare graph and table data
    graph_data = view.chart.all_data
    # Clear cache of table widget before read else it will mismatch headers.
    view.table.clear_cache()
    table_data = view.table.read()
    compare_data_with_unit(table_data=table_data, graph_data=graph_data, legends=legends)