From 69ae454d4d46228a5de3b95a2ddcd8b8307fed4a Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Wed, 6 Mar 2013 11:12:09 -0600 Subject: [PATCH] test: Fix the way in_sync calculates the sync field location 'in_sync' was using the last field in the RAID status output as the location for the sync ratio field. The sync ratio may not always be the last field, but it will always be the 7th field. So we switch to using the absolute value rather than computing the last field index number. --- test/lib/check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/check.sh b/test/lib/check.sh index 6b7849f84..48e30738f 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -170,8 +170,8 @@ in_sync() { fi if [ ${a[2]} = "raid" ]; then - # Last argument is the sync ratio for RAID - idx=$((${#a[@]} - 1)) + # 6th argument is the sync ratio for RAID + idx=6 type=${a[3]} elif [ ${a[2]} = "mirror" ]; then # 4th Arg tells us how far to the sync ratio