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"
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
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
def test_replicas_unavailable(deployment_full): replicas = deployment_full["status"] replicas["availableReplicas"] = 0 output = check_deployments([deployment_full]).output assert output.state == NaemonState.CRITICAL
def test_output(deployment_full): output = check_deployments([deployment_full]).output assert isinstance(output, Output)
def test_result(deployment_full): result = check_deployments([deployment_full]) assert isinstance(result, Result)
def test_replicas_ignored(deployment_full, ignore_none): output = check_deployments([deployment_full], ignore_none).output assert output.state == NaemonState.OK
def test_output(deployment_full, ignore_none): output = check_deployments([deployment_full], ignore_none).output assert isinstance(output, Output)
def test_result(deployment_full, ignore_none): result = check_deployments([deployment_full], ignore_none) assert isinstance(result, Result)