From 2d9b57dfc45d4ee247363f89e69021827916edee Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 20 Nov 2023 18:07:04 -0700 Subject: [PATCH] LU-13138 tests: improve sanity/101d 'dd' parsing If 'dd' takes a long time to complete, or if it finishes in an exact number of seconds, it will not print a decimal point, so the current regexp will fail to detect the runtime. Improve test_101d to allow parsing the 'dd' runtime in this case. Test-Parameters: trivial testlist=sanity env=ONLY=101d,ONLY_REPEAT=100 Fixes: 43ebfad490 ("LU-13138 tests: measure 'dd' time more accurately") Signed-off-by: Andreas Dilger Change-Id: Icb030467c76947d0546916e11a91e5afb33ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53188 Reviewed-by: Arshad Hussain Reviewed-by: Alex Deiter Reviewed-by: Oleg Drokin Tested-by: Maloo Tested-by: jenkins --- lustre/tests/sanity.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 6598498..a09392e 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -11498,8 +11498,9 @@ test_101d() { local sz_KB=$((sz_MB * 1024 / 4)) # 10485760 bytes transferred in 0.000938 secs (11179579337 bytes/sec) # 104857600 bytes (105 MB) copied, 0.00876352 s, 12.0 GB/s + # 83886080 bytes (84 MB, 80 MiB) copied, 16 s, 5.2 MB/s local raOFF=$(LANG=C dd if=$file of=/dev/null bs=4k count=$sz_KB |& - sed -e '/records/d' -e 's/.* \([0-9]*\.[0-9]*\) *s.*/\1/') + sed -e '/records/d' -e 's/.* \([0-9][0-9\.]*\) *s.*/\1/') echo "Cancel LRU locks on lustre client to flush the client cache" cancel_lru_locks osc @@ -11508,17 +11509,17 @@ test_101d() { echo "Reading the test file $file with read-ahead enabled" local raON=$(LANG=C dd if=$file of=/dev/null bs=4k count=$sz_KB |& - sed -e '/records/d' -e 's/.* \([0-9]*\.[0-9]*\) *s.*/\1/') + sed -e '/records/d' -e 's/.* \([0-9][0-9\.]*\) *s.*/\1/') - echo "read-ahead disabled time read $raOFF" - echo "read-ahead enabled time read $raON" + echo "read-ahead disabled time read '$raOFF'" + echo "read-ahead enabled time read '$raON'" rm -f $file wait_delete_completed # use awk for this check instead of bash because it handles decimals - awk "{ exit !($raOFF < 1.0 || $raOFF > $raON) }" <<<"ignore_me" || - error "readahead ${raON}s > no-readahead ${raOFF}s ${sz_MB}M" + awk "{ exit !($raOFF < 0.5 || $raOFF > $raON) }" <<<"ignore_me" || + error "readahead ${raON}s > no-readahead ${raOFF}s (${sz_MB}M)" } run_test 101d "file read with and without read-ahead enabled" -- 1.8.3.1