Whamcloud - gitweb
LU-5473 tests: sanity/51b Account for ZFS inode size 21/21821/6
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Mon, 8 Aug 2016 20:35:00 +0000 (16:35 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 21 Sep 2016 02:54:53 +0000 (02:54 +0000)
Account for inode size for 11KB for ZFS (and 4KB for LDISKFS) when
checking space on MDC during sanity test_51b.
Do lfs df and lfs df -i on completion of sanity/test_51b.  This helps
determine the correct inode size accounting.

Test-Parameters: trivial mdsfilesystemtype=zfs mdtfilesystemtype=zfs ostfilesystemtype=zfs testlist=sanity envdefinitions=SLOW=yes mdscount=1
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Icd8e0d55a89d8e3d22bbb1b2ff206e238a7262ac
Reviewed-on: http://review.whamcloud.com/21821
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index 0c617fe..5a26c77 100755 (executable)
@@ -81,8 +81,8 @@ init_logging
 if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
        # bug number for skipped test: LU-4536 LU-1957
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT  65ic    180"
-       #                                               4   13    (min)"
-       [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b 51ba"
+       #                                               13    (min)"
+       [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b"
 fi
 
 FAIL_ON_ERROR=false
@@ -4097,6 +4097,12 @@ test_51a() {     # was test_51
 }
 run_test 51a "special situations: split htree with empty entry =="
 
+cleanup_print_lfs_df () {
+       trap 0
+       $LFS df
+       $LFS df -i
+}
+
 test_51b() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
        local dir=$DIR/$tdir
@@ -4118,10 +4124,12 @@ test_51b() {
 
        # need to check free space for the directories as well
        local blkfree=$(lctl get_param -n mdc.$FSNAME-MDT$mdtidx*.kbytesavail)
-       numfree=$((blkfree / 4))
+       numfree=$(( blkfree / $(fs_inode_ksize) ))
        [[ $numfree -lt $nrdirs ]] && skip "not enough blocks ($numfree)" &&
                return
 
+       trap cleanup_print_lfsdf EXIT
+
        # create files
        createmany -d $dir/d $nrdirs ||
                error "failed to create $nrdirs subdirs in MDT$mdtidx:$dir"
@@ -4133,6 +4141,9 @@ test_51b() {
        local left=100
        local delete=$((nrdirs - left))
 
+       $LFS df
+       $LFS df -i
+
        # for ldiskfs the nlink count should be 1, but this is OSD specific
        # and so this is listed for informational purposes only
        echo "nlink before: $(stat -c %h $dir), created before: $nrdirs"
@@ -4151,6 +4162,8 @@ test_51b() {
        local after=$(stat -c %h $dir)
        [[ $after -gt 2 ]] && error "nlink after: $after > 2" ||
                echo "nlink after: $after"
+
+       cleanup_print_lfs_df
 }
 run_test 51b "exceed 64k subdirectory nlink limit on create, verify unlink"
 
index 8561897..95ddf56 100755 (executable)
@@ -700,6 +700,18 @@ fs_log_size() {
        echo -n $size
 }
 
+fs_inode_ksize() {
+       local facet=${1:-$SINGLEMDS}
+       local fstype=$(facet_fstype $facet)
+       local size=0
+       case $fstype in
+               ldiskfs) size=4;;  # ~4KB per inode
+               zfs)     size=11;; # 10 to 11KB per inode
+       esac
+
+       echo -n $size
+}
+
 check_gss_daemon_nodes() {
     local list=$1
     dname=$2