From d17fd58c07d102ffee8dfb64f300ef26532ffc98 Mon Sep 17 00:00:00 2001 From: wang di Date: Fri, 19 Apr 2013 00:10:23 -0700 Subject: [PATCH] LU-3196 tests: several test fixes about DNE tests 1. add error message in sanity test_27c. 2. In DNE, obdfilter.*.last_id will show last_id with different seqs 0x100000000:33 0x200000400:33 so we need check both last_id and seq here. And also on the OFD we should show the real IDIF seq, instead of 0. 3. skip 130 now, if OSTCOUNT > 10. 4. conf-sanity 66 should use "start mdt 1" to start a single MDT, instead of all MDTs, which will cause replace_nids failed. 5. add all MDTs in conf-sanity 72. 6. skip sanity-hsm for DNE. Signed-off-by: wang di Change-Id: I6e88cd21c24e363680d02ef4765416f696a434cd Reviewed-on: http://review.whamcloud.com/6106 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Jian Yu --- lustre/ofd/lproc_ofd.c | 9 +++++++- lustre/tests/conf-sanity.sh | 14 +++++++----- lustre/tests/sanity-hsm.sh | 4 ++++ lustre/tests/sanity.sh | 52 ++++++++++++++++++++++++++++++++++++--------- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/lustre/ofd/lproc_ofd.c b/lustre/ofd/lproc_ofd.c index 6b31949..b7bb64f 100644 --- a/lustre/ofd/lproc_ofd.c +++ b/lustre/ofd/lproc_ofd.c @@ -191,7 +191,14 @@ static int lprocfs_ofd_rd_last_id(char *page, char **start, off_t off, read_lock(&ofd->ofd_seq_list_lock); cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) { - rc = snprintf(page, count, DOSTID"\n", POSTID(&oseq->os_oi)); + __u64 seq; + + seq = ostid_seq(&oseq->os_oi) == 0 ? + fid_idif_seq(ostid_id(&oseq->os_oi), + ofd->ofd_lut.lut_lsd.lsd_osd_index) : + ostid_seq(&oseq->os_oi); + rc = snprintf(page, count, DOSTID"\n", seq, + ostid_id(&oseq->os_oi)); if (rc < 0) { retval = rc; break; diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 9ebe087..edf5b24 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -3664,7 +3664,7 @@ test_66() { stop_mds || error "stopping mds failed" if combined_mgs_mds; then - start_mds "-o nosvc" || + start_mdt 1 "-o nosvc" || error "starting mds with nosvc option failed" fi @@ -3963,10 +3963,14 @@ test_72() { #LU-2634 skip "ldiskfs only test" && return #tune MDT with "-O extents" - add $SINGLEMDS \ - $(mkfs_opts $SINGLEMDS ${mdsdev}) --reformat $mdsdev || - error "add $SINGLEMDS failed" - $TUNE2FS -O extents $mdsdev + + for num in $(seq $MDSCOUNT); do + add mds${num} $(mkfs_opts mds$num $(mdsdevname $num)) \ + --reformat $(mdsdevname $num) $(mdsvdevname $num) || + error "add mds $num failed" + $TUNE2FS -O extents $(mdsdevname $num) + done + add ost1 $(mkfs_opts ost1 $ostdev) --reformat $ostdev || error "add $ostdev failed" start_mgsmds || error "start mds failed" diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 7e852fe..e7f4909 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -37,6 +37,10 @@ FAIL_ON_ERROR=false [ "$SANITYLOG" ] && rm -f $SANITYLOG || true check_and_setup_lustre +if [ $MDSCOUNT -ge 2 ]; then + skip_env "Only run with single MDT for now" && exit +fi + if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.3.61) ]; then skip_env "Need MDS version at least 2.3.61" && exit fi diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index ee5ec39..73b7993 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1882,7 +1882,8 @@ test_27C() { #LU-2871 # check the layout for j in $(seq 0 $((OSTCOUNT - 1))); do index=$(((i + j) % OSTCOUNT)) - [ ${ost_idx[$j]} -eq $index ] || error + [ ${ost_idx[$j]} -eq $index ] || + error "$j:${ost_idx[$j]} != $index" done done } @@ -3788,28 +3789,47 @@ test_53() { remote_ost_nodsh && skip "remote OST with nodsh" && return local param + local param_seq local ostname local mds_last + local mds_last_seq local ost_last + local ost_last_seq + local ost_last_id local ostnum local node + local found=0 # only test MDT0000 local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS) for value in $(do_facet $SINGLEMDS lctl get_param osc.$mdtosc.prealloc_last_id) ; do - param=`echo ${value[0]} | cut -d "=" -f1` - ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2` - mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param) + param=$(echo ${value[0]} | cut -d "=" -f1) + ostname=$(echo $param | cut -d "." -f2 | cut -d - -f 1-2) + param_seq=$(echo ${param} | + sed -e s/prealloc_last_id/prealloc_last_seq/g) + mds_last_seq=$(do_facet $SINGLEMDS lctl get_param -n $param_seq) + mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param) + ostnum=$(index_from_ostuuid ${ostname}_UUID) node=$(facet_active_host ost$((ostnum+1))) param="obdfilter.$ostname.last_id" - ost_last=$(do_node $node lctl get_param -n $param | head -n 1 | - awk -F':' '{print $2}') - echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last" - if [ $ost_last != $mds_last ]; then - error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last" - fi + for ost_last in $(do_node $node lctl get_param -n $param) ; do + echo "$ostname.last_id=$ost_last ;MDS.last_id=$mds_last" + ost_last_id=$(echo $ost_last | awk -F':' '{print $2}' | + sed -e "s/^0x//g") + ost_last_seq=$(echo $ost_last | awk -F':' '{print $1}') + if [ $ost_last_seq = $mds_last_seq ]; then + if [ $ost_last_id != $mds_last ]; then + error "$ost_last != $mds_last_id" + else + found=1 + break + fi + fi + done done + [ $found = 0 ] && error "can not match last_seq/last_id for $mdtosc" + return 0 } run_test 53 "verify that MDS and OSTs agree on pre-creation ====" @@ -7803,6 +7823,9 @@ test_130b() { [ "$OSTCOUNT" -lt "2" ] && skip_env "skipping FIEMAP on 2-stripe file test" && return + [ "$OSTCOUNT" -ge "10" ] && + skip_env "skipping FIEMAP with >= 10 OSTs" && return + local filefrag_op=$(filefrag -e 2>&1 | grep "invalid option") [ -n "$filefrag_op" ] && skip_env "filefrag does not support FIEMAP" && return @@ -7859,6 +7882,9 @@ test_130c() { [ "$OSTCOUNT" -lt "2" ] && skip_env "skipping FIEMAP on 2-stripe file" && return + [ "$OSTCOUNT" -ge "10" ] && + skip_env "skipping FIEMAP with >= 10 OSTs" && return + filefrag_op=$(filefrag -e 2>&1 | grep "invalid option") [ -n "$filefrag_op" ] && skip "filefrag does not support FIEMAP" && return @@ -7918,6 +7944,9 @@ run_test 130c "FIEMAP (2-stripe file with hole)" test_130d() { [ "$OSTCOUNT" -lt "3" ] && skip_env "skipping FIEMAP on N-stripe file test" && return + [ "$OSTCOUNT" -ge "10" ] && + skip_env "skipping FIEMAP with >= 10 OSTs" && return + filefrag_op=$(filefrag -e 2>&1 | grep "invalid option") [ -n "$filefrag_op" ] && skip "filefrag does not support FIEMAP" && return @@ -7969,6 +7998,9 @@ run_test 130d "FIEMAP (N-stripe file)" test_130e() { [ "$OSTCOUNT" -lt "2" ] && skip_env "skipping continuation FIEMAP test" && return + [ "$OSTCOUNT" -ge "10" ] && + skip_env "skipping FIEMAP with >= 10 OSTs" && return + filefrag_op=$(filefrag -e 2>&1 | grep "invalid option") [ -n "$filefrag_op" ] && skip "filefrag does not support FIEMAP" && return -- 1.8.3.1