X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=5d4cc9fce869510683226dafbb767cc2e67eaff6;hp=4deb81c092b9553128593e1b52dca9b4f541f2f8;hb=f625f670afbe954030ff81f0f8522137d6cdd335;hpb=7d9c948c6016b10ed0d07e20cbd7925e108b3450 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4deb81c..5d4cc9f 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -61,8 +61,8 @@ init_logging [ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24D 27m 64b 68 71 77f 78 115 124b 230d" if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then - # bug number for skipped test: LU-1593 LU-4536 LU-5242 LU-1957 LU-2805 - ALWAYS_EXCEPT="$ALWAYS_EXCEPT 34h 65ic 78 79 80 180 184c" + # bug number for skipped test: LU-4536 LU-5242 LU-1957 LU-2805 + ALWAYS_EXCEPT="$ALWAYS_EXCEPT 65ic 78 79 80 180 184c" [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b 51ba" fi @@ -5028,7 +5028,7 @@ test_56z() { # LU-4824 error "$LFS find did not return an error" # Make a directory unsearchable. This should NOT be the last entry in # directory order. Arbitrarily pick the 6th entry - chmod 700 $(lfs find $DIR/$tdir -type d | sed '6!d') + chmod 700 $($LFS find $DIR/$tdir -type d | sed '6!d') local count=$($RUNAS $LFS find $DIR/non_existent $DIR/$tdir | wc -l) # The user should be able to see 10 directories and 9 files [ $count == 19 ] || error "$LFS find did not continue after error" @@ -5975,7 +5975,7 @@ test_78() { # bug 10901 [[ $F78SIZE -gt $MEMTOTAL ]] && F78SIZE=$MEMTOTAL [[ $F78SIZE -gt 512 ]] && F78SIZE=512 [[ $F78SIZE -gt $((MAXFREE / 1024)) ]] && F78SIZE=$((MAXFREE / 1024)) - SMALLESTOST=$(lfs df $DIR | grep OST | awk '{ print $4 }' | sort -n | + SMALLESTOST=$($LFS df $DIR | grep OST | awk '{ print $4 }' | sort -n | head -n1) echo "Smallest OST: $SMALLESTOST" [[ $SMALLESTOST -lt 10240 ]] && @@ -6670,14 +6670,14 @@ compare_stripe_info1() { for offset in $(seq 0 $[$STRIPE_COUNT - 1]); do local size=$((STRIPE_SIZE * num)) local file=file"$num-$offset-$count" - stripe_size=$(lfs getstripe -S $PWD/$file) + stripe_size=$($LFS getstripe -S $PWD/$file) [[ $stripe_size -ne $size ]] && error "$file: size $stripe_size != $size" - stripe_count=$(lfs getstripe -c $PWD/$file) + stripe_count=$($LFS getstripe -c $PWD/$file) # allow fewer stripes to be created, ORI-601 [[ $stripe_count -lt $(((3 * count + 3) / 4)) ]] && error "$file: count $stripe_count != $count" - stripe_index=$(lfs getstripe -i $PWD/$file) + stripe_index=$($LFS getstripe -i $PWD/$file) [[ $stripe_index -ne 0 ]] && stripe_index_all_zero=false done @@ -8961,83 +8961,6 @@ test_131e() { } run_test 131e "test read hitting hole" -get_ost_param() { - local token=$1 - local gl_sum=0 - for node in $(osts_nodes); do - gl=$(do_node $node "$LCTL get_param -n ost.OSS.ost.stats" | awk '/'$token'/ {print $2}' | head -n 1) - [ x$gl = x"" ] && gl=0 - gl_sum=$((gl_sum + gl)) - done - echo $gl_sum -} - -som_mode_switch() { - local som=$1 - local gl1=$2 - local gl2=$3 - - if [ x$som = x"enabled" ]; then - [ $((gl2 - gl1)) -gt 0 ] && error "no glimpse RPC is expected" - MOUNT_OPTS=`echo $MOUNT_OPTS | - sed 's/som_preview,\|,som_preview\|som_preview//g'` - do_facet mgs "$LCTL conf_param $FSNAME.mdt.som=disabled" - else - [ $((gl2 - gl1)) -gt 0 ] || error "some glimpse RPC is expected" - MOUNT_OPTS="${MOUNT_OPTS:+$MOUNT_OPTS,}som_preview" - do_facet mgs "$LCTL conf_param $FSNAME.mdt.som=enabled" - fi - - # do remount to make new mount-conf parameters actual - echo remounting... - sync - stopall - setupall -} - -test_132() { #1028, SOM - [ $PARALLEL == "yes" ] && skip "skip parallel run" && return - remote_mds_nodsh && skip "remote MDS with nodsh" && return - local mdtidx=$($LFS getstripe -M $DIR) - local facet=mds$((mdtidx + 1)) - - local MOUNTOPT_SAVE=$MOUNTOPT - - dd if=/dev/zero of=$DIR/$tfile count=1 2>/dev/null - cancel_lru_locks osc - som1=$(do_facet $facet "$LCTL get_param mdt.*.som" | - awk -F= ' {print $2}' | head -n 1) - - gl1=$(get_ost_param "ldlm_glimpse_enqueue") - stat $DIR/$tfile >/dev/null - gl2=$(get_ost_param "ldlm_glimpse_enqueue") - echo "====> SOM is "$som1", "$((gl2 - gl1))" glimpse RPC occured" - rm $DIR/$tfile - som_mode_switch $som1 $gl1 $gl2 - - dd if=/dev/zero of=$DIR/$tfile count=1 2>/dev/null - cancel_lru_locks osc - - som2=$(do_facet $facet "$LCTL get_param mdt.*.som" | - awk -F= ' {print $2}' | head -n 1) - if [ $som1 == $som2 ]; then - error "som is still "$som2 - if [ x$som2 = x"enabled" ]; then - som2="disabled" - else - som2="enabled" - fi - fi - - gl1=$(get_ost_param "ldlm_glimpse_enqueue") - stat $DIR/$tfile >/dev/null - gl2=$(get_ost_param "ldlm_glimpse_enqueue") - echo "====> SOM is "$som2", "$((gl2 - gl1))" glimpse RPC occured" - som_mode_switch $som2 $gl1 $gl2 - MOUNT_OPTS=$MOUNT_OPTS_SAVE -} -run_test 132 "som avoids glimpse rpc" - check_stats() { local res local count @@ -9780,7 +9703,7 @@ test_154A() { [ -z "$FID" ] && error "path2fid unable to get $DIR/$tfile FID" # check that we get the same pathname back - local FOUND=$($LFS fid2path $MOUNT $FID) + local FOUND=$($LFS fid2path $MOUNT "$FID") [ -z "$FOUND" ] && error "fid2path unable to get $FID path" [ "$FOUND" != "$DIR/$tfile" ] && error "fid2path(path2fid($DIR/$tfile)) = $FOUND != $DIR/$tfile" @@ -9862,7 +9785,8 @@ test_154c() { N=$((N + 1)) done - $LFS fid2path $MOUNT $FID1 $FID2 $FID3 | while read PATHNAME; do + $LFS fid2path $MOUNT "$FID1" "$FID2" "$FID3" | while read PATHNAME; + do [ "$PATHNAME" = "$DIR/$tfile.$N" ] || error "fid2path pathname $PATHNAME != $DIR/$tfile.$N:" N=$((N + 1)) @@ -9886,13 +9810,13 @@ test_154d() { rm -f $DIR/$tfile touch $DIR/$tfile - fid=$($LFS path2fid $DIR/$tfile) + local fid=$($LFS path2fid $DIR/$tfile) # Open the file fd=$(free_fd) cmd="exec $fd<$DIR/$tfile" eval $cmd - fid_list=$(do_facet $SINGLEMDS $LCTL get_param $proc_ofile) - echo $fid_list | grep $fid + local fid_list=$(do_facet $SINGLEMDS $LCTL get_param $proc_ofile) + echo "$fid_list" | grep "$fid" rc=$? cmd="exec $fd>/dev/null" @@ -9990,6 +9914,16 @@ test_154f() { } run_test 154f "get parent fids by reading link ea" +test_154g() +{ + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.6.92) ]] || + { skip "Need MDS version at least 2.6.92"; return 0; } + + mkdir -p $DIR/$tdir + llapi_fid_test -d $DIR/$tdir +} +run_test 154g "various llapi FID tests" + test_155_small_load() { local temp=$TMP/$tfile local file=$DIR/$tfile @@ -11123,7 +11057,7 @@ test_184c() { local ref2=$dir0/ref2 local file1=$dir0/file1 local file2=$dir0/file2 - # create a file large enough for the concurent test + # create a file large enough for the concurrent test dd if=/dev/urandom of=$ref1 bs=1M count=$((RANDOM % 50 + 20)) dd if=/dev/urandom of=$ref2 bs=1M count=$((RANDOM % 50 + 20)) echo "ref file size: ref1($(stat -c %s $ref1))," \ @@ -11974,7 +11908,7 @@ test_220() { #LU-325 local OSTIDX=0 test_mkdir -p $DIR/$tdir - local OST=$(lfs osts | grep ${OSTIDX}": " | \ + local OST=$($LFS osts | grep ${OSTIDX}": " | \ awk '{print $2}' | sed -e 's/_UUID$//') # on the mdt's osc @@ -12871,11 +12805,11 @@ test_238() { ln $DIR/$tfile $DIR/$tfile.lnk touch $DIR/$tfile.new mv $DIR/$tfile.new $DIR/$tfile - local fid1=$(lfs path2fid $DIR/$tfile) - local fid2=$(lfs path2fid $DIR/$tfile.lnk) - local path1=$(lfs fid2path $FSNAME $fid1) + local fid1=$($LFS path2fid $DIR/$tfile) + local fid2=$($LFS path2fid $DIR/$tfile.lnk) + local path1=$($LFS fid2path $FSNAME "$fid1") [ $tfile == $path1 ] || error "linkea inconsistent: $tfile $fid1 $path1" - local path2=$(lfs fid2path $FSNAME $fid2) + local path2=$($LFS fid2path $FSNAME "$fid2") [ $tfile.lnk == $path2 ] || error "linkea inconsistent: $tfile.lnk $fid2 $path2!" rm -f $DIR/$tfile* @@ -13245,6 +13179,9 @@ test_300_check_default_striped_dir() mkdir $DIR/$tdir/$dirname/{test1,test2,test3,test4} || error "create dirs failed" + + createmany -o $DIR/$tdir/$dirname/f- 10 || error "create files failed" + unlinkmany $DIR/$tdir/$dirname/f- 10 || error "unlink files failed" for dir in $(find $DIR/$tdir/$dirname/*); do stripe_count=$($LFS getdirstripe -c $dir) [ $stripe_count -eq $default_count ] ||