X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=5b5b0dd268bc83d38712390d4f9cf45f36b3b390;hp=55bd93a8f8ff1f8ef9eeb5ccd8746cea6e4a1cf2;hb=5bd85b467a4b6ef57d7a3c119296c9a317afc73b;hpb=1df3357a1937481a19b23f5f9c4acf581b1ab5c2 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 55bd93a..5b5b0dd 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -638,6 +638,9 @@ test_17n() { run_test 17n "run e2fsck against master/slave MDT which contains remote dir" test_17o() { + [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.64) ]] && + skip "Need MDS version at least 2.3.64" && return + local WDIR=$DIR/${tdir}o local mdt_index local mdtdevname @@ -3924,8 +3927,7 @@ run_test 54e "console/tty device works in lustre ======================" test_56a() { # was test_56 rm -rf $DIR/$tdir $SETSTRIPE -d $DIR - test_mkdir $DIR/$tdir - test_mkdir $DIR/$tdir/dir + test_mkdir -p $DIR/$tdir/dir NUMFILES=3 NUMFILESx2=$(($NUMFILES * 2)) for i in `seq 1 $NUMFILES` ; do @@ -4511,6 +4513,34 @@ test_56x() { } run_test 56x "lfs migration support" +test_56y() { + local res="" + + local dir0=$DIR/$tdir/$testnum + mkdir -p $dir0 || error "creating dir $dir0" + local f1=$dir0/file1 + local f2=$dir0/file2 + + touch $f1 || error "creating std file $f1" + $MULTIOP $f2 H2c || error "creating released file $f2" + + # a directory can be raid0, so ask only for files + res=$($LFIND $dir0 -L raid0 -type f | wc -l) + [[ $res == 2 ]] || error "search raid0: found $res files != 2" + + res=$($LFIND $dir0 \! -L raid0 -type f | wc -l) + [[ $res == 0 ]] || error "search !raid0: found $res files != 0" + + # only files can be released, so no need to force file search + res=$($LFIND $dir0 -L released) + [[ $res == $f2 ]] || error "search released: found $res != $f2" + + res=$($LFIND $dir0 \! -L released) + [[ $res == $f1 ]] || error "search !released: found $res != $f1" + +} +run_test 56y "lfs find -L raid0|released" + test_57a() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return # note test will not do anything if MDS is not local @@ -9203,6 +9233,17 @@ changelog_chmask() fi } +changelog_extract_field() { + local mdt=$1 + local cltype=$2 + local file=$3 + local identifier=$4 + + $LFS changelog $mdt | gawk "/$cltype.*$file$/ { + print gensub(/^.* "$identifier'(\[[^\]]*\]).*$/,"\\1",1)}' | + tail -1 +} + test_160() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return remote_mds_nodsh && skip "remote MDS with nodsh" && return @@ -9248,14 +9289,14 @@ test_160() { # verify contents echo "verifying target fid" - fidc=$($LFS changelog $MDT0|awk '/CREAT.*timestamp$/{print $6}'|tail -1) + fidc=$(changelog_extract_field $MDT0 "CREAT" "timestamp" "t=") fidf=$($LFS path2fid $DIR/$tdir/pics/zach/timestamp) - [ "$fidc" == "t=$fidf" ] || + [ "$fidc" == "$fidf" ] || err17935 "fid in changelog $fidc != file fid $fidf" echo "verifying parent fid" - fidc=$($LFS changelog $MDT0|awk '/CREAT.*timestamp$/{print $7}'|tail -1) + fidc=$(changelog_extract_field $MDT0 "CREAT" "timestamp" "p=") fidf=$($LFS path2fid $DIR/$tdir/pics/zach) - [ "$fidc" == "p=$fidf" ] || + [ "$fidc" == "$fidf" ] || err17935 "pfid in changelog $fidc != dir fid $fidf" USER_REC1=$($GET_CL_USERS | awk "\$1 == \"$USER\" {print \$2}") @@ -9457,20 +9498,6 @@ test_162() { } run_test 162 "path lookup sanity" -test_163() { - [ $PARALLEL == "yes" ] && skip "skip parallel run" && return - remote_mds_nodsh && skip "remote MDS with nodsh" && return - copytool --test $FSNAME || { skip "copytool not runnable: $?" && return; } - copytool $FSNAME & - sleep 1 - local uuid=$($LCTL get_param -n mdc.${FSNAME}-MDT0000-mdc-*.uuid) - # this proc file is temporary and linux-only - do_facet $SINGLEMDS lctl set_param mdt.${FSNAME}-MDT0000.mdccomm=$uuid ||\ - error "kernel->userspace send failed" - kill -INT $! -} -run_test 163 "kernel <-> userspace comms" - test_169() { # do directio so as not to populate the page cache log "creating a 10 Mb file" @@ -10665,12 +10692,13 @@ test_215() { # for bugs 18102, 21079, 21517 # /proc/sys/lnet/routes should look like this: # Routing disabled/enabled - # net hops state router - # where net is a string like tcp0, hops >= 0, state is up/down, + # net hops priority state router + # where net is a string like tcp0, hops > 0, priority >= 0, + # state is up/down, # router is a string like 192.168.1.1@tcp2 L1="^Routing (disabled|enabled)$" - L2="^net +hops +state +router$" - BR="^$NET +$N +(up|down) +$NID$" + L2="^net +hops +priority +state +router$" + BR="^$NET +$N +(0|1) +(up|down) +$NID$" create_lnet_proc_files "routes" check_lnet_proc_entry "routes.out" "/proc/sys/lnet/routes" "$BR" "$L1" "$L2" check_lnet_proc_entry "routes.sys" "lnet.routes" "$BR" "$L1" "$L2" @@ -11245,8 +11273,7 @@ test_229() { # LU-2482, LU-3448 $GETSTRIPE -v $DIR/$tfile - local pattern=$($GETSTRIPE -v $DIR/$tfile | - grep lmm_stripe_pattern | awk '{print $2}') + local pattern=$($GETSTRIPE -L $DIR/$tfile) [ X"$pattern" = X"80000001" ] || error "pattern error ($pattern)" local stripe_count=$($GETSTRIPE -c $DIR/$tfile) || error "getstripe" @@ -11410,6 +11437,45 @@ test_233() { } run_test 233 "checking that OBF of the FS root succeeds" +test_234() { + local p="$TMP/sanityN-$TESTNAME.parameters" + save_lustre_params client "llite.*.xattr_cache" > $p + lctl set_param llite.*.xattr_cache 1 || + { skip "xattr cache is not supported"; return 0; } + + mkdir -p $DIR/$tdir || error "mkdir failed" + touch $DIR/$tdir/$tfile || error "touch failed" + # OBD_FAIL_LLITE_XATTR_ENOMEM + $LCTL set_param fail_loc=0x1405 + setfattr -n user.attr -v value $DIR/$tdir/$tfile && + error "setfattr should have failed with ENOMEM" + # attr pre-2.4.44-7 had a bug with rc + getfattr -n user.attr $DIR/$tdir/$tfile && + error "getfattr should have failed with ENOMEM" + $LCTL set_param fail_loc=0x0 + rm -rf $DIR/$tdir + + restore_lustre_params < $p + rm -f $p +} +run_test 234 "xattr cache should not crash on ENOMEM" + +test_235() { + [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.52) ] && + skip "Need MDS version at least 2.4.52" && return + flock_deadlock $DIR/$tfile + local RC=$? + case $RC in + 0) + ;; + 124) error "process hangs on a deadlock" + ;; + *) error "error executing flock_deadlock $DIR/$tfile" + ;; + esac +} +run_test 235 "LU-1715: flock deadlock detection does not work properly" + # # tests that do cleanup/setup should be run at the end #