From: grev Date: Tue, 30 Dec 2008 15:36:19 +0000 (+0000) Subject: b=17797 X-Git-Tag: v1_9_140~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4d805b56ec34821f93c4bae92359145dfbc23ece;p=fs%2Flustre-release.git b=17797 i=H.Huang test_57b remote mds fix --- diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 3eaea5f..54f5305 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -451,31 +451,6 @@ shutdown_client() { fi } -# CMD: determine mds index where directory inode presents -get_mds_dir () { - local dir=$1 - local file=$dir/$tfile - - rm -f $file - local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') - local oldused=($iused) - - touch $file - sleep 1 - iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') - local newused=($iused) - - local num=0 - for ((i=0; i<${#newused[@]}; i++)); do - if [ ${oldused[$i]} -lt ${newused[$i]} ]; then - echo $(( i + 1 )) - rm -f $dir/$tfile - return 0 - fi - done - error "mdt-s : inodes count OLD ${oldused[@]} NEW ${newused[@]}" -} - test_21b_sub () { local mds=$1 do_node $CLIENT1 rm -f $MOUNT1/$tfile-* diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b984bfa..47bd532 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2725,23 +2725,30 @@ test_57a() { run_test 57a "verify MDS filesystem created with large inodes ==" test_57b() { - FILECOUNT=100 - FILE1=$DIR/d57b/f1 - FILEN=$DIR/d57b/f$FILECOUNT - rm -rf $DIR/d57b || error "removing $DIR/d57b" - mkdir -p $DIR/d57b || error "creating $DIR/d57b" + local dir=$DIR/d57b + + local FILECOUNT=100 + local FILE1=$dir/f1 + local FILEN=$dir/f$FILECOUNT + + rm -rf $dir || error "removing $dir" + mkdir -p $dir || error "creating $dir" + local num=$(get_mds_dir $dir) + local mymds=mds$num + echo "mcreating $FILECOUNT files" - createmany -m $DIR/d57b/f 1 $FILECOUNT || \ - error "creating files in $DIR/d57b" + createmany -m $dir/f 1 $FILECOUNT || \ + error "creating files in $dir" # verify that files do not have EAs yet $GETSTRIPE $FILE1 2>&1 | grep -q "no stripe" || error "$FILE1 has an EA" $GETSTRIPE $FILEN 2>&1 | grep -q "no stripe" || error "$FILEN has an EA" - MDSFREE="`lctl get_param -n osd.*MDT0000.kbytesfree 2> /dev/null`" - MDCFREE="`lctl get_param -n mdc.*.kbytesfree | head -n 1`" + local MDSFREE=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree) + local MDCFREE=$(lctl get_param -n mdc.*.kbytesfree | head -n 1) echo "opening files to create objects/EAs" - for FILE in `seq -f $DIR/d57b/f%g 1 $FILECOUNT`; do + local FILE + for FILE in `seq -f $dir/f%g 1 $FILECOUNT`; do $OPENFILE -f O_RDWR $FILE > /dev/null || error "opening $FILE" done @@ -2749,9 +2756,9 @@ test_57b() { $GETSTRIPE $FILE1 | grep -q "obdidx" || error "$FILE1 missing EA" $GETSTRIPE $FILEN | grep -q "obdidx" || error "$FILEN missing EA" - sleep 1 # make sure we get new statfs data -# MDSFREE2="`lctl get_param -n mds.*.kbytesfree`" -# MDCFREE2="`lctl get_param -n mdc.*.kbytesfree`" +# sleep 1 # make sure we get new statfs data +# local MDSFREE2=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree) +# local MDCFREE2=$(lctl get_param -n mdc.*.kbytesfree) # if [ "$MDCFREE2" -lt "$((MDCFREE - 8))" ]; then # if [ "$MDSFREE" != "$MDSFREE2" ]; then # error "MDC before $MDCFREE != after $MDCFREE2" @@ -2760,7 +2767,7 @@ test_57b() { # echo "unable to confirm if MDS has large inodes" # fi # fi - rm -rf $DIR/d57b + rm -rf $dir } run_test 57b "default LOV EAs are stored inside large inodes ===" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 2b205fd..b65d23e 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2321,6 +2321,31 @@ get_stripe_info() { rm -f $tmp_file } +# CMD: determine mds index where directory inode presents +get_mds_dir () { + local dir=$1 + local file=$dir/$tfile + + rm -f $file + local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') + local oldused=($iused) + + touch $file + sleep 1 + iused=$(lfs df -i $dir | grep MDT | awk '{print $3}') + local newused=($iused) + + local num=0 + for ((i=0; i<${#newused[@]}; i++)); do + if [ ${oldused[$i]} -lt ${newused[$i]} ]; then + echo $(( i + 1 )) + rm -f $dir/$tfile + return 0 + fi + done + error "mdt-s : inodes count OLD ${oldused[@]} NEW ${newused[@]}" +} + mpi_run () { local mpirun="$MPIRUN $MPIRUN_OPTIONS" local command="$mpirun $@"