From 8223dda735e4e7b46cc5a65f6397af42dc360491 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Fri, 11 Mar 2022 11:16:19 +0530 Subject: [PATCH] LU-15626 tests: Fix "error" reported by shellcheck for sanity-lfsck This patch fixes "error" issues reported by shellcheck for file lustre/tests/sanity-lfsck Test-Parameters: trivial testlist=sanity-lfsck Signed-off-by: Arshad Hussain Change-Id: I3f85cb04f93125ed132831c14a8a3f3616c99a0d Reviewed-on: https://review.whamcloud.com/46795 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-lfsck.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 87a96d1..e2173fe 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -10,7 +10,7 @@ ONLY=${ONLY:-"$*"} LUSTRE=${LUSTRE:-$(dirname $0)/..} . $LUSTRE/tests/test-framework.sh -init_test_env $@ +init_test_env "$@" init_logging # bug number for skipped test: @@ -947,7 +947,7 @@ run_test 7b "non-stopped LFSCK should auto restarts after MDS remount (2)" namespace_error() { $SHOW_NAMESPACE - error $@ + error "$@" } test_8() @@ -1174,7 +1174,7 @@ test_9a() { # We allow another 20% schedule error. local TIME_DIFF=2 # MAX_MARGIN = 1.3 = 13 / 10 - local MAX_SPEED=$((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) / \ + local MAX_SPEED=$((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) / RUN_TIME1 * 13 / 10)) [ $SPEED -lt $MAX_SPEED ] || { $SHOW_LAYOUT @@ -1191,8 +1191,8 @@ test_9a() { SPEED=$($SHOW_LAYOUT | awk '/^average_speed_phase1/ { print $2 }') # MIN_MARGIN = 0.7 = 7 / 10 - local MIN_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 - TIME_DIFF) + \ - BASE_SPEED2 * (RUN_TIME2 - TIME_DIFF)) / \ + local MIN_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 - TIME_DIFF) + + BASE_SPEED2 * (RUN_TIME2 - TIME_DIFF)) / (RUN_TIME1 + RUN_TIME2) * 7 / 10)) [ $SPEED -gt $MIN_SPEED ] || { if [ $mds1_FSTYPE != ldiskfs ]; then @@ -1205,8 +1205,8 @@ test_9a() { } # MAX_MARGIN = 1.3 = 13 / 10 - MAX_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) + \ - BASE_SPEED2 * (RUN_TIME2 + TIME_DIFF)) / \ + MAX_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) + + BASE_SPEED2 * (RUN_TIME2 + TIME_DIFF)) / (RUN_TIME1 + RUN_TIME2) * 13 / 10)) [ $SPEED -lt $MAX_SPEED ] || { $SHOW_LAYOUT @@ -1272,7 +1272,7 @@ test_9b() { # We allow another 20% schedule error. local TIME_DIFF=2 # MAX_MARGIN = 1.3 = 13 / 10 - local MAX_SPEED=$((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) / \ + local MAX_SPEED=$((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) / RUN_TIME1 * 13 / 10)) [ $SPEED -lt $MAX_SPEED ] || { $SHOW_NAMESPACE @@ -1289,8 +1289,8 @@ test_9b() { SPEED=$($SHOW_NAMESPACE | awk '/^average_speed_phase2/ { print $2 }') # MIN_MARGIN = 0.7 = 7 / 10 - local MIN_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 - TIME_DIFF) + \ - BASE_SPEED2 * (RUN_TIME2 - TIME_DIFF)) / \ + local MIN_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 - TIME_DIFF) + + BASE_SPEED2 * (RUN_TIME2 - TIME_DIFF)) / (RUN_TIME1 + RUN_TIME2) * 7 / 10)) [ $SPEED -gt $MIN_SPEED ] || { if [ $mds1_FSTYPE != ldiskfs ]; then @@ -1303,8 +1303,8 @@ test_9b() { } # MAX_MARGIN = 1.3 = 13 / 10 - MAX_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) + \ - BASE_SPEED2 * (RUN_TIME2 + TIME_DIFF)) / \ + MAX_SPEED=$(((BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) + + BASE_SPEED2 * (RUN_TIME2 + TIME_DIFF)) / (RUN_TIME1 + RUN_TIME2) * 13 / 10)) [ $SPEED -lt $MAX_SPEED ] || { $SHOW_NAMESPACE -- 1.8.3.1