Skip to content

Commit b657f9f

Browse files
committed
qa/standalone/scrub: expand standard_scrub_cluster()
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 <[email protected]>
1 parent 071abe9 commit b657f9f

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

qa/standalone/scrub/scrub-helpers.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,21 @@ function standard_scrub_cluster() {
231231

232232
local OSDS=${args['osds_num']:-"3"}
233233
local pg_num=${args['pgs_in_pool']:-"8"}
234+
234235
local poolname="${args['pool_name']:-test}"
235236
args['pool_name']=$poolname
237+
238+
local pool_default_size=${args['pool_default_size']:-3}
239+
args['pool_default_size']=$pool_default_size
240+
236241
local extra_pars=${args['extras']}
237242
local debug_msg=${args['msg']:-"dbg"}
238243

239244
# turn off '-x' (but remember previous state)
240245
local saved_echo_flag=${-//[^x]/}
241246
set +x
242247

243-
run_mon $dir a --osd_pool_default_size=3 || return 1
248+
run_mon $dir a --osd_pool_default_size=$pool_default_size || return 1
244249
run_mgr $dir x --mgr_stats_period=1 || return 1
245250

246251
local ceph_osd_args="--osd_deep_scrub_randomize_ratio=0 \
@@ -254,22 +259,26 @@ function standard_scrub_cluster() {
254259
--osd_scrub_retry_after_noscrub=5 \
255260
--osd_scrub_retry_pg_state=5 \
256261
--osd_scrub_retry_delay=3 \
257-
--osd_pool_default_size=3 \
262+
--osd_pool_default_size=$pool_default_size \
258263
$extra_pars"
259264

260265
for osd in $(seq 0 $(expr $OSDS - 1))
261266
do
262267
run_osd $dir $osd $(echo $ceph_osd_args) || return 1
263268
done
264269

265-
create_pool $poolname $pg_num $pg_num
266-
wait_for_clean || return 1
270+
if [[ "$poolname" != "nopool" ]]; then
271+
create_pool $poolname $pg_num $pg_num
272+
wait_for_clean || return 1
273+
fi
267274

268275
# update the in/out 'args' with the ID of the new pool
269276
sleep 1
270-
name_n_id=`ceph osd dump | awk '/^pool.*'$poolname'/ { gsub(/'"'"'/," ",$3); print $3," ", $2}'`
271-
echo "standard_scrub_cluster: $debug_msg: test pool is $name_n_id"
272-
args['pool_id']="${name_n_id##* }"
277+
if [[ "$poolname" != "nopool" ]]; then
278+
name_n_id=`ceph osd dump | awk '/^pool.*'$poolname'/ { gsub(/'"'"'/," ",$3); print $3," ", $2}'`
279+
echo "standard_scrub_cluster: $debug_msg: test pool is $name_n_id"
280+
args['pool_id']="${name_n_id##* }"
281+
fi
273282
args['osd_args']=$ceph_osd_args
274283
if [[ -n "$saved_echo_flag" ]]; then set -x; fi
275284
}

0 commit comments

Comments
 (0)