Whamcloud - gitweb
LU-17527 tests: fix syntax error in test_255a 09/54009/3
authorCourrier Guillaume <guillaume.courrier@cea.fr>
Mon, 12 Feb 2024 15:19:03 +0000 (16:19 +0100)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:10:03 +0000 (07:10 +0000)
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 <guillaume.courrier@cea.fr>
Change-Id: Ie2cd24f813a0efe65e3391a3fb664b9db39a9f92
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54009
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/tests/sanity.sh

index 3fb9f3e..0dffc84 100755 (executable)
@@ -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() {