Whamcloud - gitweb
LU-9457 test: improve sanity 253 48/53548/3
authorLai Siyao <lai.siyao@whamcloud.com>
Tue, 19 Dec 2023 08:24:07 +0000 (03:24 -0500)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:30:22 +0000 (08:30 +0000)
Improve sanity test_253: set high watermark to 50M, and fill OST with
fallocate.

Test-Parameters: trivial
Test-Parameters: testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity env=EXCEPT=77c
Test-Parameters: testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity env=EXCEPT=77c
Test-Parameters: testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity env=EXCEPT=77c
Test-Parameters: testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity env=EXCEPT=77c
Test-Parameters: testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity env=EXCEPT=77c
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I85139d7fc0697d08c21bdb19432b40c8dab82ee9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53548
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index dfad122..153a951 100755 (executable)
@@ -23776,6 +23776,7 @@ test_253() {
        [ $PARALLEL == "yes" ] && skip "skip parallel run"
        remote_mds_nodsh && skip "remote MDS with nodsh"
        remote_mgs_nodsh && skip "remote MGS with nodsh"
+       check_set_fallocate_or_skip
 
        local ostidx=0
        local rc=0
@@ -23801,9 +23802,17 @@ test_253() {
 
        dd if=/dev/zero of=$DIR/$tdir/$tfile.0 bs=1M count=10
 
-       local wms=$(ost_watermarks_set_enospc $tfile $ostidx |
-                   grep "watermarks")
-       stack_trap "ost_watermarks_clear_enospc $tfile $ostidx $wms" EXIT
+       local wms=$(ost_watermarks_get $ostidx)
+
+       ost_watermarks_set $ostidx 60 50
+       stack_trap "ost_watermarks_set $ostidx $wms"
+
+       local free_kb=$($LFS df $MOUNT | awk "/$ost_name/ { print \$4 }")
+       local size=$((free_kb * 1024))
+
+       fallocate -l $size $DIR/$tdir/fill_ost$ostidx ||
+               error "fallocate failed"
+       sleep_maxage
 
        local oa_status=$(do_facet $SINGLEMDS $LCTL get_param -n \
                        osp.$mdtosc_proc1.prealloc_status)
@@ -23817,13 +23826,9 @@ test_253() {
                oflag=append || error "Append failed"
 
        rm -f $DIR/$tdir/$tfile.0
-
-       # For this test, we want to delete the files we created to go out of
-       # space but leave the watermark, so we remain nearly out of space
-       ost_watermarks_enospc_delete_files $tfile $ostidx
+       rm -f $DIR/$tdir/fill_ost$ostidx
 
        wait_delete_completed
-
        sleep_maxage
 
        for i in $(seq 10 12); do