From 0972dbf225a287345387bed9e0fde0f9e8be8285 Mon Sep 17 00:00:00 2001 From: Kamoltat Date: Thu, 13 Jul 2023 19:41:29 +0000 Subject: [PATCH] qa/workunits: modified tests for noautoscale flag change modified: `qa/workunits/mon/test_noautoscale_flag.sh` `qa/workunits/cephtool/test.sh` adding test coverage to files mentioned above Fixes: https://tracker.ceph.com/issues/61922 Signed-off-by: Kamoltat --- qa/workunits/cephtool/test.sh | 2 +- qa/workunits/mon/test_noautoscale_flag.sh | 25 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index ace8bfe6d5c..aecfd56a9f5 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1508,7 +1508,7 @@ function test_mon_osd() done for f in noup nodown noin noout noscrub nodeep-scrub nobackfill \ - norebalance norecover notieragent + norebalance norecover notieragent noautoscale do ceph osd set $f ceph osd unset $f diff --git a/qa/workunits/mon/test_noautoscale_flag.sh b/qa/workunits/mon/test_noautoscale_flag.sh index ca86cdf22d3..e1a45a4d87a 100755 --- a/qa/workunits/mon/test_noautoscale_flag.sh +++ b/qa/workunits/mon/test_noautoscale_flag.sh @@ -23,7 +23,7 @@ sleep 2 RESULT1=$(ceph osd pool autoscale-status | grep -oe 'off' | wc -l) -# number of Pools with AUTOSCALE `off` should equal to 2 +# number of Pools with AUTOSCALE `off` should equal to $NUM_POOLS test "$RESULT1" -eq "$NUM_POOLS" @@ -49,7 +49,7 @@ RESULT2=$(ceph osd pool autoscale-status | grep -oe 'on' | wc -l) # number of Pools with AUTOSCALE `on` should equal to 3 -test "$RESULT2" -eq "$NUM_POOLS" +test "$RESULT2" -eq "$[NUM_POOLS-1]" ceph osd pool set noautoscale @@ -74,6 +74,27 @@ RESULT3=$(ceph osd pool autoscale-status | grep -oe 'off' | wc -l) test "$RESULT3" -eq "$NUM_POOLS" +# Now we test if we retain individual pool state of autoscale mode +# when we set and unset the noautoscale flag. + +ceph osd pool unset noautoscale + +ceph osd pool set pool_a pg_autoscale_mode on + +ceph osd pool set pool_b pg_autoscale_mode warn + +ceph osd pool set noautoscale + +ceph osd pool unset noautoscale + +RESULT4=$(ceph osd pool autoscale-status | grep pool_a | grep -o -m 1 'on\|off\|warn') +RESULT5=$(ceph osd pool autoscale-status | grep pool_b | grep -o -m 1 'on\|off\|warn') +RESULT6=$(ceph osd pool autoscale-status | grep pool_c | grep -o -m 1 'on\|off\|warn') + +test "$RESULT4" == 'on' +test "$RESULT5" == 'warn' +test "$RESULT6" == 'off' + ceph osd pool rm pool_a pool_a --yes-i-really-really-mean-it ceph osd pool rm pool_b pool_b --yes-i-really-really-mean-it