From: Andreas Dilger Date: Fri, 28 Jan 2022 05:51:24 +0000 (-0700) Subject: LU-15316 tests: use integers in sanity test_255a X-Git-Tag: 2.15.0-RC3~36 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c185410b0007f841962979f8d6c367db9c48c2a3;p=fs%2Flustre-release.git LU-15316 tests: use integers in sanity test_255a The [[ ... > ... ]] operator doesn't really compare floats, it compares strings. That works as expected if the strings are the same length, but fails for comparisons like [[ 32 > 123 ]]. Use (( ... > ... )) for comparisons, and only use integer values. This test has been failing intermittently forever, but the error was ignored because of running in a VM. Test-Parameters: trivial Fixes: f3b8f3fad502 ("tests: fix float comparison in sanity test_255a") Signed-off-by: Andreas Dilger Change-Id: I6787082cd579ae3f1bdd43222a739c939d3ebbe5 Reviewed-on: https://review.whamcloud.com/46350 Reviewed-by: Arshad Hussain Tested-by: jenkins Tested-by: Maloo Reviewed-by: Elena Gryaznova Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 9900b96..bc0d904 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -21573,9 +21573,9 @@ ladvise_willread_performance() "$average_ladvise = +$speedup_ladvise%" local lowest_speedup=20 - if [ ${average_cache%.*} -lt $lowest_speedup ]; then - echo "Speedup with OSS cached read less than $lowest_speedup%," \ - "got $average_cache%. Skipping ladvise willread check." + if (( ${average_cache%.*} < $lowest_speedup )); then + echo "Speedup with OSS cached read less than $lowest_speedup%,"\ + " got $average_cache%. Skipping ladvise willread check." return 0 fi @@ -21587,7 +21587,7 @@ ladvise_willread_performance() return 0 lowest_speedup=$(bc <<<"scale=2; $average_cache / 2") - [[ ${average_ladvise%.*} > $lowest_speedup ]] || + (( ${average_ladvise%.*} > ${lowest_speedup%.*} )) || error_not_in_vm "Speedup with willread is less than " \ "$lowest_speedup%, got $average_ladvise%" }