Esempio n. 1
0
def test_replicas_not_updated_ignored(deployment_full, ignore_all_deployment):
    replicas = deployment_full["status"]
    replicas["updatedReplicas"] = 0
    output = check_deployments([deployment_full], ignore_all_deployment).output
    lines = output.message.split('\n')
    assert output.state == NaemonState.OK
    assert lines[1] == "|available=0 unavailable=0 degraded=0 noreps=0"
Esempio n. 2
0
def test_replicas_degraded(deployment_full, deployment_replicas_degraded):
    deployment_full["status"].update(deployment_replicas_degraded)
    output = check_deployments([deployment_full]).output
    assert output.state == NaemonState.WARNING
Esempio n. 3
0
def test_replicas_not_updated(deployment_full):
    replicas = deployment_full["status"]
    replicas["updatedReplicas"] = 0
    output = check_deployments([deployment_full]).output
    assert output.state == NaemonState.CRITICAL
Esempio n. 4
0
def test_replicas_unavailable(deployment_full):
    replicas = deployment_full["status"]
    replicas["availableReplicas"] = 0
    output = check_deployments([deployment_full]).output
    assert output.state == NaemonState.CRITICAL
Esempio n. 5
0
def test_output(deployment_full):
    output = check_deployments([deployment_full]).output
    assert isinstance(output, Output)
Esempio n. 6
0
def test_result(deployment_full):
    result = check_deployments([deployment_full])
    assert isinstance(result, Result)
Esempio n. 7
0
def test_replicas_ignored(deployment_full, ignore_none):
    output = check_deployments([deployment_full], ignore_none).output
    assert output.state == NaemonState.OK
Esempio n. 8
0
def test_output(deployment_full, ignore_none):
    output = check_deployments([deployment_full], ignore_none).output
    assert isinstance(output, Output)
Esempio n. 9
0
def test_result(deployment_full, ignore_none):
    result = check_deployments([deployment_full], ignore_none)
    assert isinstance(result, Result)