From 3520d519bb54162231765115cf8d711639c99a62 Mon Sep 17 00:00:00 2001 From: Courrier Guillaume Date: Mon, 12 Feb 2024 16:19:03 +0100 Subject: [PATCH] LU-17527 tests: fix syntax error in test_255a The syntax error comes from the fact that the average speed can be less than 1 (e.g. .85) which means that ${average_cache%.*} is actually empty which means that the left parameter of < is empty. This patch fixes the test by using the speedup instead. The test should compare speedup_cache and speedup_ladvise with lowest_speedup instead of the average read time. Test-Parameters: trivial testlist=sanity env=ONLY=255a,ONLY_REPEAT=50 Signed-off-by: Courrier Guillaume Change-Id: Ie2cd24f813a0efe65e3391a3fb664b9db39a9f92 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54009 Reviewed-by: Andreas Dilger Reviewed-by: Etienne AUJAMES Reviewed-by: Oleg Drokin Tested-by: Maloo Tested-by: jenkins --- lustre/tests/sanity.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 3fb9f3e..0dffc84 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -24060,15 +24060,15 @@ ladvise_willread_performance() speedup_ladvise=$(percent $average_ladvise $average_origin) echo "Average uncached read: $average_origin" - echo "Average speedup with OSS cached read: " \ + echo "Average speedup with OSS cached read:" \ "$average_cache = +$speedup_cache%" - echo "Average speedup with ladvise willread: " \ + echo "Average speedup with ladvise willread:" \ "$average_ladvise = +$speedup_ladvise%" local lowest_speedup=20 - if (( ${average_cache%.*} < $lowest_speedup )); then + if (( ${speedup_cache%.*} < $lowest_speedup )); then echo "Speedup with OSS cached read less than $lowest_speedup%,"\ - " got $average_cache%. Skipping ladvise willread check." + "got $speedup_cache%. Skipping ladvise willread check." return 0 fi @@ -24079,10 +24079,10 @@ ladvise_willread_performance() echo "osd-zfs does not support dontneed or drop_caches" && return 0 - lowest_speedup=$(bc <<<"scale=2; $average_cache / 2") - (( ${average_ladvise%.*} > ${lowest_speedup%.*} )) || + lowest_speedup=$(bc <<<"scale=2; $speedup_cache / 2") + (( ${speedup_ladvise%.*} > ${lowest_speedup%.*} )) || error_not_in_vm "Speedup with willread is less than " \ - "$lowest_speedup%, got $average_ladvise%" + "$lowest_speedup%, got $speedup_ladvise%" } test_255a() { -- 1.8.3.1