]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: modified tests for noautoscale flag change 53658/head
authorKamoltat <ksirivad@redhat.com>
Thu, 13 Jul 2023 19:41:29 +0000 (19:41 +0000)
committerKamoltat <ksirivad@redhat.com>
Wed, 18 Oct 2023 13:55:15 +0000 (13:55 +0000)
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>
(cherry picked from commit 0972dbf225a287345387bed9e0fde0f9e8be8285)

qa/workunits/cephtool/test.sh
qa/workunits/mon/test_noautoscale_flag.sh

index ace8bfe6d5c1a2f4e7ebfe2ac31c288b61df3b56..aecfd56a9f53aa1edbdc80514721a794e9472d5b 100755 (executable)
@@ -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
index ca86cdf22d3872ef8049b5c4ecf2e82ade5f9098..e1a45a4d87a5e67047e7127a09edead6a5529cd6 100755 (executable)
@@ -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