public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Akshay Lal <akshaylal@google.com>
To: xfs@oss.sgi.com
Cc: Akshay Lal <akshaylal@google.com>
Subject: [PATCH] xfstests: made test 215 backwards compatible with older version of bash.
Date: Wed, 31 Mar 2010 12:06:33 -0700	[thread overview]
Message-ID: <1270062393-5233-1-git-send-email-akshaylal@google.com> (raw)
In-Reply-To: <Fix for test 215>

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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

       reply	other threads:[~2010-03-31 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Fix for test 215>
2010-03-31 19:06 ` Akshay Lal [this message]
2010-03-31 22:33   ` [PATCH] xfstests: made test 215 backwards compatible with older version of bash Dave Chinner
2010-03-31 23:47     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270062393-5233-1-git-send-email-akshaylal@google.com \
    --to=akshaylal@google.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox