From: Mr NeilBrown Date: Wed, 23 Sep 2020 01:16:06 +0000 (+1000) Subject: LU-13977 tests: fix float comparison in sanity test_255a X-Git-Tag: 2.13.57~163 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f3b8f3fad502354bed7c3f743e5346200f7a584e LU-13977 tests: fix float comparison in sanity test_255a [ $a -gt $b ] compares integers. in ladvise_willread_performance(), average_ladvise and lowest_speedup are calculated to 2 decimals, so they probably aren't integers. So this (nearly) always fails, but as the failure is not reported when a VM is detected, the failure goes unnoticed. The bash [[ ]] command can be used instead. Its '>' operator compares floats. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: Ifc674d5804b1269cebce82893a08eace9ffd9be4 Reviewed-on: https://review.whamcloud.com/40001 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: James Simmons --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 924d05a..e215505 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -19360,7 +19360,7 @@ ladvise_willread_performance() return 0 lowest_speedup=$(bc <<<"scale=2; $average_cache / 2") - [ ${average_ladvise%.*} -gt $lowest_speedup ] || + [[ ${average_ladvise%.*} > $lowest_speedup ]] || error_not_in_vm "Speedup with willread is less than " \ "$lowest_speedup%, got $average_ladvise%" }