Beispiel #1
0
def test_cluster_check_diskstat_summary(value_store):
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.cluster_check_diskstat(
                'SUMMARY',
                {},
                {
                    'node1': {
                        'disk1': DISK_HALF,
                    },
                    'node2': {
                        'disk2': DISK_HALF,
                    },
                },
                {
                    'node1': None,
                    'node2': None,
                },
            ))
    results_cluster = list(
        diskstat.cluster_check_diskstat(
            'SUMMARY',
            {},
            {
                'node1': {
                    'disk1': DISK,
                },
                'node2': {
                    'disk2': DISK,
                },
            },
            {
                'node1': None,
                'node2': None,
            },
        ))
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.check_diskstat(
                'SUMMARY',
                {},
                {
                    'disk1': DISK_HALF,
                    'disk2': DISK_HALF,
                },
                None,
            ))
    results_non_cluster = list(
        diskstat.check_diskstat(
            'SUMMARY',
            {},
            {
                'disk1': DISK,
                'disk2': DISK,
            },
            None,
        ))
    assert results_cluster == results_non_cluster
Beispiel #2
0
def test_cluster_check_diskstat_summary():
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.cluster_check_diskstat(
                "SUMMARY",
                {},
                {
                    "node1": {
                        "disk1": DISK_HALF,
                    },
                    "node2": {
                        "disk2": DISK_HALF,
                    },
                },
                {
                    "node1": None,
                    "node2": None,
                },
            ))
    results_cluster = list(
        diskstat.cluster_check_diskstat(
            "SUMMARY",
            {},
            {
                "node1": {
                    "disk1": DISK,
                },
                "node2": {
                    "disk2": DISK,
                },
            },
            {
                "node1": None,
                "node2": None,
            },
        ))
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.check_diskstat(
                "SUMMARY",
                {},
                {
                    "disk1": DISK_HALF,
                    "disk2": DISK_HALF,
                },
                None,
            ))
    results_non_cluster = list(
        diskstat.check_diskstat(
            "SUMMARY",
            {},
            {
                "disk1": DISK,
                "disk2": DISK,
            },
            None,
        ))
    assert results_cluster == results_non_cluster
Beispiel #3
0
def test_cluster_check_diskstat_single_item():
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.cluster_check_diskstat(
                "disk1",
                {},
                {
                    "node1": {
                        "disk1": DISK_HALF,
                    },
                },
                {
                    "node1": None,
                },
            )
        )
    results_cluster = list(
        diskstat.cluster_check_diskstat(
            "disk1",
            {},
            {
                "node_overwritten": {
                    "disk1": DISK_HALF,
                },
                "node1": {
                    "disk1": DISK,
                },
            },
            {
                "node_overwritten": None,
                "node1": None,
            },
        )
    )
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.check_diskstat(
                "disk1",
                {},
                {
                    "disk1": DISK_HALF,
                },
                None,
            )
        )
    results_non_cluster = list(
        diskstat.check_diskstat(
            "disk1",
            {},
            {
                "disk1": DISK,
            },
            None,
        )
    )
    assert results_cluster == results_non_cluster
Beispiel #4
0
def test_cluster_check_diskstat_single_item(value_store):
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.cluster_check_diskstat(
                'disk1',
                {},
                {
                    'node1': {
                        'disk1': DISK_HALF,
                    },
                },
                {
                    'node1': None,
                },
            ))
    results_cluster = list(
        diskstat.cluster_check_diskstat(
            'disk1',
            {},
            {
                'node_overwritten': {
                    'disk1': DISK_HALF,
                },
                'node1': {
                    'disk1': DISK,
                },
            },
            {
                'node_overwritten': None,
                'node1': None,
            },
        ))
    with pytest.raises(IgnoreResultsError):
        list(
            diskstat.check_diskstat(
                'disk1',
                {},
                {
                    'disk1': DISK_HALF,
                },
                None,
            ))
    results_non_cluster = list(
        diskstat.check_diskstat(
            'disk1',
            {},
            {
                'disk1': DISK,
            },
            None,
        ))
    assert results_cluster == results_non_cluster