Whamcloud - gitweb
LU-18837 tests: fix numeric comparison in sanity/101a 69/58469/3
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 20 Mar 2025 00:22:45 +0000 (18:22 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 10 Apr 2025 06:58:38 +0000 (06:58 +0000)
Use (( ... )) instead of [[ ... ]] for numeric comparisons.

Test-Parameters: trivial
Fixes: ff78e1aa33 ("LU-4322 tests: re-enable 101a in dne config")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I5e210e0ca6495df4497ef7071086ef5928c267eb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58469
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity.sh

index 25a0429..1ad09ec 100755 (executable)
@@ -12331,7 +12331,7 @@ function get_named_value()
 }
 
 test_101a() {
-       [ $PARALLEL == "yes" ] && skip "skip parallel run"
+       [[ $PARALLEL != "yes" ]] || skip "skip parallel run"
 
        local s
        local discard
@@ -12362,8 +12362,8 @@ test_101a() {
 
        # Discard is generally zero, but sometimes a few random reads line up
        # and trigger larger readahead, which is wasted & leads to discards.
-       if [[ $(($discard)) -gt $nreads ]]; then
-               error "too many ($discard) discarded pages"
+       if (( $discard > $nreads )); then
+               error "too many discarded pages ($discard > $nreads)"
        fi
        rm -f $DIR/$tfile || true
 }