From: Jose J Palacios-Perez Date: Mon, 9 Mar 2026 16:50:15 +0000 (+0000) Subject: qa/workunits: add crimson/ and move test_crimson_dump_metrics.sh. Edit osd-dump-metri... X-Git-Tag: v21.0.0~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F67723%2Fhead;p=ceph.git qa/workunits: add crimson/ and move test_crimson_dump_metrics.sh. Edit osd-dump-metrics.yaml accordingly Signed-off-by: Jose J Palacios-Perez --- diff --git a/qa/suites/crimson-rados/singleton/all/osd-dump-metrics.yaml b/qa/suites/crimson-rados/singleton/all/osd-dump-metrics.yaml index e22c901606c2..7c0fc68f12b6 100644 --- a/qa/suites/crimson-rados/singleton/all/osd-dump-metrics.yaml +++ b/qa/suites/crimson-rados/singleton/all/osd-dump-metrics.yaml @@ -27,4 +27,4 @@ tasks: - workunit: clients: client.0: - - cephtool/test_crimson_dump_metrics.sh + - crimson/test_crimson_dump_metrics.sh diff --git a/qa/workunits/cephtool/test_crimson_dump_metrics.sh b/qa/workunits/cephtool/test_crimson_dump_metrics.sh deleted file mode 100755 index 10b373a6f1eb..000000000000 --- a/qa/workunits/cephtool/test_crimson_dump_metrics.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../standalone/ceph-helpers.sh - -set -x - -function test_dump_metrics() { - # Ensure can get dump_metrics full - ceph tell osd.0 dump_metrics 2>/dev/null > /tmp/dump_metrics_full.json || true - - # Ensure can get dump_metrics reactor_utilization: can be done with each metric name individually - ceph tell osd.0 dump_metrics reactor_utilization 2>/dev/null > /tmp/dump_metrics_reactor.json || true - - # The number of occurrences must match (must be greater than zero) - full_count=$(grep -c reactor_utilization /tmp/dump_metrics_full.json) - reactor_count=$(grep -c reactor_utilization /tmp/dump_metrics_reactor.json) - - [ $full_count -gt 0 ] || return 1 - [ $reactor_count -gt 0 ] || return 1 - [ $full_count -eq $reactor_count ] || return 1 - - # Remove auxiliary files - rm -f /tmp/dump_metrics_full.json /tmp/dump_metrics_reactor.json - return 0 # success -} - -# A more complete test: traverse the "metrics" section and ensure each metric contains the expected attributes - -test_dump_metrics || { echo "test_dump_metrics failed"; exit 1; } - -echo "OK" - diff --git a/qa/workunits/crimson/test_crimson_dump_metrics.sh b/qa/workunits/crimson/test_crimson_dump_metrics.sh new file mode 100755 index 000000000000..923083e062f1 --- /dev/null +++ b/qa/workunits/crimson/test_crimson_dump_metrics.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +. $(dirname $0)/../../standalone/ceph-helpers.sh + +set -x + +function test_dump_metrics() { + # Skip this test unless the osd_type is crimson: + [ "$(ceph osd metadata 0 | jq -r '.osd_type')" == "crimson" ] || return 0 + + # Ensure can get dump_metrics full + ceph tell osd.0 dump_metrics 2>/dev/null > /tmp/dump_metrics_full.json || true + + # Ensure can get dump_metrics reactor_utilization: can be done with each metric name individually + ceph tell osd.0 dump_metrics reactor_utilization 2>/dev/null > /tmp/dump_metrics_reactor.json || true + + # The number of occurrences must match (must be greater than zero) + full_count=$(grep -c reactor_utilization /tmp/dump_metrics_full.json) + reactor_count=$(grep -c reactor_utilization /tmp/dump_metrics_reactor.json) + + [ $full_count -gt 0 ] || return 1 + [ $reactor_count -gt 0 ] || return 1 + [ $full_count -eq $reactor_count ] || return 1 + + # Remove auxiliary files + rm -f /tmp/dump_metrics_full.json /tmp/dump_metrics_reactor.json + return 0 # success +} + +# A more complete test: traverse the "metrics" section and ensure each metric contains the expected attributes + +test_dump_metrics || { echo "test_dump_metrics failed"; exit 1; } + +echo "OK" +