public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: made test 215 backwards compatible with older version of bash.
       [not found] <Fix for test 215>
@ 2010-03-31 19:06 ` Akshay Lal
  2010-03-31 22:33   ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Akshay Lal @ 2010-03-31 19:06 UTC (permalink / raw)
  To: xfs; +Cc: Akshay Lal

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfstests: made test 215 backwards compatible with older version of bash.
  2010-03-31 19:06 ` [PATCH] xfstests: made test 215 backwards compatible with older version of bash Akshay Lal
@ 2010-03-31 22:33   ` Dave Chinner
  2010-03-31 23:47     ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2010-03-31 22:33 UTC (permalink / raw)
  To: Akshay Lal; +Cc: xfs

On Wed, Mar 31, 2010 at 12:06:33PM -0700, Akshay Lal wrote:
> Test 215 fails on older versions of bash (2.x), mainly due to the use of
> 'let' for arithemetic operations. Changed to 'expr'.

If that is a problem for older bash versions, then there's going
systemic problems throughout the xfstests suite. The let expression
is used about 80 different places, and I don't see anything special
about test 215 that makes it any different from other uses. i might
be missing something, but there's not much context to go on from
your changelog....

Perhaps upgrading your version of bash might be a better approach?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfstests: made test 215 backwards compatible with older version of bash.
  2010-03-31 22:33   ` Dave Chinner
@ 2010-03-31 23:47     ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2010-03-31 23:47 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Akshay Lal, xfs

Dave Chinner wrote:
> On Wed, Mar 31, 2010 at 12:06:33PM -0700, Akshay Lal wrote:
>> Test 215 fails on older versions of bash (2.x), mainly due to the use of
>> 'let' for arithemetic operations. Changed to 'expr'.
> 
> If that is a problem for older bash versions, then there's going
> systemic problems throughout the xfstests suite. The let expression
> is used about 80 different places, and I don't see anything special
> about test 215 that makes it any different from other uses. i might
> be missing something, but there's not much context to go on from
> your changelog....
> 
> Perhaps upgrading your version of bash might be a better approach?
> 
> Cheers,
> 
> Dave.

Also, a wholesale switch from expr to let was done not long ago, for
very specific reasons - see below - so I don't think there's much 
interest in going back in the other direction.

Thanks,
-Eric

commit e714acc0ef37031b9a5a522703f2832f139c22e0
Author: Dave Chinner <david@fromorbit.com>
Date:   Wed Mar 25 20:53:36 2009 +0100

    reduce the number of processes forked
    
    One of the big cpu time consumers when running xfsqa on UML
    is forking of new processes. when looping lots of times,
    using 'expr' to calculate the loop counter increment means
    we fork at least once every loop. using shell builtins means
    that we don't fork and many tests run substantially faster.
    
    Some tests are even runnable with this modification. e.g. 110
    went from taking 4500s to run down to 9s with the loop iterators
    changed to avoid forking.
    
    Signed-off-by: Dave Chinner <david@fromorbit.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/007 b/007
index e8c6610..290f716 100755
--- a/007
+++ b/007
@@ -50,7 +50,7 @@ num_filenames=100
 i=1
 while [ $i -le $num_filenames ]; do
   echo "nametest.$i" >>$sourcefile
-  i=`expr $i + 1`
+  let i=$i+1
 done
 
 mkdir $testdir/$seq

.... etc ....

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-31 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Fix for test 215>
2010-03-31 19:06 ` [PATCH] xfstests: made test 215 backwards compatible with older version of bash Akshay Lal
2010-03-31 22:33   ` Dave Chinner
2010-03-31 23:47     ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox