Whamcloud - gitweb
LU-4573 tests: check all MDTs for open files 07/10107/3
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 27 May 2014 12:13:18 +0000 (20:13 +0800)
committerAndreas Dilger <andreas.dilger@intel.com>
Thu, 29 May 2014 20:18:55 +0000 (20:18 +0000)
sanityn.sh test_76 verifying mdt.*.exports.*.open_files content
did not check all of the MDTs. It was broken by commit 370de927fc5,
which created all directories striped across all MDTs by default.

There is actually no need to special-case striped or remote
directories in this test, and it should be possible to just check
for open files on all MDTs, and this also simplifies the test.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I2b7b434052946c8d84bffef1fc7358cc29b00b75
Reviewed-on: http://review.whamcloud.com/10107
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
lustre/tests/sanityn.sh

index a3bf7ca..4b46cc4 100644 (file)
@@ -2695,14 +2695,9 @@ run_test 75 "osc: upcall after unuse lock==================="
 test_76() { #LU-946
        [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.53) ]] &&
                skip "Need MDS version at least 2.5.53" && return
-       [ $MDSCOUNT -ge 2 ] && skip "skip now for LU-4573" && return #LU-4573
 
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
        local fcount=2048
-       local fd
-       local cmd
-       local mdt_idx
-       local mds_idx
        declare -a fd_list
        declare -a fid_list
 
@@ -2714,29 +2709,24 @@ test_76() { #LU-946
 
        rm -rf $DIR/$tdir
        test_mkdir -p $DIR/$tdir
-       if [ $MDSCOUNT -gt 1 ]; then
-               mdt_idx=$($LFS getdirstripe -i $DIR/$tdir)
-       else
-               mdt_idx=0
-       fi
-       mds_idx=$((mdt_idx + 1))
-       proc_ofile="mdt.*$mdt_idx.exports.'$nid'.open_files"
 
+       # drop all open locks and close any cached "open" files on the client
        cancel_lru_locks mdc
 
        echo -n "open files "
        ulimit -n 8096
-       for (( i = 0; i < $fcount; i++ )) ; do
+       for ((i = 0; i < $fcount; i++)); do
                touch $DIR/$tdir/f_$i
-               fd=$(free_fd)
-               cmd="exec $fd<$DIR/$tdir/f_$i"
+               local fd=$(free_fd)
+               local cmd="exec $fd<$DIR/$tdir/f_$i"
                eval $cmd
                fd_list[i]=$fd
                echo -n "."
        done
        echo
 
-       fid_list=($(do_facet mds$mds_idx $LCTL get_param -n $proc_ofile))
+       local get_open_fids="$LCTL get_param -n mdt.*.exports.'$nid'.open_files"
+       local fid_list=($(do_nodes $(comma_list $(mdts_nodes)) $get_open_fids))
 
        # Possible errors in openfiles FID list.
        # 1. Missing FIDs. Check 1