Whamcloud - gitweb
LU-614 tests: speed up needlessly long tests
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 26 Aug 2011 08:26:51 +0000 (02:26 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Sep 2011 17:48:56 +0000 (13:48 -0400)
Fix unlinkmany to use the original $next_id instead of the one
seen after createmany was run.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I816081ab1ee04fe66d6c14b76eb076262215bc32
Reviewed-on: http://review.whamcloud.com/1298
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 18b91e4..e0acee1 100644 (file)
@@ -8260,21 +8260,22 @@ test_220() { #LU-325
        echo "OST still has $count objects"
 
        free=$((count + last_id - next_id))
        echo "OST still has $count objects"
 
        free=$((count + last_id - next_id))
-       echo "create $free files..."
+       echo "create $((free - next_id)) files @next_id..."
        createmany -o $DIR/$tdir/f $next_id $free || return 3
 
        createmany -o $DIR/$tdir/f $next_id $free || return 3
 
-       local last_id=$(do_facet mds${MDSIDX} lctl get_param -n \
+       local last_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
                        osc.$mdtosc_proc1.prealloc_last_id)
                        osc.$mdtosc_proc1.prealloc_last_id)
-       local next_id=$(do_facet mds${MDSIDX} lctl get_param -n \
+       local next_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
                        osc.$mdtosc_proc1.prealloc_next_id)
 
                        osc.$mdtosc_proc1.prealloc_next_id)
 
-       echo "after creation, last_id=$last_id, next_id=$next_id"
+       echo "after creation, last_id=$last_id2, next_id=$next_id2"
        $LFS df -i
 
        echo "cleanup..."
 
        do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
        do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
        $LFS df -i
 
        echo "cleanup..."
 
        do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
        do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
+       echo "unlink $((free - next_id)) files @ $next_id..."
        unlinkmany $DIR/$tdir/f $next_id $free || return 3
 }
 run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"
        unlinkmany $DIR/$tdir/f $next_id $free || return 3
 }
 run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"