From: Yi Zhang Date: Thu, 26 Nov 2020 08:35:31 +0000 (+0800) Subject: common/rc: _have_iproute2 fix for "ip -V" change X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6705ed29235a7f3d0999cbcd829dae5eca644ffc;p=users%2Fsagi%2Fblktests.git common/rc: _have_iproute2 fix for "ip -V" change With below commit, the version will be updated base on the tag fbef6555 replace SNAPSHOT with auto-generated version string To reproduce it: $ ./check srp/015 common/rc: line 98: [: ip utility, iproute2-5.9.0: integer expression expected Reviewed-by: Bart Van Assche Signed-off-by: Yi Zhang --- diff --git a/common/rc b/common/rc index 0d7a3cd..37eb873 100644 --- a/common/rc +++ b/common/rc @@ -95,7 +95,7 @@ _have_iproute2() { SKIP_REASON="ip utility not found" return 1 fi - if [ "$snapshot" -lt "$1" ]; then + if [[ "$snapshot" =~ ^[0-9]+$ && "$snapshot" -lt "$1" ]]; then SKIP_REASON="ip utility too old" return 1 fi