From 6521dda6f4377c9c688ce4905cd94adf9f99013f Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Mon, 23 Sep 2019 08:39:48 -0400 Subject: [PATCH] LU-12761: tests: make version_code() accept two number versions too There's now a user in sanity test 103a that calls version_code with 2.6. Andreas rightfully points instead of fixing the caller we can just update the code to accept this usage. Change-Id: I5915cd08a36946c6d26f2e231aa7a820a3eef46a Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/36275 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Nunez --- lustre/tests/test-framework.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 23b01eb..7e2d909 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -451,7 +451,7 @@ version_code() { # split arguments like "1.8.6-wc3" into "1", "8", "6", "wc3" eval set -- $(tr "[:punct:]" " " <<< $*) - echo -n "$((($1 << 16) | ($2 << 8) | $3))" + echo -n "$(((${1:-0} << 16) | (${2:-0} << 8) | ${3:-0}))" } export LINUX_VERSION=$(uname -r | sed -e "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/") -- 1.8.3.1