Skip to content

Commit

Permalink
Add test_hci_metrics_available (#8972)
Browse files Browse the repository at this point in the history
* add test_hci_metrics_available

Signed-off-by: fbalak <[email protected]>

* add blank space

Signed-off-by: fbalak <[email protected]>

* fix black

Signed-off-by: fbalak <[email protected]>

---------

Signed-off-by: fbalak <[email protected]>
  • Loading branch information
fbalak authored Jan 9, 2024
1 parent 82acaeb commit ad1ece1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ocs_ci/ocs/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,11 @@ def get_missing_metrics(
logger.error(f"failed to get results for {metric}")
metrics_without_results.append(metric)
return metrics_without_results


# hci metrics available via OCS monitoring
hci_metrics = (
"ocs_storage_client_last_heartbeat",
"ocs_storage_provider_operator_version",
"ocs_storage_client_operator_version",
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
skipif_mcg_only,
bugzilla,
runs_on_provider,
hci_provider_and_client_required,
)
from ocs_ci.framework.testlib import skipif_ocs_version, tier1
from ocs_ci.ocs import constants, ocp
Expand Down Expand Up @@ -257,3 +258,23 @@ def test_monitoring_reporting_ok_when_idle(workload_idle, threading_lock):
assert mon_validation, mon_msg
osds_msg = "ceph_osd_{up,in} metrics should indicate no OSD issues"
assert all(osd_validations), osds_msg


@blue_squad
@tier1
@runs_on_provider
@hci_provider_and_client_required
@pytest.mark.polarion_id("OCS-5204")
def test_hci_metrics_available(threading_lock):
"""
HCI metrics should be provided via OCP Prometheus.
"""
prometheus = PrometheusAPI(threading_lock=threading_lock)
list_of_metrics_without_results = metrics.get_missing_metrics(
prometheus, metrics.hci_metrics
)
msg = (
"OCS Monitoring should provide some value(s) for tested hci metrics, "
"so that the list of metrics without results is empty."
)
assert list_of_metrics_without_results == [], msg

0 comments on commit ad1ece1

Please sign in to comment.