X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=b9f8686a9074dd610da20b7017368927f85ec38b;hp=e2e2b96f893ece2059b33ac47d8b7aff6eed5247;hb=94cb946d1360c0df541423ec10487545e4697aa7;hpb=6c5e48383bc10dc0a798b56c898e5a90293246b6;ds=sidebyside diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e2e2b96..b9f8686 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9189,6 +9189,39 @@ test_154c() { } run_test 154c "lfs path2fid and fid2path multiple arguments" +test_154d() { + [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.53) ]] && + skip "Need MDS version at least 2.5.53" && return + + if remote_mds; then + nid=$($LCTL list_nids | sed "s/\./\\\./g") + else + nid="0@lo" + fi + local proc_ofile="mdt.*.exports.'$nid'.open_files" + local fd + local cmd + + rm -f $DIR/$tfile + touch $DIR/$tfile + + 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 + rc=$? + + cmd="exec $fd>/dev/null" + eval $cmd + if [ $rc -ne 0 ]; then + error "FID $fid not found in open files list $fid_list" + fi +} +run_test 154d "Verify open file fid" + test_155_small_load() { local temp=$TMP/$tfile local file=$DIR/$tfile