Пример #1
0
def test_ignored_memory_pressure(node_base, node_memory_pressure,
                                 ignore_all_node):
    node_base["status"]["conditions"] = node_memory_pressure
    message = check_nodes([node_base], ignore_all_node).output.message
    lines = message.split('\n')
    assert lines[0] == RESULT_SUCCESS
    assert lines[1] == "|available=0 unavailable=0 degraded=0 unschedulable=0"
Пример #2
0
def test_not_ready(node_base, node_not_ready, ignore_none):
    node_base["status"]["conditions"] = node_not_ready
    assert check_nodes([node_base],
                       ignore_none).output.message.startswith(RESULT_CRITICAL)
Пример #3
0
def test_memory_pressure(node_base, node_memory_pressure, ignore_none):
    node_base["status"]["conditions"] = node_memory_pressure
    assert check_nodes([node_base],
                       ignore_none).output.message.startswith(RESULT_WARNING)
Пример #4
0
def test_output(node_full, ignore_none):
    output = check_nodes([node_full], ignore_none).output
    assert isinstance(output, Output)
Пример #5
0
def test_result(node_full, ignore_none):
    result = check_nodes([node_full], ignore_none)
    assert isinstance(result, Result)
Пример #6
0
def test_ready(node_base, node_ready):
    node_base["status"]["conditions"] = node_ready
    assert check_nodes([node_base]).output.message.startswith(RESULT_SUCCESS)
Пример #7
0
def test_output(node_full):
    output = check_nodes([node_full]).output
    assert isinstance(output, Output)
Пример #8
0
def test_result(node_full):
    result = check_nodes([node_full])
    assert isinstance(result, Result)