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 <ksirivad@redhat.com>
This commit is contained in:
Kamoltat 2023-07-13 19:41:29 +00:00
parent 0bfdf6362a
commit 0972dbf225
2 changed files with 24 additions and 3 deletions

View File

@ -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

View File

@ -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