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

Akshay Lal akshaylal at google.com
Wed Mar 31 14:06:33 CDT 2010


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 at 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




More information about the xfs mailing list