2 # -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
3 # vim:shiftwidth=4:softtabstop=4:tabstop=4:
5 # Run select tests by setting ONLY, or as arguments to the script.
6 # Skip specific tests by setting EXCEPT.
8 # Run test by setting NOSETUP=true when ltest has setup env for us
11 export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
14 ALWAYS_EXCEPT="$OST_POOLS_EXCEPT"
15 # bug number for skipped test: -
16 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
18 [ "$ALWAYS_EXCEPT$EXCEPT" ] &&
19 echo "Skipping tests: $(echo $ALWAYS_EXCEPT $EXCEPT)"
24 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
25 . $LUSTRE/tests/test-framework.sh
27 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
30 check_and_setup_lustre
32 [ "$SLOW" = "no" ] && EXCEPT_SLOW="5b 18 22 23b 25"
39 MAXFREE=${MAXFREE:-$((2000000 * OSTCOUNT))}
43 POOL2=${POOL2:-${POOL}2}
44 POOL3=${POOL3:-${POOL}3}
45 NON_EXISTANT_POOL=nonexistantpool
46 NON_EXISTANT_FS=nonexistantfs
47 INVALID_POOL=some_invalid_pool_name
49 TGT_FIRST=$(printf %04x 0)
50 TGT_MAX=$(printf %04x $((TGT_COUNT-1)))
52 TGT_LIST=$(seq 0x$TGT_FIRST $TGT_STEP 0x$TGT_MAX)
53 TGT_LIST2=$(seq 0x$TGT_FIRST 2 0x$TGT_MAX)
55 TGT_ALL="$FSNAME-OST[$TGT_FIRST-$TGT_MAX/1]"
56 TGT_HALF="$FSNAME-OST[$TGT_FIRST-$TGT_MAX/2]"
58 TGT_UUID=$(for i in $TGT_LIST; do printf "$FSNAME-OST%04x_UUID " $i; done)
59 TGT_UUID2=$(for i in $TGT_LIST2; do printf "$FSNAME-OST%04x_UUID " $i; done)
64 local count=${3:-"-1"}
68 if [[ -n $idx ]]; then
69 $SETSTRIPE -c $count -p $pool -i $idx $dir
71 $SETSTRIPE -c $count -p $pool $dir
74 error "$SETSTRIPE -p $pool $dir failed."
80 local count=${3:-"-1"}
81 local index=${4:-"-1"}
83 $SETSTRIPE -i $index -c $count -p $pool $file
85 error "$SETSTRIPE -p $pool $file failed."
91 for i in $(do_facet $SINGLEMDS lctl pool_list $FSNAME.$pool |
92 grep -v "^Pool:" | sed -e 's/_UUID$//;s/^.*-OST//'); do
93 res="$res $(printf "%d" 0x$i)"
101 local res=$($GETSTRIPE $dir | grep "^stripe_count:" |
102 cut -d ':' -f 5 | tr -d "[:blank:]")
103 if [[ "$res" != "$pool" ]]; then
104 error found $res instead of $pool
111 check_file_in_pool() {
112 local osts=$(osts_in_pool $2)
113 check_file_in_osts $1 "$osts" $3
116 check_file_in_osts() {
118 local pool_list=${2:-$TGT_LIST}
120 local res=$($GETSTRIPE $file | grep 0x | cut -f2)
123 found=$(echo :$pool_list: | tr " " ":" | grep :$i:)
124 if [[ "$found" == "" ]]; then
125 echo "pool list: $pool_list"
126 echo "striping: $res"
128 error "$file not allocated from OSTs $pool_list."
133 local ost_count=$($GETSTRIPE $file | grep 0x | wc -l)
134 [[ -n "$count" ]] && [[ $ost_count -ne $count ]] &&
135 { error "Stripe count $count expected; got $ost_count" && return 1;}
141 $GETSTRIPE -v $1 | grep "^lmm_pool:" | tr -d "[:blank:]" | cut -f 2 -d ':'
144 check_file_not_in_pool() {
147 local res=$(file_pool $file)
149 if [[ "$res" == "$pool" ]]; then
150 error "File $file is in pool: $res"
157 check_dir_not_in_pool() {
160 local res=$($GETSTRIPE -v $dir | grep "^stripe_count" | head -1 |
162 if [[ "$res" == "$pool" ]]; then
163 error "File $dir is in pool: $res"
171 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$pool" "" ||
172 error "Failed to remove targets from pool: $pool"
178 local tgt="${3}$(lctl get_param -n lov.$FSNAME-*.pools.$pool |
179 sort -u | tr '\n' ' ')"
181 do_facet $SINGLEMDS lctl pool_add $FSNAME.$pool $osts
183 [[ $RC -ne 0 ]] && return $RC
185 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$pool |
186 sort -u | tr '\n' ' ' " "$tgt" >/dev/null || RC=1
187 [[ $RC -ne 0 ]] && error "pool_add failed: $1; $2"
191 create_pool_nofail() {
192 create_pool $FSNAME.$1
193 if [[ $? != 0 ]]; then
194 error "Pool creation of $1 failed"
199 create_pool $FSNAME.$1
200 if [[ $? == 0 ]]; then
201 error "Pool creation of $1 succeeded; should have failed"
206 # Destroy pools from previous test runs
207 for p in $(do_facet $SINGLEMDS lctl pool_list $FSNAME | grep $POOL); do
210 rm -rf $DIR/d0.${TESTSUITE}
218 trap "cleanup_tests $FSNAME" EXIT
222 remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
223 remote_ost_nodsh && skip "remote OST with nodsh" && exit 0
227 # Tests for new commands added
233 run_test 1a "Create a pool with a 1 character pool name"
237 create_pool_nofail ${POOL}12
238 destroy_pool ${POOL}12
240 run_test 1b "Create a pool with a 10 character pool name"
244 create_pool_nofail ${POOL}12345678
245 destroy_pool ${POOL}12345678
247 run_test 1c "Create a pool with a 16 character pool name"
251 create_pool_fail ${POOL}123456789
253 run_test 1d "Create a pool with a 17 char pool name; should fail"
257 local pool_name="$POOL"
258 for ((i = 1; i <= 991; i++)); do pool_name=${pool_name}"o"; done
259 create_pool_fail $pool_name
261 run_test 1e "Create a pool with a 1000 char pool name; should fail"
265 do_facet $SINGLEMDS lctl pool_new .$POOL 2>/dev/null
267 error "pool_new did not fail even though fs-name was missing"
269 run_test 1f "pool_new should fail if fs-name is missing"
273 do_facet $SINGLEMDS lctl pool_new $POOL 2>/dev/null
275 error "pool_new did not fail even though fs-name was missing"
277 run_test 1g "pool_new should fail if fs-name is missing"
281 do_facet $SINGLEMDS lctl pool_new ${FSNAME}. 2>/dev/null
283 error "pool_new did not fail even though pool name was missing"
285 run_test 1h "pool_new should fail if poolname is missing"
289 do_facet $SINGLEMDS lctl pool_new . 2>/dev/null
291 error "pool_new did not fail even if pool and fs-name were missing"
293 run_test 1i "pool_new should fail if poolname and fs-name are missing"
297 do_facet $SINGLEMDS lctl pool_new ${FSNAME},$POOL 2>/dev/null
299 error "pool_new did not fail even though pool name format was wrong"
301 run_test 1j "pool_new should fail if poolname format is wrong"
305 do_facet $SINGLEMDS lctl pool_new ${FSNAME}/$POOL 2>/dev/null
307 error "pool_new did not fail even though pool name format was wrong"
309 run_test 1k "pool_new should fail if poolname format is wrong"
313 create_pool_nofail $POOL2
314 do_facet $SINGLEMDS lctl pool_new ${FSNAME}.$POOL2 2>/dev/null
316 error "pool_new did not fail even though $POOL2 existed"
319 run_test 1m "pool_new did not fail even though $POOL2 existed"
325 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000 2>/dev/null
327 error "pool_add did not fail even though $POOL did not exist"
329 run_test 2a "pool_add: non-existant pool $POOL"
333 do_facet $SINGLEMDS lctl pool_add $FSNAME.${POOL}1234567890 \
334 $FSNAME-OST0000 2>/dev/null
336 error "pool_add did not fail even though pool name was invalid."
338 run_test 2b "pool_add: Invalid pool name"
340 # Testing various combinations of OST name list
346 lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
347 [[ $? -ne 0 ]] || destroy_pool $POOL
349 create_pool_nofail $POOL
352 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL OST0000
353 RC=$?; [[ $RC -eq 0 ]] ||
354 error "pool_add failed. $FSNAME $POOL OST0000: $RC"
355 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL OST0000
359 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000
360 RC=$?; [[ $RC -eq 0 ]] ||
361 error "pool_add failed. $FSNAME $POOL $FSNAME-OST0000: $RC"
362 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $FSNAME-OST0000
365 # 3. $FSNAME-OST0000_UUID
366 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000_UUID
367 RC=$?; [[ $RC -eq 0 ]] ||
368 error "pool_add failed. $FSNAME $POOL $FSNAME-OST0000_UUID: $RC"
369 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $FSNAME-OST0000_UUID
372 # 4. $FSNAME-OST[0,1,2,3,]
374 for i in $TGT_LIST; do TGT=${TGT}$(printf "%04x," $i); done
376 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $TGT
377 [[ $? -eq 0 ]] || error "pool_add failed. $FSNAME.$POOL $TGT. $RC"
378 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $TGT
381 # 5. $FSNAME-OST[0-5/1]
382 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $TGT_ALL
383 RC=$?; [[ $RC -eq 0 ]] ||
384 error "pool_add failed. $FSNAME $POOL" "$TGT_ALL $RC"
385 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL |
386 sort -u | tr '\n' ' ' " "$TGT_UUID" || error "Add to pool failed"
387 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $TGT_ALL
392 run_test 2c "pool_add: OST index combinations"
399 lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
400 [[ $? -ne 0 ]] || destroy_pool $POOL
402 create_pool_nofail $POOL
404 TGT=$(printf "$FSNAME-OST%04x_UUID " $OSTCOUNT)
405 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $TGT
406 RC=$?; [[ $RC -ne 0 ]] ||
407 error "pool_add succeeded for an OST ($TGT) that does not exist."
411 run_test 2d "pool_add: OSTs that don't exist should be rejected"
419 $LCTL get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
420 [[ $? -ne 0 ]] || destroy_pool $POOL
422 create_pool_nofail $POOL
424 TGT="$FSNAME-OST0000_UUID "
425 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $TGT
426 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL |
427 sort -u | tr '\n' ' ' " "$TGT" || error "Add to pool failed"
428 RESULT=$(do_facet $SINGLEMDS \
429 "LOCALE=C $LCTL pool_add $FSNAME.$POOL $TGT 2>&1")
434 error "pool_add succeeded for an OST that was already in the pool."
436 [[ $(grep "already in pool" <<< $RESULT) ]] ||
437 error "pool_add failed as expected but error message not as expected."
441 run_test 2e "pool_add: OST already in a pool should be rejected"
445 lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
446 [[ $? -ne 0 ]] || destroy_pool $POOL
448 do_facet $SINGLEMDS \
449 lctl pool_remove $FSNAME.$POOL $FSNAME-OST0000 2>/dev/null
451 error "pool_remove did not fail even though pool did not exist."
453 run_test 3a "pool_remove: non-existant pool"
457 do_facet $SINGLEMDS \
458 lctl pool_remove ${NON_EXISTANT_FS}.$POOL OST0000 2>/dev/null
460 error "pool_remove did not fail even though fsname did not exist."
462 run_test 3b "pool_remove: non-existant fsname"
466 do_facet $SINGLEMDS lctl pool_remove $FSNAME.p1234567891234567890 \
467 $FSNAME-OST0000 2>/dev/null
469 error "pool_remove did not fail even though pool name was invalid."
471 run_test 3c "pool_remove: Invalid pool name"
473 # Testing various combinations of OST name list
476 lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
477 [[ $? -ne 0 ]] || destroy_pool $POOL
479 create_pool_nofail $POOL
480 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL OST0000
481 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL OST0000
482 [[ $? -eq 0 ]] || error "pool_remove failed. $FSNAME $POOL OST0000"
485 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000
486 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $FSNAME-OST0000
487 [[ $? -eq 0 ]] || error "pool_remove failed. $FSNAME $POOL $FSNAME-OST0000"
490 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $FSNAME-OST0000_UUID
491 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $FSNAME-OST0000_UUID
493 error "pool_remove failed. $FSNAME $POOL $FSNAME-OST0000_UUID"
496 add_pool $POOL $TGT_ALL "$TGT_UUID"
497 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $TGT_ALL
498 [[ $? -eq 0 ]] || error "pool_remove failed. $FSNAME $POOL" $TGT_ALL
503 run_test 3d "pool_remove: OST index combinations"
507 lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null
508 [[ $? -ne 0 ]] || destroy_pool $POOL
510 do_facet $SINGLEMDS lctl pool_destroy $FSNAME.$POOL 2>/dev/null
512 error "pool_destroy did not fail even though pool did not exist."
514 run_test 4a "pool_destroy: non-existant pool"
518 do_facet $SINGLEMDS lctl pool_destroy ${NON_EXISTANT_FS}.$POOL 2>/dev/null
520 error "pool_destroy did not fail even though filesystem did not exist."
522 run_test 4b "pool_destroy: non-existant fs-name"
526 create_pool_nofail $POOL
527 add_pool $POOL "OST0000" "$FSNAME-OST0000_UUID "
529 do_facet $SINGLEMDS lctl pool_destroy ${FSNAME}.$POOL
530 [[ $? -ne 0 ]] || error "pool_destroy succeeded with a non-empty pool."
533 run_test 4c "pool_destroy: non-empty pool"
538 $LCMD pool_list 2>/dev/null
539 [[ $? -ne 0 ]] || error "pool_list did not fail even though fsname missing."
541 destroy_pool $POOL 2>/dev/null
542 destroy_pool $POOL2 2>/dev/null
544 create_pool_nofail $POOL
545 create_pool_nofail $POOL2
546 $LCMD pool_list $FSNAME
547 [[ $? -eq 0 ]] || error "pool_list $FSNAME failed."
549 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL $TGT_ALL
551 $LCMD pool_list $FSNAME.$POOL
552 [[ $? -eq 0 ]] || error "pool_list $FSNAME.$POOL failed."
554 $LCMD pool_list ${NON_EXISTANT_FS} 2>/dev/null
555 [[ $? -ne 0 ]] || error "pool_list did not fail for fsname $NON_EXISTANT_FS"
557 $LCMD pool_list ${FSNAME}.$NON_EXISTANT_POOL 2>/dev/null
558 [[ $? -ne 0 ]] || error "pool_list did not fail for pool $NON_EXISTANT_POOL"
560 if [[ ! $(grep $SINGLEMDS <<< $LCMD) ]]; then
561 echo $LCMD pool_list $DIR
563 [[ $? -eq 0 ]] || error "pool_list failed for $DIR"
566 $LCMD pool_list ${DIR}/d1
567 [[ $? -eq 0 ]] || error "pool_list failed for ${DIR}/d1"
570 rm -rf ${DIR}nonexistant
571 $LCMD pool_list ${DIR}nonexistant 2>/dev/null
573 error "pool_list did not fail for invalid mountpoint ${DIR}nonexistant"
581 # Issue commands from client
584 run_test 5a "lfs pool_list from client"
588 sub_test_5 "do_facet $SINGLEMDS lctl"
590 run_test 5b "lctl pool_list from MDS"
594 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
595 local POOL_DIR=$POOL_ROOT/dir_tst
596 local POOL_FILE=$POOL_ROOT/file_tst
598 create_pool_nofail $POOL
600 do_facet $SINGLEMDS lctl pool_list $FSNAME
601 [[ $? -eq 0 ]] || error "pool_list $FSNAME failed."
603 add_pool $POOL $TGT_ALL "$TGT_UUID"
606 $SETSTRIPE -c -1 -p $POOL $POOL_DIR
607 [[ $? -eq 0 ]] || error "$SETSTRIPE -p $POOL failed."
608 check_dir_in_pool $POOL_DIR $POOL
610 # If an invalid pool name is specified, the command should fail
611 $SETSTRIPE -c 2 -p $INVALID_POOL $POOL_DIR 2>/dev/null
612 [[ $? -ne 0 ]] || error "setstripe to invalid pool did not fail."
614 # If the pool name does not exist, the command should fail
615 $SETSTRIPE -c 2 -p $NON_EXISTANT_POOL $POOL_DIR 2>/dev/null
616 [[ $? -ne 0 ]] || error "setstripe to non-existant pool did not fail."
618 # lfs setstripe should work as before if a pool name is not specified.
619 $SETSTRIPE -c -1 $POOL_DIR
620 [[ $? -eq 0 ]] || error "$SETSTRIPE -p $POOL_DIR failed."
621 $SETSTRIPE -c -1 $POOL_FILE
622 [[ $? -eq 0 ]] || error "$SETSTRIPE -p $POOL_FILE failed."
624 # lfs setstripe should fail if a start index that is outside the
626 create_pool_nofail $POOL2
627 add_pool $POOL2 "OST0000" "$FSNAME-OST0000_UUID "
628 $SETSTRIPE -i 1 -p $POOL2 $ROOT_POOL/$tfile 2>/dev/null
630 error "$SETSTRIPE with start index outside the pool did not fail."
633 run_test 6 "getstripe/setstripe"
637 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
639 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
641 create_pool_nofail $POOL
642 create_pool_nofail $POOL2
644 local start=$(printf %04x $((TGT_FIRST + 1)))
645 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL2 \
646 $FSNAME-OST[$start-$TGT_MAX/2]
648 add_pool $POOL $TGT_HALF "$TGT_UUID2"
650 create_dir $POOL_ROOT/dir1 $POOL
651 create_dir $POOL_ROOT/dir2 $POOL2
652 check_dir_in_pool $POOL_ROOT/dir1 $POOL
653 check_dir_in_pool $POOL_ROOT/dir1 $POOL
656 createmany -o $POOL_ROOT/dir1/$tfile $numfiles ||
657 error "createmany $POOL_ROOT/dir1/$tfile failed!"
659 for file in $POOL_ROOT/dir1/*; do
660 check_file_in_pool $file $POOL
663 createmany -o $POOL_ROOT/dir2/$tfile $numfiles ||
664 error "createmany $POOL_ROOT/dir2/$tfile failed!"
665 for file in $POOL_ROOT/dir2/*; do
666 check_file_in_pool $file $POOL2
669 rm -rf $POOL_ROOT/dir?
673 run_test 11 "OSTs in overlapping/multiple pools"
677 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
679 [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
681 create_pool_nofail $POOL
682 create_pool_nofail $POOL2
684 local start=$(printf %04x $((TGT_FIRST + 1)))
685 do_facet $SINGLEMDS lctl pool_add $FSNAME.$POOL2 \
686 $FSNAME-OST[$start-$TGT_MAX/2]
688 add_pool $POOL $TGT_HALF "$TGT_UUID2"
690 echo creating some files in $POOL and $POOL2
692 create_dir $POOL_ROOT/dir1 $POOL
693 create_dir $POOL_ROOT/dir2 $POOL2
694 create_file $POOL_ROOT/file1 $POOL
695 create_file $POOL_ROOT/file2 $POOL2
697 echo Checking the files created
698 check_dir_in_pool $POOL_ROOT/dir1 $POOL
699 check_dir_in_pool $POOL_ROOT/dir2 $POOL2
700 check_file_in_pool $POOL_ROOT/file1 $POOL
701 check_file_in_pool $POOL_ROOT/file2 $POOL2
703 echo Changing the pool membership
704 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$POOL $FSNAME-OST[$TGT_FIRST]
705 do_facet $SINGLEMDS lctl pool_list $FSNAME.$POOL
706 FIRST_UUID=$(echo $TGT_UUID | awk '{print $1}')
707 add_pool $POOL2 $FSNAME-OST[$TGT_FIRST] "$FIRST_UUID "
708 do_facet $SINGLEMDS lctl pool_list $FSNAME.$POOL2
710 echo Checking the files again
711 check_dir_in_pool $POOL_ROOT/dir1 $POOL
712 check_dir_in_pool $POOL_ROOT/dir2 $POOL2
713 check_file_in_osts $POOL_ROOT/file1 "$TGT_LIST2"
714 check_file_in_osts $POOL_ROOT/file2 "$(seq 0x$start 2 0x$TGT_MAX)"
716 echo Creating some more files
717 create_dir $POOL_ROOT/dir3 $POOL
718 create_dir $POOL_ROOT/dir4 $POOL2
719 create_file $POOL_ROOT/file3 $POOL
720 create_file $POOL_ROOT/file4 $POOL2
722 echo Checking the new files
723 check_file_in_pool $POOL_ROOT/file3 $POOL
724 check_file_in_pool $POOL_ROOT/file4 $POOL2
728 run_test 12 "OST Pool Membership"
732 [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
734 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
738 create_pool_nofail $POOL
739 add_pool $POOL $TGT_ALL "$TGT_UUID"
741 create_dir $POOL_ROOT/dir1 $POOL -1
742 createmany -o $POOL_ROOT/dir1/$tfile $numfiles ||
743 error "createmany $POOL_ROOT/dir1/$tfile failed!"
744 for file in $POOL_ROOT/dir1/*; do
745 check_file_in_pool $file $POOL $OSTCOUNT
748 create_file $POOL_ROOT/dir1/file1 $POOL 1 $TGT_FIRST
749 create_file $POOL_ROOT/dir1/file2 $POOL 1 $((TGT_FIRST + 1))
750 create_file $POOL_ROOT/dir1/file3 $POOL 1 $((TGT_FIRST + 2))
751 check_file_in_pool $POOL_ROOT/dir1/file1 $POOL 1
752 check_file_in_pool $POOL_ROOT/dir1/file2 $POOL 1
753 create_file $POOL_ROOT/dir1/file3 $POOL 1 $((TGT_FIRST + 2))
754 check_file_in_osts $POOL_ROOT/dir1/file1 $((16#$TGT_FIRST))
755 check_file_in_osts $POOL_ROOT/dir1/file2 "$((TGT_FIRST + 1))"
756 check_file_in_osts $POOL_ROOT/dir1/file3 "$((TGT_FIRST + 2))"
758 create_dir $POOL_ROOT/dir2 $POOL $count
759 createmany -o $POOL_ROOT/dir2/$tfile- $numfiles ||
760 error "createmany $POOL_ROOT/dir2/$tfile- failed!"
761 for file in $POOL_ROOT/dir2/*; do
762 check_file_in_pool $file $POOL $count
765 create_dir $POOL_ROOT/dir3 $POOL $count $((TGT_FIRST + 1))
766 createmany -o $POOL_ROOT/dir3/$tfile- $numfiles ||
767 error "createmany $POOL_ROOT/dir3/$tfile- failed!"
768 for file in $POOL_ROOT/dir3/*; do
769 check_file_in_pool $file $POOL $count
772 create_dir $POOL_ROOT/dir4 $POOL 1
773 createmany -o $POOL_ROOT/dir4/$tfile- $numfiles ||
774 error "createmany $POOL_ROOT/dir4/$tfile- failed!"
775 for file in $POOL_ROOT/dir4/*; do
776 check_file_in_pool $file $POOL 1
779 create_dir $POOL_ROOT/dir5 $POOL 1 $((TGT_FIRST + 2))
780 createmany -o $POOL_ROOT/dir5/$tfile- $numfiles ||
781 error "createmany $POOL_ROOT/dir5/$tfile- failed!"
782 for file in $POOL_ROOT/dir5/*; do
783 check_file_in_pool $file $POOL 1
784 check_file_in_osts $file "$((TGT_FIRST + 2))"
787 rm -rf $POOL_ROOT/dir[1-5]/
791 run_test 13 "Striping characteristics in a pool"
795 [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
797 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
801 [ $OSTSIZE -gt $((MAXFREE / OSTCOUNT)) ] &&
802 skip_env "OST size $OSTSIZE is larger than $((MAXFREE / OSTCOUNT))" &&
805 create_pool_nofail $POOL
806 create_pool_nofail $POOL2
808 add_pool $POOL $TGT_HALF "$TGT_UUID2"
809 add_pool $POOL2 "OST0000" "$FSNAME-OST0000_UUID "
811 create_dir $POOL_ROOT/dir1 $POOL 1
812 create_file $POOL_ROOT/dir1/file $POOL 1
813 local OST=$($GETSTRIPE -i $POOL_ROOT/dir1/file)
815 while [[ $i -lt $numfiles ]]; do
817 [[ $OST -gt $((16#$TGT_MAX)) ]] && OST=$TGT_FIRST
819 # echo "Iteration: $i OST: $OST"
820 create_file $POOL_ROOT/dir1/file${i} $POOL 1
821 check_file_in_pool $POOL_ROOT/dir1/file${i} $POOL
825 # Fill up OST0 until it is nearly full.
826 # Create 9 files of size OST0_SIZE/10 each.
827 create_dir $POOL_ROOT/dir2 $POOL2 1
828 $LFS df $POOL_ROOT/dir2
829 OST0_SIZE=$($LFS df $POOL_ROOT/dir2 | awk '/\[OST:0\]/ { print $4 }')
830 FILE_SIZE=$((OST0_SIZE/1024/10))
831 echo "Filling OST0 with 9 files of ${FILE_SIZE}MB in $POOL_ROOT/dir2"
833 while [[ $i -lt 10 ]]; do
834 dd if=/dev/zero of=$POOL_ROOT/dir2/f${i} bs=1M count=$FILE_SIZE
837 sleep 1 # get new statfs info
838 $LFS df $POOL_ROOT/dir2
840 # OST $TGT_FIRST is no longer favored; but it may still be used.
841 create_dir $POOL_ROOT/dir3 $POOL 1
842 create_file $POOL_ROOT/dir3/file $POOL 1
843 createmany -o $POOL_ROOT/dir3/$tfile- $numfiles ||
844 error "createmany $POOL_ROOT/dir3/$tfile- failed!"
845 for file in $POOL_ROOT/dir3/*; do
846 check_file_in_pool $file $POOL
853 run_test 14 "Round robin and QOS striping within a pool"
857 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
861 while [[ $i -lt $OSTCOUNT ]]; do
862 create_pool_nofail $POOL${i}
864 local tgt=$(printf "$FSNAME-OST%04x_UUID " $i)
865 add_pool $POOL${i} "$FSNAME-OST[$(printf %04x $i)]" "$tgt"
866 create_dir $POOL_ROOT/dir${i} $POOL${i}
867 createmany -o $POOL_ROOT/dir$i/$tfile $numfiles ||
868 error "createmany $POOL_ROOT/dir$i/$tfile failed!"
870 for file in $POOL_ROOT/dir$i/*; do
871 check_file_in_osts $file $i
879 run_test 15 "One directory per OST/pool"
883 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
887 create_pool_nofail $POOL
889 add_pool $POOL $TGT_HALF "$TGT_UUID2"
891 local dir=$POOL_ROOT/$tdir
892 create_dir $dir $POOL
894 for i in $(seq 1 10); do
899 createmany -o $dir/$tfile $numfiles ||
900 error "createmany $dir/$tfile failed!"
902 for file in $dir/*; do
903 check_file_in_pool $file $POOL
906 rm -rf $POOL_ROOT/$tdir
910 run_test 16 "Inheritance of pool properties"
914 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
918 create_pool_nofail $POOL
920 add_pool $POOL $TGT_ALL "$TGT_UUID"
922 local dir=$POOL_ROOT/dir
923 create_dir $dir $POOL
925 createmany -o $dir/${tfile}1_ $numfiles ||
926 error "createmany $dir/${tfile}1_ failed!"
928 for file in $dir/*; do
929 check_file_in_pool $file $POOL
934 createmany -o $dir/${tfile}2_ $numfiles ||
935 error "createmany $dir/${tfile}2_ failed!"
940 run_test 17 "Referencing an empty pool"
949 wait_delete_completed >/dev/null # give pending IO a chance to go to disk
950 stat=$(createmany -o $cdir/${tfile} -$numsec | tail -1)
951 files=$(echo $stat | cut -f 2 -d ' ')
953 unlinkmany $cdir/${tfile} $files > /dev/null
961 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
964 local plaindir=$POOL_ROOT/plaindir
965 local pooldir=$POOL_ROOT/pooldir
971 for i in $(seq 1 $iter); do
972 echo "Create performance, iteration $i, $numsec seconds x 3"
974 files1=$(create_perf $plaindir $numsec)
975 echo "iter $i: $files1 creates without pool"
976 f1=$(($f1 + $files1))
978 create_pool_nofail $POOL > /dev/null
979 add_pool $POOL $TGT_ALL "$TGT_UUID" > /dev/null
980 create_dir $pooldir $POOL
981 files2=$(create_perf $pooldir $numsec)
982 echo "iter $i: $files2 creates with pool"
983 f2=$(($f2 + $files2))
985 destroy_pool $POOL > /dev/null
986 files3=$(create_perf $pooldir $numsec)
987 echo "iter $i: $files3 creates with missing pool"
988 f3=$(($f3 + $files3))
993 echo Avg files created in $numsec seconds without pool: $((files1 / iter))
994 echo Avg files created in $numsec seconds with pool: $((files2 / iter))
995 echo Avg files created in $numsec seconds missing pool: $((files3 / iter))
997 # Set this high until we establish a baseline for what the degradation
1000 diff=$((($files1 - $files2) * 100 / $files1))
1001 echo "No pool / wide pool: $diff %."
1002 [ $diff -gt $max ] &&
1003 error_ignore bz23408 "Degradation with wide pool is $diff% > $max%"
1006 diff=$((($files1 - $files3) * 100 / $files1))
1007 echo "No pool / missing pool: $diff %."
1008 [ $diff -gt $max ] &&
1009 error_ignore bz23408 "Degradation with wide pool is $diff% > $max%"
1013 run_test 18 "File create in a directory which references a deleted pool"
1017 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1019 local dir1=$POOL_ROOT/dir1
1020 local dir2=$POOL_ROOT/dir2
1023 create_pool_nofail $POOL
1025 add_pool $POOL $TGT_HALF "$TGT_UUID2"
1027 create_dir $dir1 $POOL
1028 createmany -o $dir1/${tfile} $numfiles ||
1029 error "createmany $dir1/${tfile} failed!"
1030 for file in $dir1/*; do
1031 check_file_in_pool $file $POOL
1035 createmany -o $dir2/${tfile} $numfiles ||
1036 error "createmany $dir2/${tfile} failed!"
1037 for file in $dir2/*; do
1038 check_file_not_in_pool $file $POOL
1045 run_test 19 "Pools should not come into play when not specified"
1049 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1051 local dir1=$POOL_ROOT/dir1
1052 local dir2=$dir1/dir2
1053 local dir3=$dir1/dir3
1057 create_pool_nofail $POOL
1058 create_pool_nofail $POOL2
1060 add_pool $POOL $TGT_HALF "$TGT_UUID2"
1062 local start=$(printf %04x $((TGT_FIRST + 1)))
1063 TGT=$(for i in $(seq 0x$start 2 0x$TGT_MAX); do \
1064 printf "$FSNAME-OST%04x_UUID " $i; done)
1065 add_pool $POOL2 "$FSNAME-OST[$start-$TGT_MAX/2]" "$TGT"
1067 create_dir $dir1 $POOL
1068 create_file $dir1/file1 $POOL2
1069 create_dir $dir2 $POOL2
1072 $SETSTRIPE -c 1 $dir3 # No pool assignment
1074 $SETSTRIPE -c 1 $dir2/file4 # No pool assignment
1076 check_file_in_pool $dir1/file1 $POOL2
1077 check_file_in_pool $dir2/file2 $POOL2
1079 check_dir_not_in_pool $dir3 $POOL
1080 check_dir_not_in_pool $dir3 $POOL2
1082 check_file_not_in_pool $dir3/file3 $POOL
1083 check_file_not_in_pool $dir3/file3 $POOL2
1085 check_file_not_in_pool $dir2/file4 $POOL
1086 check_file_not_in_pool $dir2/file4 $POOL2
1092 run_test 20 "Different pools in a directory hierarchy."
1096 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1097 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
1101 local dir=$POOL_ROOT/dir
1103 create_pool_nofail $POOL
1105 add_pool $POOL $TGT_HALF "$TGT_UUID2"
1107 create_dir $dir $POOL $OSTCOUNT
1108 create_file $dir/file1 $POOL $OSTCOUNT
1109 $GETSTRIPE -v $dir/file1
1110 check_file_in_pool $dir/file1 $POOL
1116 run_test 21 "OST pool with fewer OSTs than stripe count"
1124 for c in $(seq 1 10); do
1125 echo "Pool $pool, iteration $c"
1126 do_facet $SINGLEMDS lctl pool_add $FSNAME.$pool \
1127 OST[$TGT_FIRST-$TGT_MAX/$step] 2>/dev/null
1128 local TGT_SECOND=$(printf %04x $((TGT_FIRST + $step)))
1129 if [ $((16#$TGT_SECOND)) -le $((16#$TGT_MAX)) ]; then
1130 do_facet $SINGLEMDS lctl pool_remove $FSNAME.$pool \
1131 OST[$TGT_SECOND-$TGT_MAX/$step]
1134 echo loop for $pool complete
1139 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1140 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
1144 create_pool_nofail $POOL
1145 add_pool $POOL "OST0000" "$FSNAME-OST0000_UUID "
1146 create_pool_nofail $POOL2
1147 add_pool $POOL2 "OST0000" "$FSNAME-OST0000_UUID "
1152 create_dir $POOL_ROOT $POOL
1153 createmany -o $POOL_ROOT/${tfile} $numfiles ||
1154 error "createmany $POOL_ROOT/${tfile} failed!"
1159 run_test 22 "Simultaneous manipulation of a pool"
1163 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1164 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
1167 check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS || {
1168 skip_env "User $RUNAS_ID does not exist - skipping"
1174 local BUNIT_SZ=1024 # min block quota unit(kB)
1175 local LIMIT=$((BUNIT_SZ * (OSTCOUNT + 1)))
1176 local dir=$POOL_ROOT/dir
1177 local file="$dir/$tfile-quota"
1179 create_pool_nofail $POOL
1181 local TGT=$(for i in $(seq 0x$TGT_FIRST 3 0x$TGT_MAX); do \
1182 printf "$FSNAME-OST%04x_UUID " $i; done)
1183 add_pool $POOL "$FSNAME-OST[$TGT_FIRST-$TGT_MAX/3]" "$TGT"
1184 create_dir $dir $POOL
1186 # XXX remove the interoperability code once we drop the old server
1187 # ( < 2.3.50) support.
1188 if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.50) ]; then
1189 $LFS quotaoff -ug $MOUNT
1190 $LFS quotacheck -ug $MOUNT
1192 do_facet mgs $LCTL conf_param $FSNAME.quota.ost=ug
1196 $LFS setquota -u $RUNAS_ID -b $LIMIT -B $LIMIT $dir
1198 $LFS quota -v -u $RUNAS_ID $dir
1200 $SETSTRIPE -c 1 -p $POOL $file
1201 chown $RUNAS_ID.$RUNAS_GID $file
1204 # This does two "dd" runs to ensure that the quota failure is returned
1205 # to userspace when we check. The first "dd" might otherwise complete
1206 # without error if it is only writing into cache.
1207 stat=$(LOCALE=C $RUNAS dd if=/dev/zero of=$file bs=$BUNIT_SZ \
1208 count=$((BUNIT_SZ*2)) 2>&1)
1209 echo $stat | grep "Disk quota exceeded" > /dev/null
1210 if [ $? -eq 0 ]; then
1211 $LFS quota -v -u $RUNAS_ID $dir
1212 cancel_lru_locks osc
1213 stat=$(LOCALE=C $RUNAS dd if=/dev/zero of=$file bs=$BUNIT_SZ \
1214 count=$BUNIT_SZ seek=$((BUNIT_SZ*2)) 2>&1)
1217 [[ $RC -eq 0 ]] && error "second dd did not fail."
1218 echo $stat | grep "Disk quota exceeded" > /dev/null
1219 [[ $? -eq 1 ]] && error "second dd did not fail with EDQUOT."
1221 log "first dd failed with EDQUOT."
1223 $LFS quota -v -u $RUNAS_ID $dir
1225 run_test 23a "OST pools and quota"
1229 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1230 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return 0
1233 check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS || {
1234 skip_env "User $RUNAS_ID does not exist - skipping"
1240 local dir=$POOL_ROOT/dir
1241 local file="$dir/$tfile-quota"
1243 create_pool_nofail $POOL
1245 local TGT=$(for i in $(seq 0x$TGT_FIRST 3 0x$TGT_MAX); do \
1246 printf "$FSNAME-OST%04x_UUID " $i; done)
1247 add_pool $POOL "$FSNAME-OST[$TGT_FIRST-$TGT_MAX/3]" "$TGT"
1248 create_dir $dir $POOL
1250 local maxfree=$((1024 * 1024 * 30)) # 30G
1251 local AVAIL=$(lfs_df -p $POOL $dir | awk '/summary/ { print $4 }')
1252 [ $AVAIL -gt $maxfree ] &&
1253 skip_env "Filesystem space $AVAIL is larger than " \
1254 "$maxfree limit" && return 0
1256 echo "OSTCOUNT=$OSTCOUNT, OSTSIZE=$OSTSIZE, AVAIL=$AVAIL"
1257 echo "MAXFREE=$maxfree, SLOW=$SLOW"
1259 # XXX remove the interoperability code once we drop the old server
1260 # ( < 2.3.50) support.
1261 if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.50) ]; then
1262 $LFS quotaoff -ug $MOUNT
1264 do_facet mgs $LCTL conf_param $FSNAME.quota.ost=none
1268 chown $RUNAS_ID.$RUNAS_ID $dir
1272 local stime=$(date +%s)
1276 local maxtime=300 # minimum speed: 5GB / 300sec ~= 17MB/s
1277 while [ $RC -eq 0 ]; do
1279 stat=$(LOCALE=C $RUNAS2 dd if=/dev/zero of=${file}$i bs=1M \
1280 count=$((5 * 1024)) 2>&1)
1282 TOTAL=$((TOTAL + 1024 * 1024 * 5))
1283 echo "[$i iteration] $stat"
1284 echo "total written: $TOTAL"
1287 elapsed=$((etime - stime))
1288 echo "stime=$stime, etime=$etime, elapsed=$elapsed"
1290 if [ $RC -eq 1 ]; then
1291 echo $stat | grep -q "Disk quota exceeded"
1293 error "dd failed with EDQUOT with quota off"
1295 echo $stat | grep -q "No space left on device"
1297 error "dd did not fail with ENOSPC"
1298 elif [ $TOTAL -gt $AVAIL ]; then
1299 error "dd didn't fail with ENOSPC ($TOTAL > $AVAIL)"
1300 elif [ $i -eq 1 -a $elapsed -gt $maxtime ]; then
1301 log "The first 5G write used $elapsed (> $maxtime) " \
1302 "seconds, terminated"
1310 run_test 23b "OST pools and OOS"
1314 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1315 [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
1323 create_pool_nofail $POOL
1325 add_pool $POOL $TGT_ALL "$TGT_UUID"
1327 create_dir $POOL_ROOT/dir1 $POOL $OSTCOUNT
1329 mkdir $POOL_ROOT/dir2
1330 $SETSTRIPE -p $POOL -S 65536 -i 0 -c 1 $POOL_ROOT/dir2 ||
1331 error "$SETSTRIPE $POOL_ROOT/dir2 failed"
1333 mkdir $POOL_ROOT/dir3
1334 $SETSTRIPE -S 65536 -i 0 -c 1 $POOL_ROOT/dir3 ||
1335 error "$SETSTRIPE $POOL_ROOT/dir3 failed"
1337 mkdir $POOL_ROOT/dir4
1339 for i in 1 2 3 4; do
1340 dir=${POOL_ROOT}/dir${i}
1349 createmany -o $dir/${tfile} $numfiles ||
1350 error "createmany $dir/${tfile} failed!"
1351 res=$($GETSTRIPE -v $dir | grep "^stripe_count:")
1352 if [ $? -ne 0 ]; then
1353 res=$($GETSTRIPE -v $dir | grep "^(Default) ")
1354 pool=$(cut -f 9 -d ' ' <<< $res)
1355 index=$(cut -f 7 -d ' ' <<< $res)
1356 size=$(cut -f 5 -d ' ' <<< $res)
1357 count=$(cut -f 3 -d ' ' <<< $res)
1359 pool=$(cut -f 8 -d ' ' <<< $res)
1360 index=$(cut -f 6 -d ' ' <<< $res)
1361 size=$(cut -f 4 -d ' ' <<< $res)
1362 count=$(cut -f 2 -d ' ' <<< $res)
1365 for file in $dir/*; do
1366 if [ "$pool" != "" ]; then
1367 check_file_in_pool $file $pool
1369 pool1=$(file_pool $file)
1370 count1=$($GETSTRIPE -v $file | grep "^lmm_stripe_count:" |
1371 tr -d '[:blank:]' | cut -f 2 -d ':')
1372 size1=$($GETSTRIPE -v $file | grep "^lmm_stripe_size:" |
1373 tr -d '[:blank:]' | cut -f 2 -d ':')
1374 [[ "$pool" != "$pool1" ]] &&
1375 error "Pool name ($pool) not inherited in $file($pool1)"
1376 [[ "$count" != "$count1" ]] &&
1377 error "Stripe count ($count) not inherited in $file ($count1)"
1378 [[ "$size" != "$size1" ]] && [[ "$size" != "0" ]] &&
1379 error "Stripe size ($size) not inherited in $file ($size1)"
1387 run_test 24 "Independence of pool from other setstripe parameters"
1391 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1395 for i in $(seq 10); do
1396 create_pool_nofail $POOL$i
1397 do_facet $SINGLEMDS "lctl pool_add $FSNAME.$POOL$i OST0000; sync"
1398 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL$i |
1399 sort -u | tr '\n' ' ' " "$FSNAME-OST0000_UUID " >/dev/null ||
1400 error "pool_add failed: $1; $2"
1402 facet_failover $SINGLEMDS || error "failed to failover $SINGLEMDS"
1403 wait_osc_import_state $SINGLEMDS ost FULL
1407 # Veriy that the pool got created and is usable
1408 df $POOL_ROOT > /dev/null
1410 # Make sure OST0 can be striped on
1411 $SETSTRIPE -i 0 -c 1 $POOL_ROOT/$tfile
1412 STR=$($GETSTRIPE $POOL_ROOT/$tfile | grep 0x | cut -f2 | tr -d " ")
1413 rm $POOL_ROOT/$tfile
1414 if [[ "$STR" == "0" ]]; then
1415 echo "Creating a file in pool$i"
1416 create_file $POOL_ROOT/file$i $POOL$i || break
1417 check_file_in_pool $POOL_ROOT/file$i $POOL$i || break
1419 echo "OST 0 seems to be unavailable. Try later."
1425 run_test 25 "Create new pool and restart MDS"
1428 [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
1430 local dev=$(mdsdevname ${SINGLEMDS//mds/})
1431 local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
1435 create_pool_nofail $POOL2
1437 do_facet $SINGLEMDS "lctl pool_add $FSNAME.$POOL2 OST0000; sync"
1438 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL2 |
1439 sort -u | grep $FSNAME-OST0000_UUID " "$FSNAME-OST0000_UUID" ||
1440 error "pool_add failed: $1; $2"
1442 do_facet $SINGLEMDS "lctl pool_add $FSNAME.$POOL2 OST0002; sync"
1443 wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL2 |
1444 sort -u | grep $FSNAME-OST0002_UUID" "$FSNAME-OST0002_UUID" ||
1445 error "pool_add failed: $1; $2"
1447 # Veriy that the pool got created and is usable
1449 echo "Creating files in $POOL2"
1451 for ((i = 0; i < 10; i++)); do
1452 #OBD_FAIL_MDS_OSC_CREATE_FAIL 0x147
1453 #Fail OST0000 to ensure objects create on the other OST in the pool
1454 do_facet $SINGLEMDS lctl set_param fail_loc=0x147
1455 do_facet $SINGLEMDS lctl set_param fail_val=0
1456 create_file $POOL_ROOT/file$i $POOL2 1 -1 || break
1457 do_facet $SINGLEMDS lctl set_param fail_loc=0
1458 check_file_in_pool $POOL_ROOT/file$i $POOL2 || break
1462 run_test 26 "Choose other OSTs in the pool first in the creation remedy"
1467 cleanup_pools $FSNAME
1468 check_and_cleanup_lustre