Whamcloud - gitweb
LU-9457 test: improve sanity 253
authorLai Siyao <lai.siyao@whamcloud.com>
Tue, 19 Dec 2023 08:24:07 +0000 (03:24 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Jun 2024 08:15:20 +0000 (08:15 +0000)
Improve sanity test_253: set high watermark to 50M, and fill OST with
fallocate.

Lustre-change: https://review.whamcloud.com/53548
Lustre-commit: e934646f5ea87cd8a432db0e672c6ea48867ea47

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

index df18e54..b54f58d 100644 (file)
@@ -22435,6 +22435,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
@@ -22459,9 +22460,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)
@@ -22475,13 +22484,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