[PATCH] xfstests: made test 215 backwards compatible with older version of bash.

Akshay Lal
2010-03-31T19:05:15Z

Test 215 fails on older versions of bash (2.x), mainly due to the use of
'let' for arithemetic operations. Changed to 'expr'.

Signed-off-by: Akshay Lal <akshaylal@google.com>

On branch fix-test-215
Changes to be committed:
diff --git a/215 b/215
index c61f7a5..08aa212 100644
--- a/215
+++ b/215
@@ -68,8 +68,9 @@ $XFS_IO_PROG -F -f \
mtime2=`stat --printf="%Y" $testfile`
ctime2=`stat --printf="%Z" $testfile`

-let mtime_diff=$mtime2-$mtime1
-let ctime_diff=$ctime2-$ctime1
+# Allow support for older bash versions.
+mtime_diff=`expr $mtime2 - $mtime1`
+ctime_diff=`expr $ctime2 - $ctime1`

if [ "$mtime_diff" -eq "0" ]; then
echo "FAIL: mtime not update after mapped write"
---
215 | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/215 b/215
index c61f7a5..24424c2 100644
--- a/215
+++ b/215
@@ -68,8 +68,9 @@ $XFS_IO_PROG -F -f \
mtime2=`stat --printf="%Y" $testfile`
ctime2=`stat --printf="%Z" $testfile`

-let mtime_diff=$mtime2-$mtime1
-let ctime_diff=$ctime2-$ctime1
+# Allow support for older bash versions.
+mtime_diff=`expr $mtime2 - $mtime1`
+ctime_diff=`expr $ctime2 - $ctime1`

if [ "$mtime_diff" -eq "0" ]; then
echo "FAIL: mtime not update after mapped write"
--
1.7.0.1