public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove bashisms from xfstests
@ 2010-01-03 10:30 Christian Kujau
  2010-01-03 16:56 ` Andi Kleen
  2010-01-06 16:48 ` Christoph Hellwig
  0 siblings, 2 replies; 9+ messages in thread
From: Christian Kujau @ 2010-01-03 10:30 UTC (permalink / raw)
  To: xfs

While trying to run xfstests, I encountered several errors due to the fact 
that my /bin/sh is not linked to /bin/bash but to dash(1), which can be 
made the default /bin/sh in Debian based systems. The patch below is 
rather large and is touching many files, but it's pretty straightfoward:

1) convert brace expansions (e.g. "rm -f symlink_{0,1,2,3}")
2) convert "let..." into something (hopefully) more portable
3) replace 'a == b' with 'a = b' in bourne shell scripts

With these changes applied, xfstests is actually running on this box 
(tested on Ubuntu/9.10). I don't have an IRIX system to test on though.
There are still a few things left to fix, as I'm still get a few errors
while running the tests, but without these changes the testsuit pretty
much would not run at all.

Thoughts?

Christian.

 71 files changed, 197 insertions(+), 175 deletions(-)

diff -Nrup xfstests.orig/005 xfstests/005
--- xfstests.orig/005	2010-01-03 00:42:16.471617592 -0800
+++ xfstests/005	2010-01-03 00:43:56.321617592 -0800
@@ -45,7 +45,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 1
 _cleanup()
 {
     cd $testdir
-    rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
+    rm -f symlink_* empty_file
     cd /
     _cleanup_testdir
 }
@@ -70,7 +70,7 @@ _touch()
 _supported_fs generic
 
 # IRIX UDF does not support symlinks
-if [ $FSTYP == 'udf' ]; then
+if [ $FSTYP = 'udf' ]; then
     _supported_os Linux
 else
     _supported_os Linux IRIX
@@ -82,17 +82,24 @@ cd $testdir
 
 o=empty_file
 touch $o
-for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
+f=1
+while [ $f -le 40 ]
 do
-    ln -s $o $f
+    ln -s $o symlink_$f
     o=$f
+    o=symlink_$f
+    f=$((f + 1))
 done
 
 ln -s symlink_self symlink_self
 
 echo "*** touch deep symlinks"
 echo ""
-_touch symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
+i=1
+while [ $i -le 40 ]; do
+	_touch symlink_"$i"
+	i=$((i + 1))
+done
 echo ""
 echo "*** touch recusive symlinks"
 echo ""
diff -Nrup xfstests.orig/007 xfstests/007
--- xfstests.orig/007	2010-01-03 00:42:16.481617592 -0800
+++ xfstests/007	2010-01-03 00:43:56.321617592 -0800
@@ -64,7 +64,7 @@ num_filenames=100
 i=1
 while [ $i -le $num_filenames ]; do
   echo "nametest.$i" >>$sourcefile
-  let i=$i+1
+  i=$((i + 1))
 done
 
 mkdir $testdir/$seq
diff -Nrup xfstests.orig/010 xfstests/010
--- xfstests.orig/010	2010-01-03 00:42:16.501617592 -0800
+++ xfstests/010	2010-01-03 00:43:56.321617592 -0800
@@ -36,7 +36,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -f $testdir/DBtest*.{pag,dir}
+    rm -f $testdir/DBtest*.pag $testdir/DBtest*.dir
     _cleanup_testdir
 }
 
diff -Nrup xfstests.orig/016 xfstests/016
--- xfstests.orig/016	2010-01-03 00:42:16.521617592 -0800
+++ xfstests/016	2010-01-03 00:43:56.321617592 -0800
@@ -102,7 +102,7 @@ _log_traffic()
     do
         touch $out
         rm $out
-        let "count = count - 1"
+        count=$((count - 1))
     done
 
     echo "   *** unmount"
diff -Nrup xfstests.orig/020 xfstests/020
--- xfstests.orig/020	2010-01-03 00:42:16.541617592 -0800
+++ xfstests/020	2010-01-03 00:43:56.321617592 -0800
@@ -128,7 +128,7 @@ do
         exit 1
     fi
     
-    let "v = v + 1"
+    v=$((v + 1))
 done
 
 echo "*** check"
@@ -151,7 +151,7 @@ do
         exit 1
     fi
     
-    let "v = v + 1"
+    v=$((v + 1))
 done
 
 _attr_list $testfile
diff -Nrup xfstests.orig/028 xfstests/028
--- xfstests.orig/028	2010-01-03 00:42:16.581617592 -0800
+++ xfstests/028	2010-01-03 00:43:56.321617592 -0800
@@ -58,7 +58,7 @@ while [ $i -lt 5 ]; do
     fi
     rm $dump_file
     sleep 2
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "middate = $middate" >>$seq.full
--- xfstests.orig/031	2010-01-03 00:42:16.591617592 -0800
+++ xfstests/031	2010-01-03 02:19:04.505494591 -0800
@@ -69,6 +69,7 @@ _check_repair()
 _create_proto()
 {
 	total=$1
+	isize=256
 	count=0
 
 	# take inode size into account for non-shortform directories...
@@ -85,7 +86,7 @@ EOF
 
 	while [ $count -lt $total ]
 	do
-		let count=$count+1
+		count=$((count + 1))
 		cat >>$tmp.proto <<EOF
 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
 EOF
diff -Nrup xfstests.orig/032 xfstests/032
--- xfstests.orig/032	2010-01-03 00:42:16.601617592 -0800
+++ xfstests/032	2010-01-03 00:43:56.321617592 -0800
@@ -66,6 +66,7 @@ do
 	[ $fs = ext3 ] && preargs="-F"
 	[ $fs = ext4 ] && preargs="-F"
 	[ $fs = ext4dev ] && preargs="-F"
+	[ $fs = nilfs2 ] && preargs="-q"
 
 	# overwite the first few Kb - should blow away superblocks
 	src/devzero -n 20 $SCRATCH_DEV >/dev/null
diff -Nrup xfstests.orig/043 xfstests/043
--- xfstests.orig/043	2010-01-03 00:42:16.651617592 -0800
+++ xfstests/043	2010-01-03 00:43:56.321617592 -0800
@@ -49,7 +49,7 @@ _require_tape $TAPE_DEV 
 _create_dumpdir_fill
 _erase_hard
 _do_dump_sub
-rm -rf /var/{,lib/}xfsdump/inventory # delete it - let cleanup fix it
+rm -rf /var/lib/xfsdump/inventory /var/xfsdump/inventory # delete it - let cleanup fix it
 _do_restore
 _diff_compare_sub
 _ls_compare_sub
diff -Nrup xfstests.orig/044 xfstests/044
--- xfstests.orig/044	2010-01-03 00:42:16.661617592 -0800
+++ xfstests/044	2010-01-03 00:43:56.321617592 -0800
@@ -172,7 +172,7 @@ echo "*** write large dirty log"
 $here/src/loggen -u 2 -e 16000 -z 100 >$SCRATCH_LOGDEV
 _check_mount
 
-echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
+printf "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
 
 status=0
 # if error
diff -Nrup xfstests.orig/047 xfstests/047
--- xfstests.orig/047	2010-01-03 00:42:16.671617592 -0800
+++ xfstests/047	2010-01-03 00:43:56.321617592 -0800
@@ -58,7 +58,7 @@ while [ $i -lt 5 ]; do
     fi
     rm $dump_file
     sleep 2
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "middate = $middate" >>$seq.full
diff -Nrup xfstests.orig/050 xfstests/050
--- xfstests.orig/050	2010-01-03 00:42:16.681617592 -0800
+++ xfstests/050	2010-01-03 00:43:56.321617592 -0800
@@ -181,7 +181,7 @@ EOF
 projid_file="$tmp.projid"
 
 echo "*** user"
-if [ "$HOSTOS" == "IRIX" ]
+if [ "$HOSTOS" = "IRIX" ]
 then
 	_qmount_option "quota"
 else
@@ -194,7 +194,7 @@ _qmount_option "gquota"
 _exercise
 
 echo "*** uqnoenforce"
-if [ "$HOSTOS" == "IRIX" ]
+if [ "$HOSTOS" = "IRIX" ]
 then
 	_qmount_option "qnoenforce"
 else
diff -Nrup xfstests.orig/051 xfstests/051
--- xfstests.orig/051	2010-01-03 00:42:16.691617592 -0800
+++ xfstests/051	2010-01-03 00:43:56.321617592 -0800
@@ -289,16 +289,13 @@ chacl -l acldir/file2 | _acl_filter_id
 echo ""
 echo "=== Recursive change ACL ==="
 rm -fr root
-mkdir root
-pushd root >/dev/null
 # create an arbitrary little tree
 for i in 1 2 3 4 5 6 7 8 9 0
 do
-	mkdir -p a/$i
-	mkdir -p b/c$i/$i
-	touch a/$i/mumble
+	mkdir -p root/a/$i
+	mkdir -p root/b/c$i/$i
+	touch root/a/$i/mumble
 done
-popd >/dev/null
 chown -R 12345.54321 root
 echo "Change #1..."
 $runas -u 12345 -g 54321 -- `which chacl` -r u::rwx,g::-w-,o::--x root
diff -Nrup xfstests.orig/053 xfstests/053
--- xfstests.orig/053	2010-01-03 00:42:16.701617592 -0800
+++ xfstests/053	2010-01-03 00:43:56.321617592 -0800
@@ -68,7 +68,7 @@ for acl in $acls
 do
   _do "touch $test.$i"
   _do "chacl $acl $test.$i"
-  let i=$i+1
+  i=$((i + 1))
 done
 
 list_acls()
@@ -77,7 +77,7 @@ list_acls()
   for acl in $acls
   do
     chacl -l $test.$i | _acl_filter_id | sed -e "s!$SCRATCH_MNT!\$SCRATCH_MNT!"
-    let i=$i+1
+    i=$((i + 1))
   done
 }
 
diff -Nrup xfstests.orig/064 xfstests/064
--- xfstests.orig/064	2010-01-03 00:42:16.751617592 -0800
+++ xfstests/064	2010-01-03 00:43:56.321617592 -0800
@@ -72,7 +72,7 @@ while [ $i -le 9 ]; do
     date >>$seq.full
     find $SCRATCH_MNT -exec $here/src/lstat64 {} \; | sed 's/(00.*)//' >$tmp.dates.$i
     if [ $i -gt 0 ]; then
-       let level_1=$i-1
+       level_1=$((i - 1))
        diff -c $tmp.dates.$level_1 $tmp.dates.$i >>$seq.full
     else
        cat $tmp.dates.$i >>$seq.full
@@ -80,7 +80,7 @@ while [ $i -le 9 ]; do
 
     dump_file=$tmp.df.level$i
     _do_dump_file -l $i
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "Listing of what files we start with:"
@@ -93,7 +93,7 @@ while [ $i -le 9 ]; do
     echo "restoring from df.level$i"
     dump_file=$tmp.df.level$i
     _do_restore_toc
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "Do the cumulative restores"
@@ -105,7 +105,7 @@ while [ $i -le 9 ]; do
     _do_restore_file_cum -l $i
     echo "ls -l restore_dir"
     ls -lR $restore_dir | _ls_size_filter | _check_quota_file
-    let i=$i+1
+    i=$((i + 1))
 done
 
 # success, all done
diff -Nrup xfstests.orig/065 xfstests/065
--- xfstests.orig/065	2010-01-03 00:42:16.751617592 -0800
+++ xfstests/065	2010-01-03 00:43:56.321617592 -0800
@@ -160,7 +160,7 @@ while [ $i -le $num_dumps ]; do
 
     dump_file=$tmp.df.level$i
     _do_dump_file -l $i
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "Look at what files are contained in the inc. dump"
@@ -170,7 +170,7 @@ while [ $i -le $num_dumps ]; do
     echo "restoring from df.level$i"
     dump_file=$tmp.df.level$i
     _do_restore_toc
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo "Do the cumulative restores"
@@ -182,7 +182,7 @@ while [ $i -le $num_dumps ]; do
     _do_restore_file_cum -l $i
     echo "list restore_dir"
     _list_dir $restore_dir | _check_quota_file | tee $tmp.restorals.$i
-    let i=$i+1
+    i=$((i + 1))
 done
 
 echo ""
@@ -192,7 +192,7 @@ while [ $i -le $num_dumps ]; do
     echo "Comparing ls of FS with restored FS at level $i"
     diff -s $tmp.ls.$i $tmp.restorals.$i | sed "s#$tmp#TMP#g"
     echo ""
-    let i=$i+1
+    i=$((i + 1))
 done
 
 
diff -Nrup xfstests.orig/067 xfstests/067
--- xfstests.orig/067	2010-01-03 00:42:16.761617592 -0800
+++ xfstests/067	2010-01-03 00:43:56.321617592 -0800
@@ -50,7 +50,7 @@ _require_scratch
 # set up fs for 1K inodes
 isize=0
 _scratch_mkfs_xfs | _filter_mkfs >$seq.full 2>$tmp.mkfs
-[ $? -eq 0 ] && source $tmp.mkfs
+[ $? -eq 0 ] && . $tmp.mkfs
 if [ "$isize" -lt 1024 ]; then
     _scratch_mkfs_xfs -i size=1024 >>$here/$seq.full \
 	|| _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
diff -Nrup xfstests.orig/068 xfstests/068
--- xfstests.orig/068	2010-01-03 00:42:16.771617592 -0800
+++ xfstests/068	2010-01-03 00:43:56.331617592 -0800
@@ -89,7 +89,7 @@ touch $tmp.running
 } &
 
 i=0
-let ITERATIONS=$ITERATIONS-1
+ITERATIONS=$((ITERATIONS - 1))
 
 echo | tee -a $seq.full
 while [ $i -le $ITERATIONS ]
@@ -108,7 +108,7 @@ do
 	sleep 2
 
 	echo  | tee -a $seq.full
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # stop fsstress iterations
diff -Nrup xfstests.orig/071 xfstests/071
--- xfstests.orig/071	2010-01-03 00:42:16.781617592 -0800
+++ xfstests/071	2010-01-03 00:43:56.331617592 -0800
@@ -145,7 +145,7 @@ do
     echo === Iterating, `expr $upperbound - $count` remains
     echo
     echo
-    let count=$count+1
+    count=$((count + 1))
 done
 
 # success, all done
diff -Nrup xfstests.orig/074 xfstests/074
--- xfstests.orig/074	2010-01-03 00:42:16.801617592 -0800
+++ xfstests/074	2010-01-03 00:43:56.331617592 -0800
@@ -119,7 +119,7 @@ _supported_os IRIX Linux
 # These params can take a while on different CPUs/OSs
 # so we set them differently for different machines
 #
-if [ $HOSTOS == "IRIX" ]; then 
+if [ $HOSTOS = "IRIX" ]; then 
     if uname -R | grep -iq debug; then 
         # e.g. getting around 37secs for 1,1,1 on IP30 debug
 	numchildren=2
@@ -133,7 +133,7 @@ if [ $HOSTOS == "IRIX" ]; then 
 	numchildren=3
         param_type="IRIX nondebug"
     fi
-elif [ $HOSTOS == "Linux" ]; then
+elif [ $HOSTOS = "Linux" ]; then
     if uname -a | grep -q SMP; then
         numloops=10
         numfiles=5
diff -Nrup xfstests.orig/075 xfstests/075
--- xfstests.orig/075	2010-01-03 00:42:16.801617592 -0800
+++ xfstests/075	2010-01-03 00:43:56.331617592 -0800
@@ -79,7 +79,7 @@ _do_test()
     cd $out
     if ! $here/ltp/fsx $_param -P $here $seq.$_n >/dev/null
     then
-	echo "    fsx ($_param) failed, $? - compare $seq.$_n.{good,bad,fsxlog}"
+	echo "    fsx ($_param) failed, $? - compare $seq.$_n.good/bad/fsxlog"
 	mv $out/$seq.$_n $here/$seq.$_n.full
 	od -xAx $here/$seq.$_n.full > $here/$seq.$_n.bad
 	od -xAx $here/$seq.$_n.fsxgood > $here/$seq.$_n.good
@@ -159,5 +159,5 @@ _do_test 1 "-d -N $numops1 -S 0 -x"
 _do_test 2 "-d -N $numops2 -l $filelen -S 0"
 _do_test 3 "-d -N $numops2 -l $filelen -S 0 -x"
 
-rm -f $seq.*.fsx{good,log}
+rm -f $seq.*.fsxgood $seq.*.fsxlog
 exit 0
diff -Nrup xfstests.orig/084 xfstests/084
--- xfstests.orig/084	2010-01-03 00:42:16.841617592 -0800
+++ xfstests/084	2010-01-03 00:43:56.331617592 -0800
@@ -54,7 +54,7 @@ pgsize=`$here/src/feature -s`
 _supported_fs xfs
 _supported_os IRIX Linux
 
-if [ $HOSTOS == "IRIX" ]; then 
+if [ $HOSTOS = "IRIX" ]; then 
     if uname -R | grep -iq debug; then 
         # taking up to 23 mins on my 512K octane on debug
         # not worth worrying about
diff -Nrup xfstests.orig/085 xfstests/085
--- xfstests.orig/085	2010-01-03 00:42:16.851617592 -0800
+++ xfstests/085	2010-01-03 00:43:56.331617592 -0800
@@ -58,7 +58,11 @@ _scratch_mount >>$seq.full 2>&1 \
     || _fail "mount failed: $MOUNT_OPTIONS"
 
 echo "touch files"
-touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
+f=1
+while [ $f -le 100 ]; do
+	touch $SCRATCH_MNT/$f
+	f=$((f + 1))
+done
 
 echo "godown"
 src/godown -v -f $SCRATCH_MNT >> $seq.full
diff -Nrup xfstests.orig/086 xfstests/086
--- xfstests.orig/086	2010-01-03 00:42:16.851617592 -0800
+++ xfstests/086	2010-01-03 00:43:56.331617592 -0800
@@ -102,15 +102,22 @@ for s in sync nosync ; do
 	if [ $s = "sync" ]; then
 	    # generate some log traffic - but not too much
 	    # add some syncs to get the log flushed to disk 
-	    for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
-		touch $file
+	    file=1
+	    while [ $file -le 100 ]; do
+		touch $SCRATCH_MNT/$file
+		file=$((file + 1))
 		sync
 	    done
 	else
 	    # generate some log traffic - but not too much - life gets a little
 	    # more complicated if the log wraps around. This traffic is
 	    # pretty much arbitary, but could probably be made better than this.
-	    touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
+	    file=1
+	    while [ $file -le 100 ]; do
+		touch $SCRATCH_MNT/$file
+		file=$((file + 1))
+		sync
+	    done
 	fi
 
 	# check before on what FS should look like
diff -Nrup xfstests.orig/089 xfstests/089
--- xfstests.orig/089	2010-01-03 00:42:16.871617592 -0800
+++ xfstests/089	2010-01-03 00:43:56.331617592 -0800
@@ -44,7 +44,7 @@ addentries()
 
 	while [ $count -gt 0 ]; do
 		touch `printf $pattern $count`
-		let count=$count-1
+		count=$((count - 1))
 	done
 }
 
diff -Nrup xfstests.orig/091 xfstests/091
--- xfstests.orig/091	2010-01-03 00:42:16.881617592 -0800
+++ xfstests/091	2010-01-03 00:43:56.331617592 -0800
@@ -40,7 +40,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2
 _supported_fs xfs
 _supported_os Linux IRIX
 
-[ $HOSTOS == IRIX ] && _notrun "Not working on IRIX yet"
+[ $HOSTOS = IRIX ] && _notrun "Not working on IRIX yet"
 
 rm -f $seq.full
 
@@ -66,7 +66,7 @@ kernel=`uname -r  | sed -e 's/\(2\..\).*
 if [ "$HOSTOS" = "Linux" -a "$kernel" = "2.6" ]; then
 	xfs_info $TEST_DIR | _filter_mkfs 2> $tmp.info > /dev/null
 	if [ $? -eq 0 ]; then
-		source $tmp.info
+		. $tmp.info
 		bsize=$sectsz
 	fi
 fi
diff -Nrup xfstests.orig/097 xfstests/097
--- xfstests.orig/097	2010-01-03 00:42:16.911617592 -0800
+++ xfstests/097	2010-01-03 00:43:56.331617592 -0800
@@ -49,7 +49,7 @@ _umount_and_mount()
 {
     cd /
     umount $TARGET_DIR
-    if [ "$FSTYP" == "xfs" ]; then
+    if [ "$FSTYP" = "xfs" ]; then
 	_test_mount
     else
 	_scratch_mount
@@ -65,7 +65,7 @@ _umount_and_mount()
 # link correct .out file
 # This is done bacause udf and xfs print attrs in different orders.
 rm -rf $seq.out
-if [ "$FSTYP" == "xfs" ]; then
+if [ "$FSTYP" = "xfs" ]; then
     ln -s $seq.out.xfs $seq.out
 else
     ln -s $seq.out.udf $seq.out
@@ -79,7 +79,7 @@ _require_scratch
 _setup_testdir 
 
 TARGET_DIR=$SCRATCH_MNT
-[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
+[ "$FSTYP" = "xfs" ] && TARGET_DIR=$TEST_DIR
 cd $TARGET_DIR
 
 echo "create file foo"
diff -Nrup xfstests.orig/099 xfstests/099
--- xfstests.orig/099	2010-01-03 00:42:16.921617592 -0800
+++ xfstests/099	2010-01-03 00:43:56.331617592 -0800
@@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 1
 runas=$here/src/runas
 
 TARGET_DIR=$SCRATCH_MNT
-[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
+[ "$FSTYP" = "xfs" ] && TARGET_DIR=$TEST_DIR
 
 _cleanup()
 {
@@ -331,7 +331,7 @@ _acl_list largeaclfile | _filter_aces_no
 
 #-------------------------------------------------------
 
-if [ "$FSTYP" == "udf" ]; then
+if [ "$FSTYP" = "udf" ]; then
     cd /
     umount $TARGET_DIR
     # Check the filesystem
diff -Nrup xfstests.orig/100 xfstests/100
--- xfstests.orig/100	2010-01-03 00:42:16.921617592 -0800
+++ xfstests/100	2010-01-03 00:43:56.331617592 -0800
@@ -48,7 +48,7 @@ _supported_os IRIX Linux
 
 # Use _populate_fs() in common.rc to create a directory structure.
 TEMP_DIR=/tmp
-[ "$FSTYP" == "xfs" ] && TEMP_DIR=$TEST_DIR
+[ "$FSTYP" = "xfs" ] && TEMP_DIR=$TEST_DIR
 TAR_FILE=temp.tar
 NDIRS=3
 NFILES=6
diff -Nrup xfstests.orig/105 xfstests/105
--- xfstests.orig/105	2010-01-03 00:42:16.941617592 -0800
+++ xfstests/105	2010-01-03 00:43:56.331617592 -0800
@@ -79,9 +79,9 @@ echo data > subdir/file
 ls -l subdir/file | awk '{ print $1, $3 }'
 
 # add an ACL with a user ACE which has no exec permission 
-if [ "$HOSTOS" == "Linux" ]; then
+if [ "$HOSTOS" = "Linux" ]; then
     setfacl -m u:$acl1:r subdir
-elif [ "$HOSTOS" == "IRIX" ]; then
+elif [ "$HOSTOS" = "IRIX" ]; then
     chacl u:$acl:r--,g::---,o::--- subdir
 else
     echo "Unknown OS!"
diff -Nrup xfstests.orig/108 xfstests/108
--- xfstests.orig/108	2010-01-03 00:42:16.961617592 -0800
+++ xfstests/108	2010-01-03 00:43:56.331617592 -0800
@@ -55,11 +55,11 @@ _require_prjquota
 test_files()
 {
 	echo; echo "### create files, setting up ownership (type=$type)"
-	rm -f $SCRATCH_MNT/{buffer,direct,mmap}
-	$XFS_IO_PROG -fc "chproj $prid" $SCRATCH_MNT/{buffer,direct,mmap}
-	chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
-	chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
-	for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
+	rm -f $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap
+	$XFS_IO_PROG -fc "chproj $prid" $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap
+	chown $uid $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap
+	chgrp $gid $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap
+	for file in $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap; do
 		$here/src/lstat64 $file | head -3 | filter_scratch
 		$XFS_IO_PROG -c lsproj $file
 	done
@@ -78,7 +78,7 @@ test_accounting()
 	wait
 	echo "--- completed parallel IO ($type)" >>$seq.full
 
-	for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
+	for file in $SCRATCH_MNT/buffer $SCRATCH_MNT/direct $SCRATCH_MNT/mmap; do
 		$here/src/lstat64 $file | head -3 | filter_scratch
 	done
 	xfs_quota -c "quota -hnb -$type $id" $QARGS | filter_scratch
diff -Nrup xfstests.orig/109 xfstests/109
--- xfstests.orig/109	2010-01-03 00:42:16.961617592 -0800
+++ xfstests/109	2010-01-03 00:43:56.331617592 -0800
@@ -52,7 +52,7 @@ populate()
 	while [ $i -le $files -a "X$faststart" = "X" ]; do
 		file=$SCRATCH_MNT/f$i
 		xfs_io -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
-		let i=$i+1
+		i=$((i + 1))
 	done
 
 	# remove every second file, freeing up lots of space
@@ -60,7 +60,7 @@ populate()
 	i=1
 	while [ $i -le $files -a "X$faststart" = "X" ]; do
 		rm $SCRATCH_MNT/f$i
-		let i=$i+2
+		i=$((i + 2))
 	done
 
 	echo "flushing changes via umount/mount."
@@ -81,10 +81,10 @@ allocate()
 				xfs_io -f -c 'pwrite -b 64k 0 16m' $file \
 					>/dev/null 2>&1
 				rm $file
-				let j=$j+1
+				j=$((j + 1))
 			done
 		} &
-		let i=$i+1
+		i=$((i + 1))
 	done
 
 	wait
diff -Nrup xfstests.orig/110 xfstests/110
--- xfstests.orig/110	2010-01-03 00:42:16.971617592 -0800
+++ xfstests/110	2010-01-03 00:43:56.331617592 -0800
@@ -66,8 +66,8 @@ E=10030600
 while [ $I -le $E ]
 do
     echo > $SCRATCH_MNT/test/${STR1}${STR2}${STR3}${I}
-    let I=$I+1
-    [ $[$I % 1000] -eq 0 ] && echo "Created $I/$E"
+    I=$((I + 1))
+    [ `expr $I % 1000` -eq 0 ] && echo "Created $I/$E"
 done
 
 sync
@@ -77,7 +77,7 @@ E=10030599
 while [ $I -le $E ]
 do
     rm $SCRATCH_MNT/test/${STR1}${STR2}${STR3}${I} &
-    let I=$I+1
+    I=$((I + 1))
 done
 
 _check_scratch_fs
diff -Nrup xfstests.orig/111 xfstests/111
--- xfstests.orig/111	2010-01-03 00:42:16.971617592 -0800
+++ xfstests/111	2010-01-03 00:43:56.331617592 -0800
@@ -55,7 +55,7 @@ I=0
 while [ $I -lt 1000 ]
 do
     cp src/itrash.c $SCRATCH_MNT/${I}
-    let I=$I+1
+    I=$((I + 1))
 done
 umount $SCRATCH_DEV
 
diff -Nrup xfstests.orig/112 xfstests/112
--- xfstests.orig/112	2010-01-03 00:42:16.981617592 -0800
+++ xfstests/112	2010-01-03 00:43:56.331617592 -0800
@@ -161,5 +161,5 @@ _do_test 1 "-A -d -N $numops1 -S 0 -x"
 _do_test 2 "-A -d -N $numops2 -l $filelen -S 0"
 _do_test 3 "-A -d -N $numops2 -l $filelen -S 0 -x"
 
-rm -f $seq.*.fsx{good,log}
+rm -f $seq.*.fsxgood $seq.*.fsxlog
 exit 0
diff -Nrup xfstests.orig/113 xfstests/113
--- xfstests.orig/113	2010-01-03 00:42:16.981617592 -0800
+++ xfstests/113	2010-01-03 00:43:56.331617592 -0800
@@ -55,7 +55,7 @@ _do_test()
     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
     while [ $__proc -gt 1 ]; do
         _files="$_files $testdir/aiostress.$$.$_n.$__proc"
-	let __proc=$__proc-1
+	__proc=$((__proc - 1))
     done
     rm -f $_files
  
diff -Nrup xfstests.orig/114 xfstests/114
--- xfstests.orig/114	2010-01-03 00:42:16.991617592 -0800
+++ xfstests/114	2010-01-03 00:43:56.331617592 -0800
@@ -149,8 +149,8 @@ _test_hardlink()
 	paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
 	i=0
 	for x in $paths; do
-		let i=$i+1
-		let j=$i%2
+		i=$((i + 1))
+		j=`expr $i % 2`
 		if [ $j -eq 0 ]; then
 			echo "rm'ing $x"
 			rm $x
diff -Nrup xfstests.orig/117 xfstests/117
--- xfstests.orig/117	2010-01-03 00:42:17.001617592 -0800
+++ xfstests/117	2010-01-03 00:43:56.331617592 -0800
@@ -85,7 +85,7 @@ while [ $i -lt $ITERATIONS ]; do
         -s $seed \
 	-S -p 1 -n 1000 >>$seq.full 2>&1
 
-    let i=$i+1
+    i=$((i + 1))
 done
 
 cd /
diff -Nrup xfstests.orig/118 xfstests/118
--- xfstests.orig/118	2010-01-03 00:42:17.011617592 -0800
+++ xfstests/118	2010-01-03 00:43:56.331617592 -0800
@@ -57,17 +57,17 @@ _require_quota
 _chowning_file()
 {
 	file=file.chown
-	let start=$1
-	let limit=$2
-	let delta=$3
+	start=$1
+	limit=$2
+	delta=$3
 
 	cd $SCRATCH_MNT
-	let count=$start
-	while (( count < limit )); do
+	count=$start
+	while [ $count -lt $limit ]; do
 	    touch $file
 	    chown $count.$count $file
-	    echo -n "."
-	    let count=count+delta
+	    printf "."
+	    count=$((count + delta))
 	done
 	echo ""
 }
diff -Nrup xfstests.orig/119 xfstests/119
--- xfstests.orig/119	2010-01-03 00:42:17.011617592 -0800
+++ xfstests/119	2010-01-03 00:43:56.331617592 -0800
@@ -68,7 +68,7 @@ while [ $i -lt $max ]; do
 	xfs_freeze -f $SCRATCH_MNT
 	xfs_freeze -u $SCRATCH_MNT
 	echo -n .
-	let i=$i+1
+	i=$((i + 1))
 done
 echo "done"
 
diff -Nrup xfstests.orig/122 xfstests/122
--- xfstests.orig/122	2010-01-03 00:42:17.021617592 -0800
+++ xfstests/122	2010-01-03 00:43:56.331617592 -0800
@@ -46,7 +46,7 @@ _require_command /usr/bin/indent
 _type_size_filter()
 {
 	# lazy SB adds __be32 agf_btreeblks - pv960372
-	if [ "$($MKFS_XFS_PROG 2>&1 | grep -c lazy-count )" == "0" ]; then
+	if [ "$($MKFS_XFS_PROG 2>&1 | grep -c lazy-count )" = "0" ]; then
 		perl -ne '
 s/sizeof\( xfs_agf_t \) = 60/sizeof( xfs_agf_t ) = <SIZE>/;
 		print;'
diff -Nrup xfstests.orig/123 xfstests/123
--- xfstests.orig/123	2010-01-03 00:42:17.031617592 -0800
+++ xfstests/123	2010-01-03 00:43:56.331617592 -0800
@@ -58,7 +58,7 @@ s,^\s*$,,;
 
 _user_do()
 {
-    if [ "$HOSTOS" == "IRIX" ]
+    if [ "$HOSTOS" = "IRIX" ]
 	then
 	echo $1 | /bin/sh "su $qa_user 2>&1" | _filter_user_do
     else
diff -Nrup xfstests.orig/124 xfstests/124
--- xfstests.orig/124	2010-01-03 00:42:17.031617592 -0800
+++ xfstests/124	2010-01-03 00:43:56.331617592 -0800
@@ -59,21 +59,21 @@ _scratch_mount
 for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
   do
   count=1
-  while (( count < 101 ))
+  while [ $count -lt 101 ]
     do
     src/preallo_rw_pattern_writer $TESTFILE
     src/preallo_rw_pattern_reader $TESTFILE
-    if (test $? -ne 0) then
+    if [ $? -ne 0 ]; then
 	echo Read/Write Pattern Test FAILED.
 	_cleanup
 	exit 1
     fi
     rm $TESTFILE
-    ((count=count+1))
+    count=$((count + 1))
   done #done for count of  100
 done
 
-if (test $? -eq 0 ) then
+if [ $? -eq 0 ]; then
     status=0
 fi
 
diff -Nrup xfstests.orig/134 xfstests/134
--- xfstests.orig/134	2010-01-03 00:42:17.081617592 -0800
+++ xfstests/134	2010-01-03 00:43:56.331617592 -0800
@@ -101,7 +101,7 @@ cp $dir/2 $dir/3
 
 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
 
-if [ "$HOSTOS" == "IRIX" ] ; then
+if [ "$HOSTOS" = "IRIX" ] ; then
     mkfile 1M $TEST_DIR/6
 else
     xfs_mkfile 1M $TEST_DIR/6
diff -Nrup xfstests.orig/136 xfstests/136
--- xfstests.orig/136	2010-01-03 00:42:17.091617592 -0800
+++ xfstests/136	2010-01-03 00:43:56.331617592 -0800
@@ -75,7 +75,7 @@ add_eas()
     i=$start
     while [ $i -le $end ]; do 
 	attr -s name.$i -V value $file >/dev/null
-	let i=$i+1
+	i=$((i + 1))
     done
 }
 
@@ -87,7 +87,7 @@ rm_eas()
     i=$start
     while [ $i -le $end ]; do 
 	attr -r name.$i $file >/dev/null
-	let i=$i+1
+	i=$((i + 1))
     done
 }
 
@@ -185,7 +185,7 @@ _test_add_extents()
 	while [ $j -le 30 ]; do
 	    do_extents $j
 	    _print_inode
-	    let j=$j+2
+	    j=$((j + 2))
 	done
 
 	#scale down
@@ -193,7 +193,7 @@ _test_add_extents()
 	while [ $j -ge 1 ]; do
 	    do_extents $j
 	    _print_inode
-	    let j=$j-2
+	    j=$((j - 2))
 	done
 
 	#build up
@@ -201,7 +201,7 @@ _test_add_extents()
 	while [ $j -le 30 ]; do
 	    do_extents $j
 	    _print_inode
-	    let j=$j+2
+	    j=$((j + 2))
 	done
 }
 
@@ -225,7 +225,7 @@ _test_extents_eas()
 	    _print_inode
 	    _print_inode_u > $tmp.u1
 	    for j in `seq 1 $EAs_inc $EAs_max`; do
-		let k=$k+$EAs_inc-1
+		k=$((k+ EAs_inc - 1))
 		add_eas $j $k
 	    done
 	    # should have same extents
@@ -270,7 +270,7 @@ _test_eas_extents()
 	EAs_inc=5
 	for j in `seq 1 $EAs_inc $EAs_max`; do
 
-	    let k=$k+$EAs_inc-1
+	    k=$((k + EAs_inc - 1))
 	    add_eas $j $k
 	    echo "--- EAs: $j ---"
 
diff -Nrup xfstests.orig/137 xfstests/137
--- xfstests.orig/137	2010-01-03 00:42:17.101617592 -0800
+++ xfstests/137	2010-01-03 00:43:56.331617592 -0800
@@ -61,7 +61,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # give the system a chance to write something out
@@ -104,7 +104,7 @@ do
 			rm -f $file
 		fi
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 status=0
diff -Nrup xfstests.orig/138 xfstests/138
--- xfstests.orig/138	2010-01-03 00:42:17.101617592 -0800
+++ xfstests/138	2010-01-03 00:43:56.331617592 -0800
@@ -67,7 +67,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # give the system a chance to write something out
@@ -110,7 +110,7 @@ do
 			rm -f $file
 		fi
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 status=0
diff -Nrup xfstests.orig/139 xfstests/139
--- xfstests.orig/139	2010-01-03 00:42:17.101617592 -0800
+++ xfstests/139	2010-01-03 00:43:56.331617592 -0800
@@ -67,7 +67,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # give the system a chance to write something out
@@ -110,7 +110,7 @@ do
 			rm -f $file
 		fi
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 status=0
diff -Nrup xfstests.orig/140 xfstests/140
--- xfstests.orig/140	2010-01-03 00:42:17.111617592 -0800
+++ xfstests/140	2010-01-03 00:43:56.331617592 -0800
@@ -67,7 +67,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # give the system a chance to write something out
@@ -107,7 +107,7 @@ do
 			rm -f $file
 		fi
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 status=0
diff -Nrup xfstests.orig/149 xfstests/149
--- xfstests.orig/149	2010-01-03 00:42:17.151617592 -0800
+++ xfstests/149	2010-01-03 00:43:56.331617592 -0800
@@ -88,7 +88,7 @@ EOF
 
 	while [ $count -lt $total ]
 	do
-		let count=$count+1
+		count=$((count + 1))
 		cat >>$tmp.proto <<EOF
 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
 EOF
diff -Nrup xfstests.orig/158 xfstests/158
--- xfstests.orig/158	2010-01-03 00:42:17.191617592 -0800
+++ xfstests/158	2010-01-03 00:43:56.331617592 -0800
@@ -64,25 +64,25 @@ _set_file_attr() {
 atime_before="`_get_file_attr dt_atime`"
 _set_file_attr -a 05m $SCRATCH_MNT/dmapi_test
 atime_after="`_get_file_attr dt_atime`"
-[ "$atime_before" == "$atime_after" ] && echo "dt_atime not updated"
+[ "$atime_before" = "$atime_after" ] && echo "dt_atime not updated"
 
 #dt_mtime
 mtime_before="`_get_file_attr dt_mtime`"
 _set_file_attr -m 10m $SCRATCH_MNT/dmapi_test
 mtime_after="`_get_file_attr dt_mtime`"
-[ "$mtime_before" == "$mtime_after" ] && echo "mt_mtime not updated"
+[ "$mtime_before" = "$mtime_after" ] && echo "mt_mtime not updated"
 
 #dt_ctime
 ctime_before="`_get_file_attr dt_ctime`"
 _set_file_attr -c 15m $SCRATCH_MNT/dmapi_test
 ctime_after="`_get_file_attr dt_ctime`"
-[ "$ctime_before" == "$ctime_after" ] && echo "dt_ctime not updated"
+[ "$ctime_before" = "$ctime_after" ] && echo "dt_ctime not updated"
 
 #dt_dtime
 dtime_before="`_get_file_attr dt_dtime`"
 _set_file_attr -d 20m $SCRATCH_MNT/dmapi_test
 dtime_after="`_get_file_attr dt_dtime`"
-[ "$dtime_before" == "$dtime_after" ] && echo "dt_dtime not updated"
+[ "$dtime_before" = "$dtime_after" ] && echo "dt_dtime not updated"
 
 # -M mode
 _set_file_attr -M 744 $SCRATCH_MNT/dmapi_test
diff -Nrup xfstests.orig/165 xfstests/165
--- xfstests.orig/165	2010-01-03 00:42:17.231617592 -0800
+++ xfstests/165	2010-01-03 00:43:56.331617592 -0800
@@ -96,8 +96,7 @@ do
 
 	$XFS_IO_PROG -c "unresvsp $offset $length" -c "bmap -vp" $testfile | _filter_bmap
 
-	let off=$off+$len # skip over 1
-	let off=$off+$len
+	off=$((off + len + len))	# skip over 1
 done
 
 off=0
@@ -125,8 +124,7 @@ do
 	#$XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile
         #sleep 5
 
-	let off=$off+$len # skip over 1
-	let off=$off+$len
+	off=$((off + len + len))	# skip over 1
 done
 
 wait
diff -Nrup xfstests.orig/178 xfstests/178
--- xfstests.orig/178	2010-01-03 00:42:17.291617592 -0800
+++ xfstests/178	2010-01-03 00:43:56.331617592 -0800
@@ -92,7 +92,7 @@ fi
 _dd_repair_check $SCRATCH_DEV $sectsz
 
 # smaller AGCOUNT
-let "agcount=$agcount-2"
+agcount=$((agcount - 2))
 _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \
         || _fail "mkfs failed!"
 
diff -Nrup xfstests.orig/179 xfstests/179
--- xfstests.orig/179	2010-01-03 00:42:17.291617592 -0800
+++ xfstests/179	2010-01-03 00:43:56.341617592 -0800
@@ -77,7 +77,7 @@ _check_files()
 		else
 			echo file $file missing - fsync failed
 		fi
-		let i=$i+1
+		i=$((i + 1))
 	done
 }
 
@@ -92,7 +92,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # shutdown immediately after, then remount and test
diff -Nrup xfstests.orig/180 xfstests/180
--- xfstests.orig/180	2010-01-03 00:42:17.301617592 -0800
+++ xfstests/180	2010-01-03 00:43:56.341617592 -0800
@@ -82,7 +82,7 @@ _check_files()
 		else
 			echo file $file missing - sync failed
 		fi
-		let i=$i+1
+		i=$((i + 1))
 	done
 }
 
@@ -97,7 +97,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # sync, then shutdown immediately after, then remount and test
diff -Nrup xfstests.orig/182 xfstests/182
--- xfstests.orig/182	2010-01-03 00:42:17.311617592 -0800
+++ xfstests/182	2010-01-03 00:43:56.341617592 -0800
@@ -77,7 +77,7 @@ _check_files()
 		else
 			echo file $file missing - sync failed
 		fi
-		let i=$i+1
+		i=$((i + 1))
 	done
 }
 
@@ -92,7 +92,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	let i=$i+1
+	i=$((i + 1))
 done
 
 # sync, then shutdown immediately after, then remount and test
diff -Nrup xfstests.orig/190 xfstests/190
--- xfstests.orig/190	2010-01-03 00:42:17.341617592 -0800
+++ xfstests/190	2010-01-03 00:43:56.341617592 -0800
@@ -72,21 +72,21 @@ echo Verifying holes are in the correct 
 xfs_bmap=`xfs_bmap $SCRATCH_MNT/$filename`
 xfs_bmap $SCRATCH_MNT/$filename >> $seq.full
 for i in $holes ; do
-	holeStart=$[`echo $i|$SED_PROG 's/:/ /g'|awk '{print $1}'`];
-	holeEnd=$[`echo $i|$SED_PROG 's/:/ /g'|awk '{print $2}'`];
+	holeStart=`echo $i | $SED_PROG 's/:/ /g' | awk '{print $1}'`
+	holeEnd=`echo $i | $SED_PROG 's/:/ /g' | awk '{print $2}'`
 
 	#Round hole size down to a multiple of $fsblocksize
-	holeEnd=$[(($holeStart+$holeEnd)/$fsblocksize)*$fsblocksize]
+	holeEnd=`expr \( \( $holeStart + $holeEnd \) / $fsblocksize \) \* $fsblocksize`
 
 	#Round hole start up to a multiple of $fsblocksize
-	if [ $[$holeStart % $fsblocksize] -gt 0 ] ; then
-		holeStart=$[($holeStart/$fsblocksize +1) * $fsblocksize]
+	if [ `expr $holeStart % $fsblocksize` -gt 0 ] ; then
+		holeStart=`expr \( $holeStart / $fsblocksize +1 \) \* $fsblocksize`
 	fi
 	#xfs_bmap prints holes in the following format
 	#                1: [8..15]: hole
-	bmap="\[$[$holeStart/512]..$[($holeEnd/512) -1]\]";
+	bmap="\[`expr $holeStart / 512`..`expr \( $holeEnd / 512 \) - 1`\]"
 	echo $bmap >> $seq.full
-	if [ $holeEnd == $holeStart ] ; then
+	if [ $holeEnd = $holeStart ] ; then
 		continue #there is no hole
 	fi
 	if ! echo $xfs_bmap|grep -q $bmap; then
@@ -94,7 +94,7 @@ for i in $holes ; do
 		status=1;
 	fi
 done
-if [ $status == 0 ] ; then
+if [ $status = 0 ] ; then
 	echo Test $seq Passed.
 fi
 
diff -Nrup xfstests.orig/200 xfstests/200
--- xfstests.orig/200	2010-01-03 00:42:17.391617592 -0800
+++ xfstests/200	2010-01-03 00:43:56.341617592 -0800
@@ -84,7 +84,11 @@ echo "mounting read-write block device:"
 _scratch_mount 2>&1 | _filter_scratch
 
 echo "touch files"
-touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
+i=1
+while [ $i -le 100 ]; do
+	touch $SCRATCH_MNT/$i
+	i=$((i + 1))
+done
 
 echo "going down:"
 src/godown -f $SCRATCH_MNT
diff -Nrup xfstests.orig/203 xfstests/203
--- xfstests.orig/203	2010-01-03 00:42:17.401617592 -0800
+++ xfstests/203	2010-01-03 00:43:56.341617592 -0800
@@ -35,12 +35,12 @@ _write_holes()
 {
 	file=$1
 	holes=$2
-	let writes=$holes+1
+	writes=$((holes + 1))
 
 	offset=0
 	for i in `seq 0 $writes`; do
 		xfs_io -f $file -c "pwrite -q $offset 1"
-		let offset=$offset+0x100000
+		offset=$((offset + 0x100000))
 	done
 }
 
diff -Nrup xfstests.orig/205 xfstests/205
--- xfstests.orig/205	2010-01-03 00:42:17.411617592 -0800
+++ xfstests/205	2010-01-03 00:43:56.341617592 -0800
@@ -71,7 +71,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/fred bs=
 
 echo "*** one file, a few bytes at a time"
 # now try a single file of that size
-dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=$[26745/15*512] 2>&1 | _filter_dd
+dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=`expr 26745 / 15 \* 512` 2>&1 | _filter_dd
 
 # success, all done
 echo "*** done"
diff -Nrup xfstests.orig/common xfstests/common
--- xfstests.orig/common	2010-01-03 00:42:18.711617592 -0800
+++ xfstests/common	2010-01-03 00:43:56.341617592 -0800
@@ -1,4 +1,3 @@
-##/bin/sh 
 #
 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -45,7 +44,7 @@ randomize=false
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
 # Autodetect fs type based on what's on $TEST_DEV
-if [ "$HOSTOS" == "Linux" ]
+if [ "$HOSTOS" = "Linux" ]
 then
     export FSTYP=`blkid -s TYPE -o value $TEST_DEV`
 else
diff -Nrup xfstests.orig/common.attr xfstests/common.attr
--- xfstests.orig/common.attr	2010-01-03 00:42:18.711617592 -0800
+++ xfstests/common.attr	2010-01-03 00:43:56.341617592 -0800
@@ -77,11 +77,11 @@ _acl_list()
 #
 _create_n_aces()
 {
-    let n=$1-4
+    n=$(($1 - 4))
     acl='u::rwx,g::rwx,o::rwx,m::rwx' # 4 ace acl start
     while [ $n -ne 0 ]; do
 	acl="$acl,u:$n:rwx"
-	let n=$n-1
+	n=$((n - 1))
     done
     echo $acl
 }
diff -Nrup xfstests.orig/common.bonnie xfstests/common.bonnie
--- xfstests.orig/common.bonnie	2010-01-03 00:42:18.721617592 -0800
+++ xfstests/common.bonnie	2010-01-03 01:11:24.505239592 -0800
@@ -17,7 +17,7 @@
 #
 
 #check bonnie is installed
-if [ "`whereis bonnie++`" == "bonnie++:"]; then
+if [ "`whereis bonnie++`" = "bonnie++:"]; then
         echo $0 error bonnie not installed.
         exit
 fi
diff -Nrup xfstests.orig/common.config xfstests/common.config
--- xfstests.orig/common.config	2010-01-03 00:42:18.721617592 -0800
+++ xfstests/common.config	2010-01-03 00:43:56.341617592 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
 #
diff -Nrup xfstests.orig/common.dbench xfstests/common.dbench
--- xfstests.orig/common.dbench	2010-01-03 00:42:18.731617592 -0800
+++ xfstests/common.dbench	2010-01-03 00:46:42.621617592 -0800
@@ -17,7 +17,7 @@
 #
 
 #check dbench is installed
-if [ "`whereis dbench`" == "dbench:"]; then
+if [ "`whereis dbench`" = "dbench:"]; then
         echo $0 error dbench not installed.
         exit
 fi
diff -Nrup xfstests.orig/common.dump xfstests/common.dump
--- xfstests.orig/common.dump	2010-01-03 00:42:18.741617592 -0800
+++ xfstests/common.dump	2010-01-03 00:48:10.391617592 -0800
@@ -111,7 +111,7 @@ _check_onl()
 	else
 	    sleep 1
 	fi
-	let i=$i+1
+	i=$((i + 1))
     done
 
 
@@ -149,7 +149,7 @@ _wait_tape()
 	else
 	    sleep 1
 	fi
-	let i=$i+1
+	i=$((i + 1))
     done
 }
 
@@ -208,7 +208,7 @@ _require_tape()
 {
     dumptape=$1
 
-    if [ -z "$dumptape" -o "@" == "$dumptape" ]; then
+    if [ -z "$dumptape" -o "@" = "$dumptape" ]; then
         echo "This test requires a dump tape - none was specified"
 	echo "No dump tape specified" >$seq.notrun
 	status=$NOTRUNSTS
@@ -701,7 +701,7 @@ _create_hardlinks()
 	_hardlink=$_fname$_suffix
 	echo "creating hardlink $_hardlink to $_fname"
 	ln $_fname $_hardlink
-	let _j=$_j+1
+	_j=$((_j + 1))
     done
 }
 
@@ -717,7 +717,7 @@ _create_hardset()
     _i=1
     while [ $_i -le $_numsets ]; do
 	_create_hardlinks file$_i 5
-	let _i=$_i+1
+	_i=$((_i + 1))
     done
 }
 
@@ -993,7 +993,7 @@ _do_dump_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i -M $media_label.$i"
-	let i=$i+1
+	i=$((i + 1))
     done
 
     echo "Dumping to files..."
@@ -1113,7 +1113,7 @@ _do_restore_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i"
-	let i=$i+1
+	i=$((i + 1))
     done
 
     echo "Restoring from file..."
@@ -1384,7 +1384,7 @@ _check_quota_entries()
 #
 _check_quota_dumprestore()
 {
-    if [ "$HOSTOS" == "IRIX" ]; then
+    if [ "$HOSTOS" = "IRIX" ]; then
 	_check_quota 'user quota information' \
 		     'group quota information' \
 		     'project quota information' | \
diff -Nrup xfstests.orig/common.filestreams xfstests/common.filestreams
--- xfstests.orig/common.filestreams	2010-01-03 00:42:18.741617592 -0800
+++ xfstests/common.filestreams	2010-01-03 00:48:38.301617592 -0800
@@ -24,7 +24,7 @@ _check_filestreams_support()
 	local irix_timeout_sysvar="xfs_mfstream_timeout"
 	local linux_timeout_procvar="/proc/sys/fs/xfs/filestream_centisecs"
 	local streams_avail=""
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		# check for the filestreams timeout systune variable in irix
 		streams_avail=`systune $irix_timeout_sysvar 2>&1 |
 			perl -ne 'if (/'$irix_timeout_sysvar'\s+=\s+\d+/) {print "true"}'`
@@ -33,7 +33,7 @@ _check_filestreams_support()
 		[ -f $linux_timeout_procvar ] && streams_avail="true"
 	fi
 
-	if [ "$streams_avail" == "true" ]; then
+	if [ "$streams_avail" = "true" ]; then
 		return 0
 	else
 		return 1
@@ -45,7 +45,7 @@ _set_stream_timeout_centisecs()
 	local new_timeout_csecs=$1
 	local irix_timeout_sysvar="xfs_mfstream_timeout"
 	local linux_timeout_procvar="/proc/sys/fs/xfs/filestream_centisecs"
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		echo y | systune -r $irix_timeout_sysvar $new_timeout_csecs >/dev/null
 	else
 		echo $new_timeout_csecs > $linux_timeout_procvar
@@ -70,7 +70,7 @@ _do_stream()
 	cd $directory_name
 
 	local dd_cmd=""
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		# for irix use lmdd
 		dd_cmd="lmdd"
 		[ "$dio" = "1" ] && dd_cmd="$dd_cmd odirect=1"
@@ -114,7 +114,7 @@ _check_for_dupes()
         local this_num_two
         for this_num_one in $num_str_one; do
                 for this_num_two in $num_str_two; do
-                        if [ "$this_num_one" == "$this_num_two" ]; then
+                        if [ "$this_num_one" = "$this_num_two" ]; then
 				echo "duplicate AG $this_num_one found" \
 					>> $here/$seq.full
 				return 1
@@ -140,7 +140,7 @@ _test_streams() {
 	_scratch_mkfs_xfs -dsize=$size,agcount=$agcount >/dev/null 2>&1 \
 		|| _fail "mkfs failed"
 
-	if [ "$use_iflag" = "0" -o "$HOSTOS" == "IRIX" ]; then
+	if [ "$use_iflag" = "0" -o "$HOSTOS" = "IRIX" ]; then
 		# mount using filestreams mount option
 		_scratch_mount "-o filestreams" \
 			|| _fail "filestreams mount failed"
diff -Nrup xfstests.orig/common.log xfstests/common.log
--- xfstests.orig/common.log	2010-01-03 00:42:18.751617592 -0800
+++ xfstests/common.log	2010-01-03 01:19:20.602131591 -0800
@@ -314,7 +314,11 @@ _create_log()
     # generate some log traffic - but not too much - life gets a little
     # more complicated if the log wraps around. This traffic is
     # pretty much arbitary, but could probably be made better than this.
-    touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
+    i=1
+    while [ $i -le 100 ]; do
+    	touch $SCRATCH_MNT/$i
+	i=$((i + 1))
+    done
 	
     # unmount the FS
     _full "umount"
@@ -342,9 +346,11 @@ _create_log_sync()
 
     # generate some log traffic - but not too much
     # add some syncs to get the log flushed to disk 
-    for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
-	touch $file
+    i=1
+    while [ $i -le 100 ]; do
+	touch $SCRATCH_MNT/$i
 	sync
+	i=$((i + 1))
     done
 
     # unmount the FS
diff -Nrup xfstests.orig/common.punch xfstests/common.punch
--- xfstests.orig/common.punch	2010-01-03 00:42:18.761617592 -0800
+++ xfstests/common.punch	2010-01-03 00:49:22.511617592 -0800
@@ -40,7 +40,7 @@ _spawn_test_file() {
 	-c "extsize" \
 	$test_file
 
-	if [ "$reserve_space" == "noresv" ]; then
+	if [ "$reserve_space" = "noresv" ]; then
 		echo "+ not using resvsp at file creation"
 		$XFS_IO_PROG -f \
 		-c "truncate $file_size" \
@@ -62,13 +62,13 @@ _do_punch() {
 	local punch_type=$4		# u for unresvsp, d for dm_punch
 	local test_file=$5
 
-	if [ "$punch_type" == "u" ]; then
+	if [ "$punch_type" = "u" ]; then
 		echo "+ hole punch using unresvsp"
 		$XFS_IO_PROG -f \
 		-c "unresvsp $punch_offset $punch_size" \
 		$test_file
 	fi
-	if [ "$punch_type" == "d" ]; then
+	if [ "$punch_type" = "d" ]; then
 		echo "+ hole punch using dmapi punch_hole"
 		${DMAPI_QASUITE1_DIR}cmd/punch_hole -o $punch_offset -l $punch_size \
 			${SCRATCH_MNT}/$test_file
@@ -123,7 +123,7 @@ _test_punch() {
 	local this_punch_type=""
 	local dmap_punch_used=0
 	for this_punch_type in "${punch_types[@]}"; do
-		[ "$this_punch_type" == "d" ] && dmap_punch_used=1
+		[ "$this_punch_type" = "d" ] && dmap_punch_used=1
 	done
 	if [ $dmap_punch_used -ne 0 ]; then
 		# a punch type of dm_punch has been specified, do a dmapi mount
@@ -161,13 +161,13 @@ _test_punch() {
 	local punch_index=0
 	local write_index=0
 	for operation in "${punch_write_order[@]}"; do
-		if [ "$operation" == "p" ]; then
+		if [ "$operation" = "p" ]; then
 			_do_punch $blksize ${punch_points_blks[$punch_index]} \
 				${punch_sizes_blks[$punch_index]} ${punch_types[$punch_index]} \
 				$filename
 			punch_index=`expr $punch_index + 1`
 		fi
-		if [ "$operation" == "w" ]; then
+		if [ "$operation" = "w" ]; then
 			_do_write $blksize ${write_points_blks[$write_index]} \
 				${write_sizes_blks[$write_index]} $filename
 			write_index=`expr $write_index + 1`
diff -Nrup xfstests.orig/common.quota xfstests/common.quota
--- xfstests.orig/common.quota	2010-01-03 00:42:18.771617592 -0800
+++ xfstests/common.quota	2010-01-03 00:49:41.321617592 -0800
@@ -104,7 +104,7 @@ _choose_gid()
 
 _choose_prid()
 {
-    if [ "X$projid_file" == "X" ]; then
+    if [ "X$projid_file" = "X" ]; then
 	projid_file=/etc/projid
     fi
     if [ ! -f $projid_file ]; then
diff -Nrup xfstests.orig/common.rc xfstests/common.rc
--- xfstests.orig/common.rc	2010-01-03 00:42:18.771617592 -0800
+++ xfstests/common.rc	2010-01-03 00:50:11.001617592 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #-----------------------------------------------------------------------
 #  Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
 #  This program is free software; you can redistribute it and/or modify
@@ -22,7 +21,7 @@
 
 dd()
 {
-   if [ "$HOSTOS" == "Linux" ]
+   if [ "$HOSTOS" = "Linux" ]
    then	
 	command dd --help | grep noxfer > /dev/null 2>&1
 	
@@ -170,7 +169,7 @@ _mount_ops_filter()
     params="$*"
     
     #get mount point to handle dmapi mtpt option correctly
-    let last_index=$#-1
+    last_index=$(($# - 1))
     [ $last_index -gt 0 ] && shift $last_index
     FS_ESCAPED=$1
     
@@ -701,7 +700,7 @@ _require_user()
 {
     qa_user=fsgqa
     cat /etc/passwd | grep -q $qa_user
-    [ "$?" == "0" ] || _notrun "$qa_user user not defined."
+    [ "$?" = "0" ] || _notrun "$qa_user user not defined."
 }
 
 # check that xfs_io, glibc, kernel, and filesystem all (!) support
@@ -964,7 +963,7 @@ _udf_test_known_error_filter()
 
 _check_udf_filesystem()
 {
-    [ "$DISABLE_UDF_TEST" == "1" ] && return
+    [ "$DISABLE_UDF_TEST" = "1" ] && return
 
     if [ $# -ne 1 -a $# -ne 2 ]
     then
@@ -1193,9 +1192,9 @@ _link_out_file()
       exit
    fi
    rm -f $1
-   if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
+   if [ "`uname`" = "IRIX64" ] || [ "`uname`" = "IRIX" ]; then
       ln -s $1.irix $1
-   elif [ "`uname`" == "Linux" ]; then
+   elif [ "`uname`" = "Linux" ]; then
       ln -s $1.linux $1
    else
       echo Error test $seq does not run on the operating system: `uname`
@@ -1219,7 +1218,7 @@ _nfiles()
                 if [ $size -gt 0 ]; then
                     dd if=/dev/zero of=$file bs=1024 count=$size
                 fi
-		let f=$f+1
+		f=$((f + 1))
         done
 }
 
@@ -1233,7 +1232,7 @@ _descend()
         _nfiles $files           # files for this dir
 
         [ $depth -eq 0 ] && return
-	let deep=$depth-1 # go 1 down
+	deep=$((depth - 1))	# go 1 down
 
         [ $verbose = true ] && echo "descending, depth from leaves = $deep"
 
@@ -1241,7 +1240,7 @@ _descend()
         while [ $d -lt $dirs ]
         do
                 _descend d$d $deep &
-		let d=$d+1
+		d=$((d + 1))
                 wait
         done
 }
-- 
BOFH excuse #134:

because of network lag due to too many people playing deathmatch

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-03 10:30 [PATCH] remove bashisms from xfstests Christian Kujau
@ 2010-01-03 16:56 ` Andi Kleen
  2010-01-03 17:06   ` Michael Weissenbacher
  2010-01-04  7:27   ` Christian Kujau
  2010-01-06 16:48 ` Christoph Hellwig
  1 sibling, 2 replies; 9+ messages in thread
From: Andi Kleen @ 2010-01-03 16:56 UTC (permalink / raw)
  To: Christian Kujau; +Cc: xfs

Christian Kujau <lists@nerdbynature.de> writes:
>
> Thoughts?

The usual much easier and less riskier change is to just change the
first line in each script to #!/bin/bash

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-03 16:56 ` Andi Kleen
@ 2010-01-03 17:06   ` Michael Weissenbacher
  2010-01-04  7:27   ` Christian Kujau
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Weissenbacher @ 2010-01-03 17:06 UTC (permalink / raw)
  To: Andi Kleen; +Cc: xfs

>> Thoughts?
> 
> The usual much easier and less riskier change is to just change the
> first line in each script to #!/bin/bash
> 
Seconded, since there shouldn't be any linux distro around without /bin/bash 
installed.

(just IMHO of course)

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-03 16:56 ` Andi Kleen
  2010-01-03 17:06   ` Michael Weissenbacher
@ 2010-01-04  7:27   ` Christian Kujau
  2010-01-04  7:56     ` Christian Kujau
  1 sibling, 1 reply; 9+ messages in thread
From: Christian Kujau @ 2010-01-04  7:27 UTC (permalink / raw)
  To: Andi Kleen; +Cc: xfs

On Sun, 3 Jan 2010 at 17:56, Andi Kleen wrote:
> The usual much easier and less riskier change is to just change the
> first line in each script to #!/bin/bash

Hm, but it's less fun that way :-)

OK, here's one with only changing /bin/sh to /bin/bash, for all scripts 
carrying bashisms according to checkbashisms(1). With this patch applied, 
I can now run xfstests w/o changing my /bin/sh to something else.

Thanks,
Christian.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>

diff -Nrup xfstests.orig/005 xfstests/005
--- xfstests.orig/005	2010-01-03 23:03:27.977265001 -0800
+++ xfstests/005	2010-01-03 22:19:34.825575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 005
 #
 # Test symlinks & ELOOP
diff -Nrup xfstests.orig/007 xfstests/007
--- xfstests.orig/007	2010-01-03 23:03:27.987270001 -0800
+++ xfstests/007	2010-01-03 22:21:42.535575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 007
 #
 # drive the src/nametest program
diff -Nrup xfstests.orig/010 xfstests/010
--- xfstests.orig/010	2010-01-03 23:03:28.017285001 -0800
+++ xfstests/010	2010-01-03 22:28:35.308153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 010
 #
 # dbtest
diff -Nrup xfstests.orig/016 xfstests/016
--- xfstests.orig/016	2010-01-03 23:03:28.067310001 -0800
+++ xfstests/016	2010-01-03 22:21:32.755575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 016
 #
 # test end of log overwrite bug #796141
diff -Nrup xfstests.orig/020 xfstests/020
--- xfstests.orig/020	2010-01-03 23:03:28.097325001 -0800
+++ xfstests/020	2010-01-03 22:51:21.338153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 020
 #
 # extended attributes
diff -Nrup xfstests.orig/028 xfstests/028
--- xfstests.orig/028	2010-01-03 23:03:28.157355001 -0800
+++ xfstests/028	2010-01-03 22:51:29.958153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 028
 #
 # To test out xfsinvutil
diff -Nrup xfstests.orig/031 xfstests/031
--- xfstests.orig/031	2010-01-03 23:03:28.187370001 -0800
+++ xfstests/031	2010-01-03 22:51:43.908153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 031
 #
 # exercise xfs_repair - ensure repeated use doesn't corrupt
diff -Nrup xfstests.orig/043 xfstests/043
--- xfstests.orig/043	2010-01-03 23:03:28.277415001 -0800
+++ xfstests/043	2010-01-03 22:23:42.965575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 043
 #
 # Test out xfsdump/restore but rmv inventory prior to restore.
diff -Nrup xfstests.orig/044 xfstests/044
--- xfstests.orig/044	2010-01-03 23:03:28.287420001 -0800
+++ xfstests/044	2010-01-03 22:51:53.128153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 044
 #
 # external log uuid/format tests (TODO - version 2 log format)
diff -Nrup xfstests.orig/047 xfstests/047
--- xfstests.orig/047	2010-01-03 23:03:28.317435001 -0800
+++ xfstests/047	2010-01-03 22:52:06.758153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 047
 #
 # invutil with interactive responses
diff -Nrup xfstests.orig/050 xfstests/050
--- xfstests.orig/050	2010-01-03 23:03:28.337445001 -0800
+++ xfstests/050	2010-01-03 22:52:13.168153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 050
 #
 # Exercises basic XFS quota functionality
diff -Nrup xfstests.orig/051 xfstests/051
--- xfstests.orig/051	2010-01-03 23:03:28.347450001 -0800
+++ xfstests/051	2010-01-03 22:21:07.435575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 051
 #
 # Test out ACLs.
diff -Nrup xfstests.orig/053 xfstests/053
--- xfstests.orig/053	2010-01-03 23:03:28.367460001 -0800
+++ xfstests/053	2010-01-03 22:19:28.225575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 053
 #
 # xfs_repair breaks acls
diff -Nrup xfstests.orig/064 xfstests/064
--- xfstests.orig/064	2010-01-03 23:03:28.457505001 -0800
+++ xfstests/064	2010-01-03 22:18:56.425575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 064
 #
 # test multilevel dump and restores with hardlinks
diff -Nrup xfstests.orig/065 xfstests/065
--- xfstests.orig/065	2010-01-03 23:03:28.457505001 -0800
+++ xfstests/065	2010-01-03 22:20:08.665575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 065
 #
 # Testing incremental dumps and cumulative restores with
diff -Nrup xfstests.orig/067 xfstests/067
--- xfstests.orig/067	2010-01-03 23:03:28.477515001 -0800
+++ xfstests/067	2010-01-03 22:27:51.538325001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 067
 #
 # Test out acl/dacls which fit in shortform in the inode
diff -Nrup xfstests.orig/068 xfstests/068
--- xfstests.orig/068	2010-01-03 23:03:28.487520001 -0800
+++ xfstests/068	2010-01-03 22:52:31.798153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 068
 #
 # Test case to reproduce xfs_freeze hang under filsystem load.
diff -Nrup xfstests.orig/071 xfstests/071
--- xfstests.orig/071	2010-01-03 23:03:28.507530001 -0800
+++ xfstests/071	2010-01-03 22:52:39.198153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 071
 #
 # Exercise IO at large file offsets.
diff -Nrup xfstests.orig/074 xfstests/074
--- xfstests.orig/074	2010-01-03 23:03:28.537545001 -0800
+++ xfstests/074	2010-01-03 22:52:48.748153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 074
 #
 # fstest
diff -Nrup xfstests.orig/075 xfstests/075
--- xfstests.orig/075	2010-01-03 23:03:28.547550001 -0800
+++ xfstests/075	2010-01-03 22:19:23.145575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 075
 #
 # fsx (non-AIO variant)
diff -Nrup xfstests.orig/076 xfstests/076
--- xfstests.orig/076	2010-01-03 23:03:28.547550001 -0800
+++ xfstests/076	2010-01-03 22:53:01.758153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 076
 #
 # Test blockdev reads in parallel with filesystem reads/writes
diff -Nrup xfstests.orig/084 xfstests/084
--- xfstests.orig/084	2010-01-03 23:03:28.617585001 -0800
+++ xfstests/084	2010-01-03 22:19:08.795575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 084
 #
 # Exercises unwritten extent reads and writes, looking
diff -Nrup xfstests.orig/085 xfstests/085
--- xfstests.orig/085	2010-01-03 23:03:28.627590001 -0800
+++ xfstests/085	2010-01-03 22:53:11.388153000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 085
 #
 # To test log replay by shutdown of file system
diff -Nrup xfstests.orig/086 xfstests/086
--- xfstests.orig/086	2010-01-03 23:03:28.627590001 -0800
+++ xfstests/086	2010-01-03 22:19:45.175575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 086
 #
 # To test log replay with version 2 logs
diff -Nrup xfstests.orig/089 xfstests/089
--- xfstests.orig/089	2010-01-03 23:03:28.657605001 -0800
+++ xfstests/089	2010-01-03 22:53:23.799048001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 089
 #
 # Emulate the way Linux mount manipulates /etc/mtab to attempt to
diff -Nrup xfstests.orig/091 xfstests/091
--- xfstests.orig/091	2010-01-03 23:03:28.677615001 -0800
+++ xfstests/091	2010-01-03 22:53:32.133213001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 091
 #
 # fsx exercising direct IO -- sub-block sizes and concurrent buffered IO
diff -Nrup xfstests.orig/097 xfstests/097
--- xfstests.orig/097	2010-01-03 23:03:28.717635001 -0800
+++ xfstests/097	2010-01-03 22:19:53.435575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 097. Modifed from UDFQA test 033.
 #
 # simple attr tests for EAs:
diff -Nrup xfstests.orig/099 xfstests/099
--- xfstests.orig/099	2010-01-03 23:03:28.737645001 -0800
+++ xfstests/099	2010-01-03 22:23:16.295575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 099. Modified from UDFQA test 036.
 #
 # ACL test
diff -Nrup xfstests.orig/100 xfstests/100
--- xfstests.orig/100	2010-01-03 23:03:28.747650001 -0800
+++ xfstests/100	2010-01-03 22:53:50.292288001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 100. Modified from UDF QA test 030.
 #
 # Test whether a tarred directory structure can be untarred onto
diff -Nrup xfstests.orig/105 xfstests/105
--- xfstests.orig/105	2010-01-03 23:03:28.787670001 -0800
+++ xfstests/105	2010-01-03 22:53:58.046163001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 105
 #
 # Test fix of bug:
diff -Nrup xfstests.orig/108 xfstests/108
--- xfstests.orig/108	2010-01-03 23:03:28.807680001 -0800
+++ xfstests/108	2010-01-03 22:54:07.030653001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 108
 #
 # Simple quota accounting test for direct/buffered/mmap IO.
diff -Nrup xfstests.orig/109 xfstests/109
--- xfstests.orig/109	2010-01-03 23:03:28.817685001 -0800
+++ xfstests/109	2010-01-03 22:54:15.604938001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 109
 #
 # ENOSPC deadlock case from Asano Masahiro.
diff -Nrup xfstests.orig/110 xfstests/110
--- xfstests.orig/110	2010-01-03 23:03:28.827690001 -0800
+++ xfstests/110	2010-01-03 22:21:15.615575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 110
 #
 # Incorrect dir2 freetab warning case from Masanori Tsuda.
diff -Nrup xfstests.orig/111 xfstests/111
--- xfstests.orig/111	2010-01-03 23:03:28.837695001 -0800
+++ xfstests/111	2010-01-03 22:20:59.015575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 111
 #
 # Infinite xfs_bulkstat bad-inode loop case from Roger Willcocks.
diff -Nrup xfstests.orig/112 xfstests/112
--- xfstests.orig/112	2010-01-03 23:03:28.847700001 -0800
+++ xfstests/112	2010-01-03 22:21:38.345575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 112
 #
 # fsx (AIO variant, based on 075)
diff -Nrup xfstests.orig/113 xfstests/113
--- xfstests.orig/113	2010-01-03 23:03:28.847700001 -0800
+++ xfstests/113	2010-01-03 22:54:30.972618001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 113
 #
 # aio-stress
diff -Nrup xfstests.orig/114 xfstests/114
--- xfstests.orig/114	2010-01-03 23:03:28.857705001 -0800
+++ xfstests/114	2010-01-03 22:54:38.706483001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 114
 #
 # Test some parent ptr stuff
diff -Nrup xfstests.orig/117 xfstests/117
--- xfstests.orig/117	2010-01-03 23:03:28.887720001 -0800
+++ xfstests/117	2010-01-03 22:54:46.380318001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 117
 #
 # Attempt to cause filesystem corruption with serial fsstresses doing
diff -Nrup xfstests.orig/118 xfstests/118
--- xfstests.orig/118	2010-01-03 23:03:28.897725001 -0800
+++ xfstests/118	2010-01-03 22:54:54.974613001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 118
 #
 # To test out pv#940675 crash in xfs_trans_brelse + quotas
diff -Nrup xfstests.orig/119 xfstests/119
--- xfstests.orig/119	2010-01-03 23:03:28.907730001 -0800
+++ xfstests/119	2010-01-03 22:55:05.629938001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 119
 #
 # Leaking reservation space in the GRH
diff -Nrup xfstests.orig/122 xfstests/122
--- xfstests.orig/122	2010-01-03 23:03:28.927740001 -0800
+++ xfstests/122	2010-01-03 22:55:29.822028001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 122
 #
 # pv#952498
diff -Nrup xfstests.orig/123 xfstests/123
--- xfstests.orig/123	2010-01-03 23:03:28.937745001 -0800
+++ xfstests/123	2010-01-03 22:55:42.188208001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 123
 #
 # Make sure user cannot overwrite, append, delete or move a file created by 
diff -Nrup xfstests.orig/124 xfstests/124
--- xfstests.orig/124	2010-01-03 23:03:28.947750001 -0800
+++ xfstests/124	2010-01-03 22:55:47.270748001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 124
 #
 # Test preallocated_rw_pattern_test modified from CXFSQA test preallocated_rw_pattern_test
diff -Nrup xfstests.orig/134 xfstests/134
--- xfstests.orig/134	2010-01-03 23:03:29.027790001 -0800
+++ xfstests/134	2010-01-03 22:55:56.015118001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 134
 #
 # test to reproduce PV951636:
diff -Nrup xfstests.orig/136 xfstests/136
--- xfstests.orig/136	2010-01-03 23:03:29.037795001 -0800
+++ xfstests/136	2010-01-03 22:56:06.480348001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 136
 #
 # Test the attr2 code
diff -Nrup xfstests.orig/137 xfstests/137
--- xfstests.orig/137	2010-01-03 23:03:29.047800001 -0800
+++ xfstests/137	2010-01-03 22:20:52.045575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 137
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/138 xfstests/138
--- xfstests.orig/138	2010-01-03 23:03:29.057805001 -0800
+++ xfstests/138	2010-01-03 22:23:54.535575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 138
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/139 xfstests/139
--- xfstests.orig/139	2010-01-03 23:03:29.067810001 -0800
+++ xfstests/139	2010-01-03 22:23:48.345575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 139
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/140 xfstests/140
--- xfstests.orig/140	2010-01-03 23:03:29.077815001 -0800
+++ xfstests/140	2010-01-03 22:56:17.856033001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 140
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/149 xfstests/149
--- xfstests.orig/149	2010-01-03 23:03:29.147850001 -0800
+++ xfstests/149	2010-01-03 22:56:33.453828001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 149
 #
 # Exercise xfs_prepair - ensure repeated use doesn't corrupt
diff -Nrup xfstests.orig/158 xfstests/158
--- xfstests.orig/158	2010-01-03 23:03:29.217885001 -0800
+++ xfstests/158	2010-01-03 22:56:45.079638001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 158
 #
 # get/set file attributes
diff -Nrup xfstests.orig/165 xfstests/165
--- xfstests.orig/165	2010-01-03 23:03:29.277915001 -0800
+++ xfstests/165	2010-01-03 22:56:54.704448001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 165
 #
 # Test out prealloc, direct writes and buffered read
diff -Nrup xfstests.orig/178 xfstests/178
--- xfstests.orig/178	2010-01-03 23:03:29.387970001 -0800
+++ xfstests/178	2010-01-03 22:19:15.625575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 178
 #
 # Reproduce PV#:967665
diff -Nrup xfstests.orig/179 xfstests/179
--- xfstests.orig/179	2010-01-03 23:03:29.397975001 -0800
+++ xfstests/179	2010-01-03 22:21:22.735575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 179
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/180 xfstests/180
--- xfstests.orig/180	2010-01-03 23:03:29.397975001 -0800
+++ xfstests/180	2010-01-03 22:57:06.130158001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 180
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/182 xfstests/182
--- xfstests.orig/182	2010-01-03 23:03:29.417985001 -0800
+++ xfstests/182	2010-01-03 22:20:02.055575000 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 182
 #
 # Test for NULL files problem
diff -Nrup xfstests.orig/190 xfstests/190
--- xfstests.orig/190	2010-01-03 23:03:29.478015001 -0800
+++ xfstests/190	2010-01-03 22:57:13.493838001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FSQA Test No. 190
 #
 # This test uses xfs_io to unreserve space in a file at various different
diff -Nrup xfstests.orig/200 xfstests/200
--- xfstests.orig/200	2010-01-03 23:03:29.568060001 -0800
+++ xfstests/200	2010-01-03 22:57:22.268223001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 200
 #
 # Check out various mount/remount/unmount scenarious on a read-only blockdev.
diff -Nrup xfstests.orig/203 xfstests/203
--- xfstests.orig/203	2010-01-03 23:03:29.588070001 -0800
+++ xfstests/203	2010-01-03 22:57:30.112143001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 203
 #
 # Test out reallocation of the extent array in xfs_io.
diff -Nrup xfstests.orig/205 xfstests/205
--- xfstests.orig/205	2010-01-03 23:03:29.608080001 -0800
+++ xfstests/205	2010-01-03 22:57:36.685428001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 205
 #
 # Test out ENOSPC flushing on small filesystems.
diff -Nrup xfstests.orig/213 xfstests/213
--- xfstests.orig/213	2010-01-03 23:03:29.678115001 -0800
+++ xfstests/213	2010-01-03 22:57:46.330248001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 213
 #
 # Check some unwritten extent boundary conditions, fallocate version.
diff -Nrup xfstests.orig/215 xfstests/215
--- xfstests.orig/215	2010-01-03 23:03:29.688120001 -0800
+++ xfstests/215	2010-01-03 22:57:52.063113001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 215
 #
 # Test out c/mtime updates after mapped writes.
diff -Nrup xfstests.orig/218 xfstests/218
--- xfstests.orig/218	2010-01-03 23:03:29.718135001 -0800
+++ xfstests/218	2010-01-03 22:58:00.757458001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 218
 #
 # Basic defragmentation sanity tests
diff -Nrup xfstests.orig/219 xfstests/219
--- xfstests.orig/219	2010-01-03 23:03:29.718135001 -0800
+++ xfstests/219	2010-01-03 22:58:09.541848001 -0800
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 # FS QA Test No. 219
 #
 # Simple quota accounting test for direct/buffered/mmap IO.
diff -Nrup xfstests.orig/check xfstests/check
--- xfstests.orig/check	2010-01-03 23:03:27.917235001 -0800
+++ xfstests/check	2010-01-03 23:19:32.149110001 -0800
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Control script for QA
 #

-- 
BOFH excuse #36:

dynamic software linking table corrupted

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-04  7:27   ` Christian Kujau
@ 2010-01-04  7:56     ` Christian Kujau
  2010-01-15  7:19       ` Dave Chinner
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Kujau @ 2010-01-04  7:56 UTC (permalink / raw)
  To: Andi Kleen; +Cc: xfs

On Sun, 3 Jan 2010 at 23:27, Christian Kujau wrote:
> OK, here's one with only changing /bin/sh to /bin/bash, for all scripts 
> carrying bashisms according to checkbashisms(1). With this patch applied, 
> I can now run xfstests w/o changing my /bin/sh to something else.

Well, almost - I'm still getting errors, because some of the scripts are 
not executed but sourced. Although the ./check script is /bin/bash now, 
the sourced scripts seem to get executed via /bin/sh, at least that's what 
I've experienced. Here's an additional patch, changing only the common.* 
scripts, for they are being sourced. Right now xfstests is running test 
013 and no errors so far.

Christian.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>

diff -Nrup xfstests.orig/common xfstests/common
--- xfstests.orig/common	2010-01-03 23:03:32.029290001 -0800
+++ xfstests/common	2010-01-03 23:36:04.722433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh 
 #
 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -45,7 +44,7 @@ randomize=false
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
 # Autodetect fs type based on what's on $TEST_DEV
-if [ "$HOSTOS" == "Linux" ]
+if [ "$HOSTOS" = "Linux" ]
 then
     export FSTYP=`blkid -s TYPE -o value $TEST_DEV`
 else
diff -Nrup xfstests.orig/common.attr xfstests/common.attr
--- xfstests.orig/common.attr	2010-01-03 23:03:32.039295001 -0800
+++ xfstests/common.attr	2010-01-03 23:36:27.602433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #-----------------------------------------------------------------------
 #  Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
 #  This program is free software; you can redistribute it and/or modify
@@ -77,11 +76,11 @@ _acl_list()
 #
 _create_n_aces()
 {
-    let n=$1-4
+    n=$(($1 - 4))
     acl='u::rwx,g::rwx,o::rwx,m::rwx' # 4 ace acl start
     while [ $n -ne 0 ]; do
 	acl="$acl,u:$n:rwx"
-	let n=$n-1
+	n=$((n - 1))
     done
     echo $acl
 }
diff -Nrup xfstests.orig/common.bonnie xfstests/common.bonnie
--- xfstests.orig/common.bonnie	2010-01-03 23:03:32.049300001 -0800
+++ xfstests/common.bonnie	2010-01-03 23:36:48.682433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2002-2004 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -17,7 +16,7 @@
 #
 
 #check bonnie is installed
-if [ "`whereis bonnie++`" == "bonnie++:"]; then
+if [ "`whereis bonnie++`" = "bonnie++:"]; then
         echo $0 error bonnie not installed.
         exit
 fi
diff -Nrup xfstests.orig/common.config xfstests/common.config
--- xfstests.orig/common.config	2010-01-03 23:03:32.059305001 -0800
+++ xfstests/common.config	2010-01-03 23:33:46.432433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
 #
diff -Nrup xfstests.orig/common.dbench xfstests/common.dbench
--- xfstests.orig/common.dbench	2010-01-03 23:03:32.059305001 -0800
+++ xfstests/common.dbench	2010-01-03 23:37:14.602433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2002-2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -17,7 +16,7 @@
 #
 
 #check dbench is installed
-if [ "`whereis dbench`" == "dbench:"]; then
+if [ "`whereis dbench`" = "dbench:"]; then
         echo $0 error dbench not installed.
         exit
 fi
diff -Nrup xfstests.orig/common.defrag xfstests/common.defrag
--- xfstests.orig/common.defrag	2010-01-03 23:03:32.079315001 -0800
+++ xfstests/common.defrag	2010-01-03 23:33:49.662433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2009 Eric Sandeen
 # All Rights Reserved.
diff -Nrup xfstests.orig/common.dmapi xfstests/common.dmapi
--- xfstests.orig/common.dmapi	2010-01-03 23:03:32.079315001 -0800
+++ xfstests/common.dmapi	2010-01-03 23:33:51.212433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
 #
diff -Nrup xfstests.orig/common.dump xfstests/common.dump
--- xfstests.orig/common.dump	2010-01-03 23:03:32.099325001 -0800
+++ xfstests/common.dump	2010-01-03 23:38:42.102433002 -0800
@@ -1,4 +1,3 @@
-#/bin/sh
 #
 # Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -111,7 +110,7 @@ _check_onl()
 	else
 	    sleep 1
 	fi
-	let i=$i+1
+	i=$((i + 1))
     done
 
 
@@ -149,7 +148,7 @@ _wait_tape()
 	else
 	    sleep 1
 	fi
-	let i=$i+1
+	i=$((i + 1))
     done
 }
 
@@ -208,7 +207,7 @@ _require_tape()
 {
     dumptape=$1
 
-    if [ -z "$dumptape" -o "@" == "$dumptape" ]; then
+    if [ -z "$dumptape" -o "@" = "$dumptape" ]; then
         echo "This test requires a dump tape - none was specified"
 	echo "No dump tape specified" >$seq.notrun
 	status=$NOTRUNSTS
@@ -701,7 +700,7 @@ _create_hardlinks()
 	_hardlink=$_fname$_suffix
 	echo "creating hardlink $_hardlink to $_fname"
 	ln $_fname $_hardlink
-	let _j=$_j+1
+	_j=$((_j + 1))
     done
 }
 
@@ -717,7 +716,7 @@ _create_hardset()
     _i=1
     while [ $_i -le $_numsets ]; do
 	_create_hardlinks file$_i 5
-	let _i=$_i+1
+	_i=$((_i + 1))
     done
 }
 
@@ -993,7 +992,7 @@ _do_dump_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i -M $media_label.$i"
-	let i=$i+1
+	i=$((i + 1))
     done
 
     echo "Dumping to files..."
@@ -1113,7 +1112,7 @@ _do_restore_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i"
-	let i=$i+1
+	i=$((i + 1))
     done
 
     echo "Restoring from file..."
@@ -1384,7 +1383,7 @@ _check_quota_entries()
 #
 _check_quota_dumprestore()
 {
-    if [ "$HOSTOS" == "IRIX" ]; then
+    if [ "$HOSTOS" = "IRIX" ]; then
 	_check_quota 'user quota information' \
 		     'group quota information' \
 		     'project quota information' | \
diff -Nrup xfstests.orig/common.filestreams xfstests/common.filestreams
--- xfstests.orig/common.filestreams	2010-01-03 23:03:32.109330001 -0800
+++ xfstests/common.filestreams	2010-01-03 23:39:04.502433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -24,7 +23,7 @@ _check_filestreams_support()
 	local irix_timeout_sysvar="xfs_mfstream_timeout"
 	local linux_timeout_procvar="/proc/sys/fs/xfs/filestream_centisecs"
 	local streams_avail=""
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		# check for the filestreams timeout systune variable in irix
 		streams_avail=`systune $irix_timeout_sysvar 2>&1 |
 			perl -ne 'if (/'$irix_timeout_sysvar'\s+=\s+\d+/) {print "true"}'`
@@ -33,7 +32,7 @@ _check_filestreams_support()
 		[ -f $linux_timeout_procvar ] && streams_avail="true"
 	fi
 
-	if [ "$streams_avail" == "true" ]; then
+	if [ "$streams_avail" = "true" ]; then
 		return 0
 	else
 		return 1
@@ -45,7 +44,7 @@ _set_stream_timeout_centisecs()
 	local new_timeout_csecs=$1
 	local irix_timeout_sysvar="xfs_mfstream_timeout"
 	local linux_timeout_procvar="/proc/sys/fs/xfs/filestream_centisecs"
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		echo y | systune -r $irix_timeout_sysvar $new_timeout_csecs >/dev/null
 	else
 		echo $new_timeout_csecs > $linux_timeout_procvar
@@ -70,7 +69,7 @@ _do_stream()
 	cd $directory_name
 
 	local dd_cmd=""
-	if [ "$HOSTOS" == "IRIX" ]; then
+	if [ "$HOSTOS" = "IRIX" ]; then
 		# for irix use lmdd
 		dd_cmd="lmdd"
 		[ "$dio" = "1" ] && dd_cmd="$dd_cmd odirect=1"
@@ -114,7 +113,7 @@ _check_for_dupes()
         local this_num_two
         for this_num_one in $num_str_one; do
                 for this_num_two in $num_str_two; do
-                        if [ "$this_num_one" == "$this_num_two" ]; then
+                        if [ "$this_num_one" = "$this_num_two" ]; then
 				echo "duplicate AG $this_num_one found" \
 					>> $here/$seq.full
 				return 1
@@ -140,7 +139,7 @@ _test_streams() {
 	_scratch_mkfs_xfs -dsize=$size,agcount=$agcount >/dev/null 2>&1 \
 		|| _fail "mkfs failed"
 
-	if [ "$use_iflag" = "0" -o "$HOSTOS" == "IRIX" ]; then
+	if [ "$use_iflag" = "0" -o "$HOSTOS" = "IRIX" ]; then
 		# mount using filestreams mount option
 		_scratch_mount "-o filestreams" \
 			|| _fail "filestreams mount failed"
diff -Nrup xfstests.orig/common.filter xfstests/common.filter
--- xfstests.orig/common.filter	2010-01-03 23:03:32.119335001 -0800
+++ xfstests/common.filter	2010-01-03 23:33:56.372433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
 #
diff -Nrup xfstests.orig/common.log xfstests/common.log
--- xfstests.orig/common.log	2010-01-03 23:03:32.119335001 -0800
+++ xfstests/common.log	2010-01-03 23:44:11.282433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -314,8 +313,12 @@ _create_log()
     # generate some log traffic - but not too much - life gets a little
     # more complicated if the log wraps around. This traffic is
     # pretty much arbitary, but could probably be made better than this.
-    touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
-	
+    i=1
+    while [ $i -le 100 ]; do
+    	touch $SCRATCH_MNT/$i
+	i=$((i + 1))
+    done
+
     # unmount the FS
     _full "umount"
     umount $SCRATCH_DEV >>$seq.full 2>&1
@@ -342,9 +345,11 @@ _create_log_sync()
 
     # generate some log traffic - but not too much
     # add some syncs to get the log flushed to disk 
-    for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
-	touch $file
+    i=1
+    while [ $i -le 100 ]; do
+    	touch $SCRATCH_MNT/$i
 	sync
+	i=$((i + 1))
     done
 
     # unmount the FS
diff -Nrup xfstests.orig/common.metaperf xfstests/common.metaperf
--- xfstests.orig/common.metaperf	2010-01-03 23:03:32.129340001 -0800
+++ xfstests/common.metaperf	2010-01-03 23:33:59.432433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
diff -Nrup xfstests.orig/common.punch xfstests/common.punch
--- xfstests.orig/common.punch	2010-01-03 23:03:32.139345001 -0800
+++ xfstests/common.punch	2010-01-03 23:39:55.132433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -40,7 +39,7 @@ _spawn_test_file() {
 	-c "extsize" \
 	$test_file
 
-	if [ "$reserve_space" == "noresv" ]; then
+	if [ "$reserve_space" = "noresv" ]; then
 		echo "+ not using resvsp at file creation"
 		$XFS_IO_PROG -f \
 		-c "truncate $file_size" \
@@ -62,13 +61,13 @@ _do_punch() {
 	local punch_type=$4		# u for unresvsp, d for dm_punch
 	local test_file=$5
 
-	if [ "$punch_type" == "u" ]; then
+	if [ "$punch_type" = "u" ]; then
 		echo "+ hole punch using unresvsp"
 		$XFS_IO_PROG -f \
 		-c "unresvsp $punch_offset $punch_size" \
 		$test_file
 	fi
-	if [ "$punch_type" == "d" ]; then
+	if [ "$punch_type" = "d" ]; then
 		echo "+ hole punch using dmapi punch_hole"
 		${DMAPI_QASUITE1_DIR}cmd/punch_hole -o $punch_offset -l $punch_size \
 			${SCRATCH_MNT}/$test_file
@@ -123,7 +122,7 @@ _test_punch() {
 	local this_punch_type=""
 	local dmap_punch_used=0
 	for this_punch_type in "${punch_types[@]}"; do
-		[ "$this_punch_type" == "d" ] && dmap_punch_used=1
+		[ "$this_punch_type" = "d" ] && dmap_punch_used=1
 	done
 	if [ $dmap_punch_used -ne 0 ]; then
 		# a punch type of dm_punch has been specified, do a dmapi mount
@@ -161,13 +160,13 @@ _test_punch() {
 	local punch_index=0
 	local write_index=0
 	for operation in "${punch_write_order[@]}"; do
-		if [ "$operation" == "p" ]; then
+		if [ "$operation" = "p" ]; then
 			_do_punch $blksize ${punch_points_blks[$punch_index]} \
 				${punch_sizes_blks[$punch_index]} ${punch_types[$punch_index]} \
 				$filename
 			punch_index=`expr $punch_index + 1`
 		fi
-		if [ "$operation" == "w" ]; then
+		if [ "$operation" = "w" ]; then
 			_do_write $blksize ${write_points_blks[$write_index]} \
 				${write_sizes_blks[$write_index]} $filename
 			write_index=`expr $write_index + 1`
diff -Nrup xfstests.orig/common.quota xfstests/common.quota
--- xfstests.orig/common.quota	2010-01-03 23:03:32.149350001 -0800
+++ xfstests/common.quota	2010-01-03 23:40:10.632433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
 # All Rights Reserved.
@@ -117,7 +116,7 @@ _choose_gid()
 
 _choose_prid()
 {
-    if [ "X$projid_file" == "X" ]; then
+    if [ "X$projid_file" = "X" ]; then
 	projid_file=/etc/projid
     fi
     if [ ! -f $projid_file ]; then
diff -Nrup xfstests.orig/common.rc xfstests/common.rc
--- xfstests.orig/common.rc	2010-01-03 23:03:32.159355001 -0800
+++ xfstests/common.rc	2010-01-03 23:41:30.712433002 -0800
@@ -1,5 +1,4 @@
-##/bin/sh
-#-----------------------------------------------------------------------
+#
 #  Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -18,11 +17,11 @@
 #
 #  Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
 #  Mountain View, CA 94043, USA, or: http://www.sgi.com
-#-----------------------------------------------------------------------
+#
 
 dd()
 {
-   if [ "$HOSTOS" == "Linux" ]
+   if [ "$HOSTOS" = "Linux" ]
    then	
 	command dd --help | grep noxfer > /dev/null 2>&1
 	
@@ -186,7 +185,7 @@ _mount_ops_filter()
     params="$*"
     
     #get mount point to handle dmapi mtpt option correctly
-    let last_index=$#-1
+    last_index=$(($# - 1))
     [ $last_index -gt 0 ] && shift $last_index
     FS_ESCAPED=$1
     
@@ -409,7 +408,7 @@ _df_device()
     fi
 
     $DF_PROG 2>/dev/null | $AWK_PROG -v what=$1 '
-        match($1,what) && NF==1 {
+        match($1,what) && NF == 1 {
             v=$1
             getline
             print v, $0
@@ -439,7 +438,7 @@ _df_dir()
     fi
 
     $DF_PROG $1 2>/dev/null | $AWK_PROG -v what=$1 '
-        NR == 2 && NF==1 {
+        NR == 2 && NF == 1 {
             v=$1
             getline
             print v, $0;
@@ -720,7 +719,7 @@ _require_user()
 {
     qa_user=fsgqa
     cat /etc/passwd | grep -q $qa_user
-    [ "$?" == "0" ] || _notrun "$qa_user user not defined."
+    [ "$?" = "0" ] || _notrun "$qa_user user not defined."
 }
 
 # check that xfs_io, glibc, kernel, and filesystem all (!) support
@@ -983,7 +982,7 @@ _udf_test_known_error_filter()
 
 _check_udf_filesystem()
 {
-    [ "$DISABLE_UDF_TEST" == "1" ] && return
+    [ "$DISABLE_UDF_TEST" = "1" ] && return
 
     if [ $# -ne 1 -a $# -ne 2 ]
     then
@@ -1212,9 +1211,9 @@ _link_out_file()
       exit
    fi
    rm -f $1
-   if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
+   if [ "`uname`" = "IRIX64" ] || [ "`uname`" = "IRIX" ]; then
       ln -s $1.irix $1
-   elif [ "`uname`" == "Linux" ]; then
+   elif [ "`uname`" = "Linux" ]; then
       ln -s $1.linux $1
    else
       echo Error test $seq does not run on the operating system: `uname`
@@ -1238,7 +1237,7 @@ _nfiles()
                 if [ $size -gt 0 ]; then
                     dd if=/dev/zero of=$file bs=1024 count=$size
                 fi
-		let f=$f+1
+		f=$((f + 1))
         done
 }
 
@@ -1252,7 +1251,7 @@ _descend()
         _nfiles $files           # files for this dir
 
         [ $depth -eq 0 ] && return
-	let deep=$depth-1 # go 1 down
+	deep=$((depth - 1))	# go 1 down
 
         [ $verbose = true ] && echo "descending, depth from leaves = $deep"
 
@@ -1260,7 +1259,7 @@ _descend()
         while [ $d -lt $dirs ]
         do
                 _descend d$d $deep &
-		let d=$d+1
+		d=$((d + 1))
                 wait
         done
 }
diff -Nrup xfstests.orig/common.repair xfstests/common.repair
--- xfstests.orig/common.repair	2010-01-03 23:03:32.169360001 -0800
+++ xfstests/common.repair	2010-01-03 23:34:06.322433002 -0800
@@ -1,4 +1,3 @@
-##/bin/sh
 #
 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
 #
-- 
BOFH excuse #306:

CPU-angle has to be adjusted because of vibrations coming from the nearby road

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-03 10:30 [PATCH] remove bashisms from xfstests Christian Kujau
  2010-01-03 16:56 ` Andi Kleen
@ 2010-01-06 16:48 ` Christoph Hellwig
  2010-01-06 19:24   ` Christian Kujau
  1 sibling, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2010-01-06 16:48 UTC (permalink / raw)
  To: Christian Kujau; +Cc: xfs

On Sun, Jan 03, 2010 at 02:30:05AM -0800, Christian Kujau wrote:
> While trying to run xfstests, I encountered several errors due to the fact 
> that my /bin/sh is not linked to /bin/bash but to dash(1), which can be 
> made the default /bin/sh in Debian based systems. The patch below is 
> rather large and is touching many files, but it's pretty straightfoward:
> 
> 1) convert brace expansions (e.g. "rm -f symlink_{0,1,2,3}")

I'll comment on these in detail below.

> 2) convert "let..." into something (hopefully) more portable

Dave converted these away from expr due to performance reasons.  I'd
like too see a prove that performance hasn't regressed due to this
change.

> 3) replace 'a == b' with 'a = b' in bourne shell scripts

This looks fine.  If you want feel free to submit these as a separate
first patch so that we have the large pile sorted out.

> -    rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
> +    rm -f symlink_* empty_file

This kind of replacement looks fine.


> -for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
> +f=1
> +while [ $f -le 40 ]
>  do
> -    ln -s $o $f
> +    ln -s $o symlink_$f
>      o=$f
> +    o=symlink_$f
> +    f=$((f + 1))
>  done

I fear this might cause some overhead in the shell.  What about the
following instead:

for i in `seq 0 39`; do
    ln -s $o symlink_$i
    o=symlink_$i
done

Same applies to similar subsitutions.

> diff -Nrup xfstests.orig/032 xfstests/032
> --- xfstests.orig/032	2010-01-03 00:42:16.601617592 -0800
> +++ xfstests/032	2010-01-03 00:43:56.321617592 -0800
> @@ -66,6 +66,7 @@ do
>  	[ $fs = ext3 ] && preargs="-F"
>  	[ $fs = ext4 ] && preargs="-F"
>  	[ $fs = ext4dev ] && preargs="-F"
> +	[ $fs = nilfs2 ] && preargs="-q"

This hunk is unrelated.  Please submit it with a trivial one-liner
description and a signed-off-by line and I'll put it in.

> -echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
> +printf "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console

This looks okay, but should be mentioned in the patch description.

>  echo "=== Recursive change ACL ==="
>  rm -fr root
> -mkdir root
> -pushd root >/dev/null
>  # create an arbitrary little tree
>  for i in 1 2 3 4 5 6 7 8 9 0
>  do
> -	mkdir -p a/$i
> -	mkdir -p b/c$i/$i
> -	touch a/$i/mumble
> +	mkdir -p root/a/$i
> +	mkdir -p root/b/c$i/$i
> +	touch root/a/$i/mumble
>  done
> -popd >/dev/null

Same here.

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-06 16:48 ` Christoph Hellwig
@ 2010-01-06 19:24   ` Christian Kujau
  2010-01-06 22:36     ` Dave Chinner
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Kujau @ 2010-01-06 19:24 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Wed, 6 Jan 2010 at 11:48, Christoph Hellwig wrote:
> > 2) convert "let..." into something (hopefully) more portable
> 
> Dave converted these away from expr due to performance reasons.  I'd
> like too see a prove that performance hasn't regressed due to this
> change.

That's why I hesitated to just change all scripts to /bin/bash, but didn't 
dare to say so, because of the inevitable "but today's computers are fast 
enough" reactions :-)

> > 3) replace 'a == b' with 'a = b' in bourne shell scripts
> 
> This looks fine.  If you want feel free to submit these as a separate
> first patch so that we have the large pile sorted out.

OK, will do.

> I fear this might cause some overhead in the shell.  What about the
> following instead:
> 
> for i in `seq 0 39`; do
>     ln -s $o symlink_$i
>     o=symlink_$i
> done

I didn't go for seq(1), as I feared this wouldn't be available on every 
machine. Given that the xfstests scripts have a lot of "what if we're 
running on IRIX" conditions, I just wasn't sure if seq(1) would be 
available there. But yes, I'd much rather like to do this with seq(1) as 
well, if this is OK to everybody.

> > --- xfstests.orig/032	2010-01-03 00:42:16.601617592 -0800
> > +++ xfstests/032	2010-01-03 00:43:56.321617592 -0800
> > @@ -66,6 +66,7 @@ do
> >  	[ $fs = ext3 ] && preargs="-F"
> >  	[ $fs = ext4 ] && preargs="-F"
> >  	[ $fs = ext4dev ] && preargs="-F"
> > +	[ $fs = nilfs2 ] && preargs="-q"
> 
> This hunk is unrelated.  Please submit it with a trivial one-liner
> description and a signed-off-by line and I'll put it in.

OK, will do.

> > -echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
> > +printf "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
> 
> This looks okay, but should be mentioned in the patch description.

Will do. It's needed, because sh(1)'s echo builtin doesn't know about -e. 

> >  done
> > -popd >/dev/null
> 
> Same here.

Will do. Standard sh(1) doesn't know popd/pushd either.

Thanks Christoph!


Christian.
-- 
BOFH excuse #398:

Data for intranet got routed through the extranet and landed on the internet.

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

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

* Re: [PATCH] remove bashisms from xfstests
  2010-01-06 19:24   ` Christian Kujau
@ 2010-01-06 22:36     ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2010-01-06 22:36 UTC (permalink / raw)
  To: Christian Kujau; +Cc: Christoph Hellwig, xfs

On Wed, Jan 06, 2010 at 11:24:10AM -0800, Christian Kujau wrote:
> On Wed, 6 Jan 2010 at 11:48, Christoph Hellwig wrote:
> > > 2) convert "let..." into something (hopefully) more portable
> > 
> > Dave converted these away from expr due to performance reasons.  I'd
> > like too see a prove that performance hasn't regressed due to this
> > change.
> 
> That's why I hesitated to just change all scripts to /bin/bash, but didn't 
> dare to say so, because of the inevitable "but today's computers are fast 
> enough" reactions :-)

FYI - the problem I came across was to do with running xfsqa under UML,
where forking a new process is an expensive operation (I measured it
at about 300ms) and so using bash built-in expressions for
incrementing variables is a major win in terms of test run time.
IIRC, one test loops 100,000 times and the runtime went from half an
hour to 10s just by using "let n=n+1" instead of expr...

> 
> > > 3) replace 'a == b' with 'a = b' in bourne shell scripts
> > 
> > This looks fine.  If you want feel free to submit these as a separate
> > first patch so that we have the large pile sorted out.
> 
> OK, will do.
> 
> > I fear this might cause some overhead in the shell.  What about the
> > following instead:
> > 
> > for i in `seq 0 39`; do
> >     ln -s $o symlink_$i
> >     o=symlink_$i
> > done
> 
> I didn't go for seq(1), as I feared this wouldn't be available on every 
> machine.

seq(1) is already used in several tests, so it is ok to use in
more. :)

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] 9+ messages in thread

* Re: [PATCH] remove bashisms from xfstests
  2010-01-04  7:56     ` Christian Kujau
@ 2010-01-15  7:19       ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2010-01-15  7:19 UTC (permalink / raw)
  To: Christian Kujau; +Cc: Andi Kleen, xfs

On Sun, Jan 03, 2010 at 11:56:45PM -0800, Christian Kujau wrote:
> On Sun, 3 Jan 2010 at 23:27, Christian Kujau wrote:
> > OK, here's one with only changing /bin/sh to /bin/bash, for all scripts 
> > carrying bashisms according to checkbashisms(1). With this patch applied, 
> > I can now run xfstests w/o changing my /bin/sh to something else.
> 
> Well, almost - I'm still getting errors, because some of the scripts are 
> not executed but sourced. Although the ./check script is /bin/bash now, 
> the sourced scripts seem to get executed via /bin/sh, at least that's what 
> I've experienced. Here's an additional patch, changing only the common.* 
> scripts, for they are being sourced. Right now xfstests is running test 
> 013 and no errors so far.

Even with this patch I notice that 005 fails, 007 hangs, mkfs fails in
015 and 016 because of some kind of parameter passing problem
fail, and and all of these work by specifying /bin/bash rather than
/bin/sh.

I haven't got any further than this - it's painfully slow having to
test them one at a time because I'm getting lots of failures since
upgrading my test box from xfsprogs 3.0.4 to 3.1.0 this morning as
well as to the latest debian unstable.

Right now, considering the apparent widespread dependency on bash in
these test scripts, I'm proposing that we just change every single
test to run /bin/bash and hence avoid all these problems without
needing extra changes to the tests.

Comments?

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] 9+ messages in thread

end of thread, other threads:[~2010-01-15  7:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 10:30 [PATCH] remove bashisms from xfstests Christian Kujau
2010-01-03 16:56 ` Andi Kleen
2010-01-03 17:06   ` Michael Weissenbacher
2010-01-04  7:27   ` Christian Kujau
2010-01-04  7:56     ` Christian Kujau
2010-01-15  7:19       ` Dave Chinner
2010-01-06 16:48 ` Christoph Hellwig
2010-01-06 19:24   ` Christian Kujau
2010-01-06 22:36     ` Dave Chinner

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