Ejemplo n.º 1
0
def test_check_cond_other_ignored(pod_base, pod_condition_other,
                                  pod_containers, ignore_all_pod):
    pod_base["status"]["conditions"] = pod_condition_other
    pod_base["status"]["containerStatuses"] = pod_containers
    output = check_pods([pod_base], ignore_all_pod).output
    lines = output.message.split('\n')
    assert output.state == NaemonState.OK
    assert lines[1] == "|available=0 unavailable=0 degraded=0 pending=0"
Ejemplo n.º 2
0
def test_check_succeeded_ignored(pod_full, ignore_all_pod):
    pod_full["status"]["phase"] = "Succeeded"
    output = check_pods([pod_full], ignore_all_pod).output
    lines = output.message.split('\n')
    assert output.state == NaemonState.OK
    assert lines[1] == "|available=0 unavailable=0 degraded=0 pending=0"
Ejemplo n.º 3
0
def test_check_succeeded(pod_full, ignore_none):
    pod_full["status"]["phase"] = "Succeeded"
    assert check_pods([pod_full], ignore_none).output.state == NaemonState.OK
Ejemplo n.º 4
0
def test_check_cond_other(pod_base, pod_condition_other, pod_containers,
                          ignore_none):
    pod_base["status"]["conditions"] = pod_condition_other
    pod_base["status"]["containerStatuses"] = pod_containers
    assert check_pods([pod_base],
                      ignore_none).output.state == NaemonState.WARNING
Ejemplo n.º 5
0
def test_check_not_running(pod_base, pod_not_ready, pod_containers,
                           ignore_none):
    pod_base["status"]["conditions"] = pod_not_ready
    pod_base["status"]["containerStatuses"] = pod_containers
    assert check_pods([pod_base],
                      ignore_none).output.state == NaemonState.CRITICAL
Ejemplo n.º 6
0
def test_check_failed(pod_full, ignore_none):
    pod_full["status"]["phase"] = "Failed"
    assert check_pods([pod_full],
                      ignore_none).output.state == NaemonState.CRITICAL
Ejemplo n.º 7
0
def test_check_pending(pod_full):
    pod_full["status"]["phase"] = "Pending"
    assert check_pods([pod_full]).output.state == NaemonState.CRITICAL