Whamcloud - gitweb
LU-10576 tests: allow log files to be created/removed 77/33677/4
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 16 Nov 2018 21:41:28 +0000 (14:41 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 4 Dec 2018 23:22:16 +0000 (23:22 +0000)
Allow an llog file to be created or removed during the course of
the test, as this can happen due to internal housekeeping activity.

Also ensure that background cleanup has finished with ZFS before
fetching the number of objects from the MDT.

Test-Parameters: trivial
Test-Parameters: testlist=sanity mdscount=2 mdtcount=4 mdtfilesystemtype=zfs ostfilesystemtype=zfs
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0a0968cfcd90c7493c67b54ba8a7f326163ebbe5
Reviewed-on: https://review.whamcloud.com/33677
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 500d660..daa2fab 100755 (executable)
@@ -19623,11 +19623,12 @@ test_803() {
        done
 
        sync; sleep 3
        done
 
        sync; sleep 3
+       wait_delete_completed # ensure old test cleanups are finished
        echo "before create:"
        $LFS df -i $MOUNT
        local before_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
        echo "before create:"
        $LFS df -i $MOUNT
        local before_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
-       for ((i=0; i<10; i++)); do
+       for i in {1..10}; do
                $LFS mkdir -c 1 -i 1 $DIR/$tdir/foo$i ||
                        error "Fail to create $DIR/$tdir/foo$i"
        done
                $LFS mkdir -c 1 -i 1 $DIR/$tdir/foo$i ||
                        error "Fail to create $DIR/$tdir/foo$i"
        done
@@ -19637,10 +19638,11 @@ test_803() {
        $LFS df -i $MOUNT
        local after_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
        $LFS df -i $MOUNT
        local after_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
-       [ $after_used -ge $((before_used + 10)) ] ||
+       # allow for an llog to be cleaned up during the test
+       [ $after_used -ge $((before_used + 10 - 1)) ] ||
                error "before ($before_used) + 10 > after ($after_used)"
 
                error "before ($before_used) + 10 > after ($after_used)"
 
-       for ((i=0; i<10; i++)); do
+       for i in {1..10}; do
                rm -rf $DIR/$tdir/foo$i ||
                        error "Fail to remove $DIR/$tdir/foo$i"
        done
                rm -rf $DIR/$tdir/foo$i ||
                        error "Fail to remove $DIR/$tdir/foo$i"
        done
@@ -19649,11 +19651,11 @@ test_803() {
        wait_delete_completed
        echo "after unlink:"
        $LFS df -i $MOUNT
        wait_delete_completed
        echo "after unlink:"
        $LFS df -i $MOUNT
-       before_used=$after_used
        after_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
        after_used=$($LFS df -i | grep MDT0000_UUID | awk '{print $3}')
 
-       [ $after_used -le $((before_used - 8)) ] ||
-               error "before ($before_used) - 8 < after ($after_used)"
+       # allow for an llog to be created during the test
+       [ $after_used -le $((before_used + 1)) ] ||
+               error "after ($after_used) > before ($before_used) + 1"
 }
 run_test 803 "verify agent object for remote object"
 
 }
 run_test 803 "verify agent object for remote object"