From b03f5f46b2fb9084badc2c40999ab4582de95196 Mon Sep 17 00:00:00 2001 From: Ilyas Niyazov Date: Sun, 9 Feb 2025 14:56:17 +0300 Subject: [PATCH] [#369] Added test node-blobstore metrics Signed-off-by: Ilyas Niyazov --- .../testsuites/metrics/test_shard_metrics.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pytest_tests/testsuites/metrics/test_shard_metrics.py b/pytest_tests/testsuites/metrics/test_shard_metrics.py index c9b34cc2..b841734b 100644 --- a/pytest_tests/testsuites/metrics/test_shard_metrics.py +++ b/pytest_tests/testsuites/metrics/test_shard_metrics.py @@ -88,6 +88,7 @@ class TestShardMetrics(ClusterTestBase): @allure.title("Metric for shard mode") def test_shard_metrics_set_mode(self, two_shards_and_node: tuple[str, str, ClusterNode]): metrics_counter = 1 + metric_name_blobstore = "frostfs_node_blobstore_mode" shard1, shard2, node = two_shards_and_node with reporter.step("Shard1 set to mode 'read-only'"): @@ -102,6 +103,15 @@ class TestShardMetrics(ClusterTestBase): shard_id=shard1, ) + with reporter.step(f"Check {metric_name_blobstore} metrics, 'the mode will change to 'READ_ONLY'"): + check_metrics_counter( + [node], + counter_exp=metrics_counter, + command=metric_name_blobstore, + mode="READ_ONLY", + shard_id=shard1, + ) + with reporter.step("Shard2 set to mode 'degraded-read-only'"): node_shard_set_mode(node.storage_node, shard2, "degraded-read-only") @@ -114,6 +124,15 @@ class TestShardMetrics(ClusterTestBase): shard_id=shard2, ) + with reporter.step(f"Check {metric_name_blobstore} metrics, 'the mode will save 'READ_ONLY'"): + check_metrics_counter( + [node], + counter_exp=metrics_counter, + command=metric_name_blobstore, + mode="READ_ONLY", + shard_id=shard2, + ) + with reporter.step("Both shards set to mode 'read-write'"): for shard in [shard1, shard2]: node_shard_set_mode(node.storage_node, shard, "read-write") @@ -128,6 +147,16 @@ class TestShardMetrics(ClusterTestBase): shard_id=shard, ) + with reporter.step(f"Check {metric_name_blobstore} metrics, 'the mode will change to 'READ_WRITE'"): + for shard in [shard1, shard2]: + check_metrics_counter( + [node], + counter_exp=metrics_counter, + command=metric_name_blobstore, + mode="READ_WRITE", + shard_id=shard, + ) + @allure.title("Metric for error count on shard") @requires_container(PUBLIC_WITH_POLICY("REP 1 CBF 1", short_name="REP 1")) def test_shard_metrics_error_count(