]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/workunits/mon/test_noautoscale_flag.sh
update ceph source to reef 18.2.1
[ceph.git] / ceph / qa / workunits / mon / test_noautoscale_flag.sh
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