def test_check_admin(aggregator, admin_instance):
    check = HarborCheck('harbor', {}, [admin_instance])
    check.check(admin_instance)
    assert_service_checks(aggregator)
    for metric, _ in HARBOR_METRICS:
        aggregator.assert_metric(metric)
    aggregator.assert_all_metrics_covered()
def test_check(aggregator, instance):
    check = HarborCheck('harbor', {}, [instance])
    check.check(instance)
    assert_service_checks(aggregator)
    for metric, needs_admin in HARBOR_METRICS:
        if needs_admin:
            continue
        aggregator.assert_metric(metric)
    aggregator.assert_all_metrics_covered()
Beispiel #3
0
def test_check_admin(aggregator, admin_instance):
    check = HarborCheck('harbor', {}, [admin_instance])
    check.check(admin_instance)

    # Return value can be empty in our env for version 2.3
    # See https://github.com/goharbor/harbor/issues/14719
    # and https://github.com/goharbor/harbor/issues/15503
    at_least = 1 if HARBOR_VERSION < VERSION_2_2 else 0
    assert_service_checks(aggregator)
    for metric, _ in HARBOR_METRICS:
        aggregator.assert_metric(metric, at_least=at_least)
    aggregator.assert_all_metrics_covered()
Beispiel #4
0
def test_check_basic_case(aggregator, instance):
    check = HarborCheck('harbor', {}, [instance])
    check.check(instance)

    assert_basic_case(aggregator)
Beispiel #5
0
def harbor_check(admin_instance):
    check = HarborCheck('harbor', {}, [admin_instance])
    return check