]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone/scrub: expand standard_scrub_cluster()
authorRonen Friedman <rfriedma@redhat.com>
Mon, 17 Feb 2025 14:51:28 +0000 (08:51 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 20 Feb 2025 08:17:33 +0000 (02:17 -0600)
Expand scrub-helpers.sh::standard_scrub_cluster() to cater for
non-standard (i.e. - not "3") pool default size. Also - to
allow clients to specify a "nopool" pool name, preventing the
automatic creation of a pool.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
qa/standalone/scrub/scrub-helpers.sh

index dd37b643e08f4034c8392ed0d84f4de85b6b5ec8..f1618141839a9c2b8dd6b7232cb4f67159e9454a 100644 (file)
@@ -231,8 +231,13 @@ function standard_scrub_cluster() {
 
     local OSDS=${args['osds_num']:-"3"}
     local pg_num=${args['pgs_in_pool']:-"8"}
+
     local poolname="${args['pool_name']:-test}"
     args['pool_name']=$poolname
+
+    local pool_default_size=${args['pool_default_size']:-3}
+    args['pool_default_size']=$pool_default_size
+
     local extra_pars=${args['extras']}
     local debug_msg=${args['msg']:-"dbg"}
 
@@ -240,7 +245,7 @@ function standard_scrub_cluster() {
     local saved_echo_flag=${-//[^x]/}
     set +x
 
-    run_mon $dir a --osd_pool_default_size=3 || return 1
+    run_mon $dir a --osd_pool_default_size=$pool_default_size || return 1
     run_mgr $dir x --mgr_stats_period=1 || return 1
 
     local ceph_osd_args="--osd_deep_scrub_randomize_ratio=0 \
@@ -254,7 +259,7 @@ function standard_scrub_cluster() {
             --osd_scrub_retry_after_noscrub=5 \
             --osd_scrub_retry_pg_state=5 \
             --osd_scrub_retry_delay=3 \
-            --osd_pool_default_size=3 \
+            --osd_pool_default_size=$pool_default_size \
             $extra_pars"
 
     for osd in $(seq 0 $(expr $OSDS - 1))
@@ -262,14 +267,18 @@ function standard_scrub_cluster() {
       run_osd $dir $osd $(echo $ceph_osd_args) || return 1
     done
 
-    create_pool $poolname $pg_num $pg_num
-    wait_for_clean || return 1
+    if [[ "$poolname" != "nopool" ]]; then
+        create_pool $poolname $pg_num $pg_num
+        wait_for_clean || return 1
+    fi
 
     # update the in/out 'args' with the ID of the new pool
     sleep 1
-    name_n_id=`ceph osd dump | awk '/^pool.*'$poolname'/ { gsub(/'"'"'/," ",$3); print $3," ", $2}'`
-    echo "standard_scrub_cluster: $debug_msg: test pool is $name_n_id"
-    args['pool_id']="${name_n_id##* }"
+    if [[ "$poolname" != "nopool" ]]; then
+        name_n_id=`ceph osd dump | awk '/^pool.*'$poolname'/ { gsub(/'"'"'/," ",$3); print $3," ", $2}'`
+        echo "standard_scrub_cluster: $debug_msg: test pool is $name_n_id"
+        args['pool_id']="${name_n_id##* }"
+    fi
     args['osd_args']=$ceph_osd_args
     if [[ -n "$saved_echo_flag" ]]; then set -x; fi
 }