示例#1
0
def test_cluster_check_bluecat_one_ok():
    assert list(
        bluecat_dns.cluster_check_bluecat_dns(
            type_defs.Parameters({
                "oper_states": {
                    "warning": [4],
                    "critical": [],
                },
            },),
            {
                'node1': {
                    'oper_state': 1,
                },
                'node2': {
                    'oper_state': 4,
                },
            },
        )) == [
            Result(
                state=state.OK,
                notice='[node1]: DNS is running normally',
            ),
            Result(
                state=state.OK,
                notice='[node2]: DNS is currently stopping(!)',
            ),
            Result(
                state=state.OK,
                summary='DNS is running normally on node1',
            ),
        ]
示例#2
0
def test_cluster_check_bluecat_none_ok():
    assert list(
        bluecat_dns.cluster_check_bluecat_dns(
            type_defs.Parameters({
                "oper_states": {
                    "warning": [1],
                    "critical": [2, 3],
                },
            },),
            {
                'node1': {
                    'oper_state': 1,
                },
                'node2': {
                    'oper_state': 3,
                },
            },
        )) == [
            Result(
                state=state.WARN,
                summary='[node1]: DNS is running normally',
            ),
            Result(
                state=state.CRIT,
                summary='[node2]: DNS is currently starting',
            ),
            Result(
                state=state.CRIT,
                summary='No node with OK DNS state',
            ),
        ]
示例#3
0
def test_cluster_check_bluecat_one_ok():
    assert list(
        bluecat_dns.cluster_check_bluecat_dns(
            {
                "oper_states": {
                    "warning": [4],
                    "critical": [],
                },
            },
            {
                "node1": {
                    "oper_state": 1,
                },
                "node2": {
                    "oper_state": 4,
                },
            },
        )) == [
            Result(
                state=state.OK,
                notice="[node1]: DNS is running normally",
            ),
            Result(
                state=state.OK,
                notice="[node2]: DNS is currently stopping(!)",
            ),
            Result(
                state=state.OK,
                summary="DNS is running normally on node1",
            ),
        ]
示例#4
0
def test_cluster_check_bluecat_all_ok():
    assert list(
        bluecat_dns.cluster_check_bluecat_dns(
            type_defs.Parameters(
                {
                    "oper_states": {
                        "warning": [],
                        "critical": [],
                    },
                }, ),
            {
                'node1': {
                    'oper_state': 1,
                },
                'node2': {
                    'oper_state': 1,
                },
            },
        )) == [
            Result(
                state=state.OK,
                details='[node1]: DNS is running normally',
            ),
            Result(
                state=state.OK,
                details='[node2]: DNS is running normally',
            ),
            Result(
                state=state.OK,
                summary='DNS is running normally on node2',
            ),
        ]
示例#5
0
def test_cluster_check_bluecat_none_ok():
    assert list(
        bluecat_dns.cluster_check_bluecat_dns(
            {
                "oper_states": {
                    "warning": [1],
                    "critical": [2, 3],
                },
            },
            {
                "node1": {
                    "oper_state": 1,
                },
                "node2": {
                    "oper_state": 3,
                },
            },
        )) == [
            Result(
                state=state.WARN,
                summary="[node1]: DNS is running normally",
            ),
            Result(
                state=state.CRIT,
                summary="[node2]: DNS is currently starting",
            ),
            Result(
                state=state.CRIT,
                summary="No node with OK DNS state",
            ),
        ]