Whamcloud - gitweb
LU-3152 tests: seq/oid needs to hex format in sanity 27z
authorwang di <di.wang@intel.com>
Sat, 25 Jan 2014 22:34:32 +0000 (14:34 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 18 Apr 2013 23:16:50 +0000 (19:16 -0400)
Seq/Oid needs to remove 0x if it is normal FID in sanity_27z

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I1fc277460c3189a457e183996a7a8a68bcf7cfae
Reviewed-on: http://review.whamcloud.com/6022
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/tests/sanity.sh

index 2282370..1fed554 100644 (file)
@@ -1708,8 +1708,9 @@ check_seq_oid()
                 [ "$obdidx" = "obdidx" ] && have_obdidx=true && continue
                 $have_obdidx || continue
 
-                local ost=$((obdidx + 1))
-                local dev=$(ostdevname $ost)
+               local ost=$((obdidx + 1))
+               local dev=$(ostdevname $ost)
+               local oid_hex
 
                if [ $(facet_fstype ost$ost) != ldiskfs ]; then
                        echo "Currently only works with ldiskfs-based OSTs"
@@ -1731,19 +1732,19 @@ check_seq_oid()
                stop ost$ost
                do_facet ost$ost mount -t $(facet_fstype ost$ost) $opts $dev $dir ||
                        { error "mounting $dev as $FSTYPE failed"; return 3; }
-               local obj_file=$(do_facet ost$ost find $dir/O/$seq -name $oid)
+
+               seq=$(echo $seq | sed -e "s/^0x//g")
+               if [ $seq == 0 ]; then
+                       oid_hex=$(echo $oid)
+               else
+                       oid_hex=$(echo $hex | sed -e "s/^0x//g")
+               fi
+               local obj_file=$(do_facet ost$ost find $dir/O/$seq -name $oid_hex)
                local ff=$(do_facet ost$ost $LL_DECODE_FILTER_FID $obj_file)
                do_facet ost$ost umount -d $dir
                start ost$ost $dev $OST_MOUNT_OPTS
 
                # re-enable when debugfs will understand new filter_fid
-               #seq=$(echo $seq | sed -e "s/^0x//g")
-               #if [ $seq == 0 ]; then
-               #       oid_hex=$(echo $oid)
-               #else
-               #       oid_hex=$(echo $hex | sed -e "s/^0x//g")
-               #fi
-                #local obj_file="O/$seq/d$((oid %32))/$oid_hex"
                #local ff=$(do_facet ost$ost "$DEBUGFS -c -R 'stat $obj_file' \
                 #           $dev 2>/dev/null" | grep "parent=")