linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: introduce _filter_backtick
@ 2013-09-18 20:29 Josef Bacik
  2013-09-18 21:13 ` Dave Chinner
  0 siblings, 1 reply; 7+ messages in thread
From: Josef Bacik @ 2013-09-18 20:29 UTC (permalink / raw)
  To: xfs, linux-btrfs

Apparently the GNU guys decided to change their error output from something like

Error `Error message'

To

Error 'Error message'

So to fix this I've introduced _filter_backtick which will change any ` to ' and
then changed the output of the tests that were failing for me because of this
output.  I tested this on a new box that has the new output and an old box which
has the old output and it appears to fix the issue.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
---
 common/filter         |  7 +++++++
 tests/generic/193     | 18 ++++++++++--------
 tests/generic/193.out | 16 ++++++++--------
 tests/generic/245     |  3 ++-
 tests/generic/245.out |  2 +-
 tests/generic/294     |  2 +-
 tests/generic/294.out |  8 ++++----
 tests/generic/306     |  2 +-
 tests/generic/306.out |  2 +-
 9 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/common/filter b/common/filter
index ee738ca..ec49e18 100644
--- a/common/filter
+++ b/common/filter
@@ -280,5 +280,12 @@ _filter_size_to_bytes()
 	echo $((${size:0:${#size}-1}*$mul))
 }
 
+# Old gnu utils used to spit out something like "Error `blah'" but the new ones
+# do "Error 'blah'" so fix the ` to be a ' so we are consistent
+_filter_backtick()
+{
+	sed -e "s/\`/\'/g"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/tests/generic/193 b/tests/generic/193
index 4fa20ff..2186997 100755
--- a/tests/generic/193
+++ b/tests/generic/193
@@ -91,17 +91,18 @@ echo
 _create_files
 
 echo "user: chown root owned file to qa_user (should fail)"
-su ${qa_user} -c "chown ${qa_user} $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "chown ${qa_user} $test_root" 2>&1 | _filter_files | \
+	_filter_backtick
 
 echo "user: chown root owned file to root (should fail)"
-su ${qa_user} -c "chown root $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "chown root $test_root" 2>&1 | _filter_files | _filter_backtick
 
 echo "user: chown qa_user owned file to qa_user (should succeed)"
 su ${qa_user} -c "chown ${qa_user} $test_user"
 
 # this would work without _POSIX_CHOWN_RESTRICTED
 echo "user: chown qa_user owned file to root (should fail)"
-su ${qa_user} -c "chown root $test_user" 2>&1 | _filter_files
+su ${qa_user} -c "chown root $test_user" 2>&1 | _filter_files | _filter_backtick
 
 _cleanup_files
 
@@ -115,13 +116,14 @@ echo
 _create_files
 
 echo "user: chgrp root owned file to root (should fail)"
-su ${qa_user} -c "chgrp root $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "chgrp root $test_root" 2>&1 | _filter_files | _filter_backtick
 
 echo "user: chgrp qa_user owned file to root (should fail)"
-su ${qa_user} -c "chgrp root $test_user" 2>&1 | _filter_files
+su ${qa_user} -c "chgrp root $test_user" 2>&1 | _filter_files | _filter_backtick
 
 echo "user: chgrp root owned file to qa_user (should fail)"
-su ${qa_user} -c "chgrp ${qa_user} $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "chgrp ${qa_user} $test_root" 2>&1 | _filter_files | \
+	_filter_backtick
 
 echo "user: chgrp qa_user owned file to qa_user (should succeed)"
 su ${qa_user} -c "chgrp ${qa_user} $test_user"
@@ -144,7 +146,7 @@ echo "user: chmod a+r on qa_user owned file (should succeed)"
 su ${qa_user} -c "chmod a+r $test_user"
 
 echo "user: chmod a+r on root owned file (should fail)"
-su ${qa_user} -c "chmod a+r $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "chmod a+r $test_root" 2>&1 | _filter_files | _filter_backtick
 
 #
 # Setup a file owned by the qa_user, but with a group ID that
@@ -283,7 +285,7 @@ echo "user: touch qa_user file (should succeed)"
 su ${qa_user} -c "touch $test_user"
 
 echo "user: touch root file (should fail)"
-su ${qa_user} -c "touch $test_root" 2>&1 | _filter_files
+su ${qa_user} -c "touch $test_root" 2>&1 | _filter_files | _filter_backtick
 
 _cleanup_files
 
diff --git a/tests/generic/193.out b/tests/generic/193.out
index 357a7c1..7a7f89a 100644
--- a/tests/generic/193.out
+++ b/tests/generic/193.out
@@ -3,28 +3,28 @@ QA output created by 193
 testing ATTR_UID
 
 user: chown root owned file to qa_user (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown root owned file to root (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown qa_user owned file to qa_user (should succeed)
 user: chown qa_user owned file to root (should fail)
-chown: changing ownership of `test.user': Operation not permitted
+chown: changing ownership of 'test.user': Operation not permitted
 
 testing ATTR_GID
 
 user: chgrp root owned file to root (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to root (should fail)
-chgrp: changing group of `test.user': Operation not permitted
+chgrp: changing group of 'test.user': Operation not permitted
 user: chgrp root owned file to qa_user (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to qa_user (should succeed)
 
 testing ATTR_MODE
 
 user: chmod a+r on qa_user owned file (should succeed)
 user: chmod a+r on root owned file (should fail)
-chmod: changing permissions of `test.root': Operation not permitted
+chmod: changing permissions of 'test.root': Operation not permitted
 check that the sgid bit is cleared
 -rw-rw-rw-
 check that suid bit is not cleared
@@ -60,5 +60,5 @@ testing ATTR_*TIMES_SET
 
 user: touch qa_user file (should succeed)
 user: touch root file (should fail)
-touch: cannot touch `test.root': Permission denied
+touch: cannot touch 'test.root': Permission denied
 *** done
diff --git a/tests/generic/245 b/tests/generic/245
index 9b87fbb..a2811ce 100755
--- a/tests/generic/245
+++ b/tests/generic/245
@@ -65,7 +65,8 @@ touch $dir/aa/1
 mkdir $dir/ab/aa
 touch $dir/ab/aa/2
 
-mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty
+mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty | \
+	_filter_backtick
 
 status=0
 exit $status
diff --git a/tests/generic/245.out b/tests/generic/245.out
index 8322aac..f5b5f18 100644
--- a/tests/generic/245.out
+++ b/tests/generic/245.out
@@ -1,2 +1,2 @@
 QA output created by 245
-mv: cannot move `TEST_DIR/test-mv/ab/aa/' to `TEST_DIR/test-mv/aa': File exists
+mv: cannot move 'TEST_DIR/test-mv/ab/aa/' to 'TEST_DIR/test-mv/aa': File exists
diff --git a/tests/generic/294 b/tests/generic/294
index fa7f339..ef02e18 100755
--- a/tests/generic/294
+++ b/tests/generic/294
@@ -65,7 +65,7 @@ mkdir $THIS_TEST_DIR || _fail "Could not create dir for test"
 
 _create_files 2>&1 | _filter_scratch
 _scratch_mount -o remount,ro || _fail "Could not remount scratch readonly"
-_create_files 2>&1 | _filter_scratch
+_create_files 2>&1 | _filter_scratch | _filter_backtick
 
 # success, all done
 status=0
diff --git a/tests/generic/294.out b/tests/generic/294.out
index 027d9fc..1ac1c67 100644
--- a/tests/generic/294.out
+++ b/tests/generic/294.out
@@ -1,5 +1,5 @@
 QA output created by 294
-mknod: `SCRATCH_MNT/294.test/testnode': File exists
-mkdir: cannot create directory `SCRATCH_MNT/294.test/testdir': File exists
-touch: cannot touch `SCRATCH_MNT/294.test/testtarget': Read-only file system
-ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists
+mknod: 'SCRATCH_MNT/294.test/testnode': File exists
+mkdir: cannot create directory 'SCRATCH_MNT/294.test/testdir': File exists
+touch: cannot touch 'SCRATCH_MNT/294.test/testtarget': Read-only file system
+ln: creating symbolic link 'SCRATCH_MNT/294.test/testlink': File exists
diff --git a/tests/generic/306 b/tests/generic/306
index 04d28df..47235ec 100755
--- a/tests/generic/306
+++ b/tests/generic/306
@@ -71,7 +71,7 @@ _scratch_mount -o ro || _fail "Could not mount scratch readonly"
 
 # We should be able to read & write to/from these devices even on an RO fs
 echo "== try to create new file"
-touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch
+touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch | _filter_backtick
 echo "== pwrite to null device"
 $XFS_IO_PROG -c "pwrite 0 512" $DEVNULL | _filter_xfs_io
 echo "== pread from zero device"
diff --git a/tests/generic/306.out b/tests/generic/306.out
index 69bfb42..fb3748b 100644
--- a/tests/generic/306.out
+++ b/tests/generic/306.out
@@ -1,6 +1,6 @@
 QA output created by 306
 == try to create new file
-touch: cannot touch `SCRATCH_MNT/this_should_fail': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/this_should_fail': Read-only file system
 == pwrite to null device
 wrote 512/512 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-- 
1.8.3.1


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

* Re: [PATCH] xfstests: introduce _filter_backtick
  2013-09-18 20:29 [PATCH] xfstests: introduce _filter_backtick Josef Bacik
@ 2013-09-18 21:13 ` Dave Chinner
  2013-09-19 13:36   ` [BULK] " Josef Bacik
  2013-09-19 16:20   ` [PATCH] xfstests: unify apostrophes in output files Eric Sandeen
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Chinner @ 2013-09-18 21:13 UTC (permalink / raw)
  To: Josef Bacik; +Cc: xfs, linux-btrfs

On Wed, Sep 18, 2013 at 04:29:26PM -0400, Josef Bacik wrote:
> Apparently the GNU guys decided to change their error output from something like
> 
> Error `Error message'
> 
> To
> 
> Error 'Error message'
> 
> So to fix this I've introduced _filter_backtick which will change any ` to ' and
> then changed the output of the tests that were failing for me because of this
> output.  I tested this on a new box that has the new output and an old box which
> has the old output and it appears to fix the issue.  Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fusionio.com>

That's just leaving a landmine behind, and it doesn't catch all the
tests that need updating. This approach was floated here:

http://oss.sgi.com/archives/xfs/2013-05/msg00312.html

And my response was to add a global filter to the .check file so it
doesn't leave a landmine. Indeed, I have a local version on tomas'
patch that I modified in May does just that:

--- a/check
+++ b/check
@@ -477,6 +477,10 @@ do
                echo " - no qualified output"
                err=true
            else
+
+               # coreutils 2.16+ changed quote formats in error messages from
+               # `foo' to 'foo'. Filter old versions to match the new version.
+               sed -i "s/\`/\'/g" $tmp.out
                if diff $seq.out $tmp.out >/dev/null 2>&1
                then
                    if $err

I also discovered that for some reason LANG=C is not sufficient for
all cases to make the quoting behaviour consistent. i.e. I
needed to set LC_ALL=C so that it didn't use weird UTF-8 encodings
for the quotes instead of a simple backtick.

Full patch below.

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

xfstests: unify apostrophes in output files

From: Tomas Racek <tracek@redhat.com>

With coreutils v8.16 the style of apostrophes changed from `word' to
'word'. This is breaking some tests which use the older form.

This commit introduces function changes the golden output of the
affected tests and introduces a filter for the older style output.

[dchinner: modified to use a global filter in check rather than
per-test filters]

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 check                 |  4 ++++
 common/config         |  1 +
 tests/generic/193.out | 16 ++++++++--------
 tests/generic/230.out |  8 ++++----
 tests/generic/235.out |  2 +-
 tests/generic/245.out |  2 +-
 tests/generic/294.out |  8 ++++----
 tests/generic/306.out |  2 +-
 tests/xfs/103.out     |  2 +-
 tests/xfs/200.out     |  2 +-
 10 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/check b/check
index 4085eae..ba7fd21 100755
--- a/check
+++ b/check
@@ -478,6 +478,10 @@ do
 		echo " - no qualified output"
 		err=true
 	    else
+
+		# coreutils 2.16+ changed quote formats in error messages from
+		# `foo' to 'foo'. Filter old versions to match the new version.
+		sed -i "s/\`/\'/g" $tmp.out
 		if diff $seq.out $tmp.out >/dev/null 2>&1
 		then
 		    if $err
diff --git a/common/config b/common/config
index 67c1498..b422f87 100644
--- a/common/config
+++ b/common/config
@@ -49,6 +49,7 @@
 # all tests should use a common language setting to prevent golden
 # output mismatches.
 export LANG=C
+export LC_ALL=C
 
 # Warning: don't put freeware before /usr/bsd on IRIX coz you'll
 #  get the wrong hostname and set your system name to -s  :)
diff --git a/tests/generic/193.out b/tests/generic/193.out
index 357a7c1..7a7f89a 100644
--- a/tests/generic/193.out
+++ b/tests/generic/193.out
@@ -3,28 +3,28 @@ QA output created by 193
 testing ATTR_UID
 
 user: chown root owned file to qa_user (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown root owned file to root (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown qa_user owned file to qa_user (should succeed)
 user: chown qa_user owned file to root (should fail)
-chown: changing ownership of `test.user': Operation not permitted
+chown: changing ownership of 'test.user': Operation not permitted
 
 testing ATTR_GID
 
 user: chgrp root owned file to root (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to root (should fail)
-chgrp: changing group of `test.user': Operation not permitted
+chgrp: changing group of 'test.user': Operation not permitted
 user: chgrp root owned file to qa_user (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to qa_user (should succeed)
 
 testing ATTR_MODE
 
 user: chmod a+r on qa_user owned file (should succeed)
 user: chmod a+r on root owned file (should fail)
-chmod: changing permissions of `test.root': Operation not permitted
+chmod: changing permissions of 'test.root': Operation not permitted
 check that the sgid bit is cleared
 -rw-rw-rw-
 check that suid bit is not cleared
@@ -60,5 +60,5 @@ testing ATTR_*TIMES_SET
 
 user: touch qa_user file (should succeed)
 user: touch root file (should fail)
-touch: cannot touch `test.root': Permission denied
+touch: cannot touch 'test.root': Permission denied
 *** done
diff --git a/tests/generic/230.out b/tests/generic/230.out
index d2d434c..c3dace9 100644
--- a/tests/generic/230.out
+++ b/tests/generic/230.out
@@ -12,9 +12,9 @@ Write 4096...
 pwrite64: Disk quota exceeded
 Touch 3+4
 Touch 5+6
-touch: cannot touch `SCRATCH_MNT/file6': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
 Touch 5
-touch: cannot touch `SCRATCH_MNT/file5': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded
 
 ### test group limit enforcement
 
@@ -28,6 +28,6 @@ Write 4096...
 pwrite64: Disk quota exceeded
 Touch 3+4
 Touch 5+6
-touch: cannot touch `SCRATCH_MNT/file6': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
 Touch 5
-touch: cannot touch `SCRATCH_MNT/file5': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded
diff --git a/tests/generic/235.out b/tests/generic/235.out
index a095694..95c1005 100644
--- a/tests/generic/235.out
+++ b/tests/generic/235.out
@@ -15,7 +15,7 @@ Group           used    soft    hard  grace    used  soft  hard  grace
 fsgqa     --       0       0       0              1     0     0       
 
 
-touch: cannot touch `SCRATCH_MNT/failed': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/failed': Read-only file system
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
diff --git a/tests/generic/245.out b/tests/generic/245.out
index 8322aac..f5b5f18 100644
--- a/tests/generic/245.out
+++ b/tests/generic/245.out
@@ -1,2 +1,2 @@
 QA output created by 245
-mv: cannot move `TEST_DIR/test-mv/ab/aa/' to `TEST_DIR/test-mv/aa': File exists
+mv: cannot move 'TEST_DIR/test-mv/ab/aa/' to 'TEST_DIR/test-mv/aa': File exists
diff --git a/tests/generic/294.out b/tests/generic/294.out
index 027d9fc..1ac1c67 100644
--- a/tests/generic/294.out
+++ b/tests/generic/294.out
@@ -1,5 +1,5 @@
 QA output created by 294
-mknod: `SCRATCH_MNT/294.test/testnode': File exists
-mkdir: cannot create directory `SCRATCH_MNT/294.test/testdir': File exists
-touch: cannot touch `SCRATCH_MNT/294.test/testtarget': Read-only file system
-ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists
+mknod: 'SCRATCH_MNT/294.test/testnode': File exists
+mkdir: cannot create directory 'SCRATCH_MNT/294.test/testdir': File exists
+touch: cannot touch 'SCRATCH_MNT/294.test/testtarget': Read-only file system
+ln: creating symbolic link 'SCRATCH_MNT/294.test/testlink': File exists
diff --git a/tests/generic/306.out b/tests/generic/306.out
index 69bfb42..fb3748b 100644
--- a/tests/generic/306.out
+++ b/tests/generic/306.out
@@ -1,6 +1,6 @@
 QA output created by 306
 == try to create new file
-touch: cannot touch `SCRATCH_MNT/this_should_fail': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/this_should_fail': Read-only file system
 == pwrite to null device
 wrote 512/512 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/xfs/103.out b/tests/xfs/103.out
index f939bcd..4ab3ad7 100644
--- a/tests/xfs/103.out
+++ b/tests/xfs/103.out
@@ -4,7 +4,7 @@ QA output created by 103
 *** testing nosymlinks directories
 *** setting nosymlinks bit
 --n-- SCRATCH_MNT/nosymlink
-ln: creating symbolic link `SCRATCH_MNT/nosymlink/target': Operation not permitted
+ln: creating symbolic link 'SCRATCH_MNT/nosymlink/target': Operation not permitted
 *** 1st listing...
 SCRATCH_MNT
 SCRATCH_MNT/nosymlink
diff --git a/tests/xfs/200.out b/tests/xfs/200.out
index 2629541..174838c 100644
--- a/tests/xfs/200.out
+++ b/tests/xfs/200.out
@@ -3,7 +3,7 @@ setting device read-only
 mounting read-only block device:
 mount: block device SCRATCH_DEV is write-protected, mounting read-only
 touching file on read-only filesystem (should fail)
-touch: cannot touch `SCRATCH_MNT/foo': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/foo': Read-only file system
 unmounting read-only filesystem
 setting device read-write
 mounting read-write block device:

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

* Re: [BULK]  Re: [PATCH] xfstests: introduce _filter_backtick
  2013-09-18 21:13 ` Dave Chinner
@ 2013-09-19 13:36   ` Josef Bacik
  2013-09-19 16:20   ` [PATCH] xfstests: unify apostrophes in output files Eric Sandeen
  1 sibling, 0 replies; 7+ messages in thread
From: Josef Bacik @ 2013-09-19 13:36 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Josef Bacik, xfs, linux-btrfs

On Thu, Sep 19, 2013 at 07:13:25AM +1000, Dave Chinner wrote:
> On Wed, Sep 18, 2013 at 04:29:26PM -0400, Josef Bacik wrote:
> > Apparently the GNU guys decided to change their error output from something like
> > 
> > Error `Error message'
> > 
> > To
> > 
> > Error 'Error message'
> > 
> > So to fix this I've introduced _filter_backtick which will change any ` to ' and
> > then changed the output of the tests that were failing for me because of this
> > output.  I tested this on a new box that has the new output and an old box which
> > has the old output and it appears to fix the issue.  Thanks,
> > 
> > Signed-off-by: Josef Bacik <jbacik@fusionio.com>
> 
> That's just leaving a landmine behind, and it doesn't catch all the
> tests that need updating. This approach was floated here:
> 
> http://oss.sgi.com/archives/xfs/2013-05/msg00312.html
> 
> And my response was to add a global filter to the .check file so it
> doesn't leave a landmine. Indeed, I have a local version on tomas'
> patch that I modified in May does just that:
> 
> --- a/check
> +++ b/check
> @@ -477,6 +477,10 @@ do
>                 echo " - no qualified output"
>                 err=true
>             else
> +
> +               # coreutils 2.16+ changed quote formats in error messages from
> +               # `foo' to 'foo'. Filter old versions to match the new version.
> +               sed -i "s/\`/\'/g" $tmp.out
>                 if diff $seq.out $tmp.out >/dev/null 2>&1
>                 then
>                     if $err
> 
> I also discovered that for some reason LANG=C is not sufficient for
> all cases to make the quoting behaviour consistent. i.e. I
> needed to set LC_ALL=C so that it didn't use weird UTF-8 encodings
> for the quotes instead of a simple backtick.
> 
> Full patch below.

Excellent, what is holding this patch up then if it was proposed in May and you
are ok with it?  Thanks,

Josef

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

* [PATCH] xfstests: unify apostrophes in output files
  2013-09-18 21:13 ` Dave Chinner
  2013-09-19 13:36   ` [BULK] " Josef Bacik
@ 2013-09-19 16:20   ` Eric Sandeen
  2013-09-19 16:54     ` Ilya Dryomov
  2013-10-16 20:06     ` Rich Johnston
  1 sibling, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2013-09-19 16:20 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Josef Bacik, xfs, linux-btrfs

xfstests: unify apostrophes in output files

From: Tomas Racek <tracek@redhat.com>

With coreutils v8.16 the style of apostrophes changed from `word' to
'word'. This is breaking some tests which use the older form.

This commit introduces function changes the golden output of the
affected tests and introduces a filter for the older style output.

[dchinner: modified to use a global filter in check rather than
per-test filters]

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---

(Resending as proper top-level, modified, reviewed patch --Eric)

 check                 |  4 ++++
 common/config         |  1 +
 tests/generic/193.out | 16 ++++++++--------
 tests/generic/230.out |  8 ++++----
 tests/generic/235.out |  2 +-
 tests/generic/245.out |  2 +-
 tests/generic/294.out |  8 ++++----
 tests/generic/306.out |  2 +-
 tests/xfs/103.out     |  2 +-
 tests/xfs/200.out     |  2 +-
 10 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/check b/check
index 4085eae..ba7fd21 100755
--- a/check
+++ b/check
@@ -478,6 +478,10 @@ do
 		echo " - no qualified output"
 		err=true
 	    else
+
+		# coreutils 2.16+ changed quote formats in error messages from
+		# `foo' to 'foo'. Filter old versions to match the new version.
+		sed -i "s/\`/\'/g" $tmp.out
 		if diff $seq.out $tmp.out >/dev/null 2>&1
 		then
 		    if $err
diff --git a/common/config b/common/config
index 67c1498..b422f87 100644
--- a/common/config
+++ b/common/config
@@ -49,6 +49,7 @@
 # all tests should use a common language setting to prevent golden
 # output mismatches.
 export LANG=C
+export LC_ALL=C
 
 # Warning: don't put freeware before /usr/bsd on IRIX coz you'll
 #  get the wrong hostname and set your system name to -s  
diff --git a/tests/generic/193.out b/tests/generic/193.out
index 357a7c1..7a7f89a 100644
--- a/tests/generic/193.out
+++ b/tests/generic/193.out
@@ -3,28 +3,28 @@ QA output created by 193
 testing ATTR_UID
 
 user: chown root owned file to qa_user (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown root owned file to root (should fail)
-chown: changing ownership of `test.root': Operation not permitted
+chown: changing ownership of 'test.root': Operation not permitted
 user: chown qa_user owned file to qa_user (should succeed)
 user: chown qa_user owned file to root (should fail)
-chown: changing ownership of `test.user': Operation not permitted
+chown: changing ownership of 'test.user': Operation not permitted
 
 testing ATTR_GID
 
 user: chgrp root owned file to root (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to root (should fail)
-chgrp: changing group of `test.user': Operation not permitted
+chgrp: changing group of 'test.user': Operation not permitted
 user: chgrp root owned file to qa_user (should fail)
-chgrp: changing group of `test.root': Operation not permitted
+chgrp: changing group of 'test.root': Operation not permitted
 user: chgrp qa_user owned file to qa_user (should succeed)
 
 testing ATTR_MODE
 
 user: chmod a+r on qa_user owned file (should succeed)
 user: chmod a+r on root owned file (should fail)
-chmod: changing permissions of `test.root': Operation not permitted
+chmod: changing permissions of 'test.root': Operation not permitted
 check that the sgid bit is cleared
 -rw-rw-rw-
 check that suid bit is not cleared
@@ -60,5 +60,5 @@ testing ATTR_*TIMES_SET
 
 user: touch qa_user file (should succeed)
 user: touch root file (should fail)
-touch: cannot touch `test.root': Permission denied
+touch: cannot touch 'test.root': Permission denied
 *** done
diff --git a/tests/generic/230.out b/tests/generic/230.out
index d2d434c..c3dace9 100644
--- a/tests/generic/230.out
+++ b/tests/generic/230.out
@@ -12,9 +12,9 @@ Write 4096...
 pwrite64: Disk quota exceeded
 Touch 3+4
 Touch 5+6
-touch: cannot touch `SCRATCH_MNT/file6': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
 Touch 5
-touch: cannot touch `SCRATCH_MNT/file5': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded
 
 ### test group limit enforcement
 
@@ -28,6 +28,6 @@ Write 4096...
 pwrite64: Disk quota exceeded
 Touch 3+4
 Touch 5+6
-touch: cannot touch `SCRATCH_MNT/file6': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file6': Disk quota exceeded
 Touch 5
-touch: cannot touch `SCRATCH_MNT/file5': Disk quota exceeded
+touch: cannot touch 'SCRATCH_MNT/file5': Disk quota exceeded
diff --git a/tests/generic/235.out b/tests/generic/235.out
index a095694..95c1005 100644
--- a/tests/generic/235.out
+++ b/tests/generic/235.out
@@ -15,7 +15,7 @@ Group           used    soft    hard  grace    used  soft  hard  grace
 fsgqa     --       0       0       0              1     0     0       
 
 
-touch: cannot touch `SCRATCH_MNT/failed': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/failed': Read-only file system
 *** Report for user quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
diff --git a/tests/generic/245.out b/tests/generic/245.out
index 8322aac..f5b5f18 100644
--- a/tests/generic/245.out
+++ b/tests/generic/245.out
@@ -1,2 +1,2 @@
 QA output created by 245
-mv: cannot move `TEST_DIR/test-mv/ab/aa/' to `TEST_DIR/test-mv/aa': File exists
+mv: cannot move 'TEST_DIR/test-mv/ab/aa/' to 'TEST_DIR/test-mv/aa': File exists
diff --git a/tests/generic/294.out b/tests/generic/294.out
index 027d9fc..1ac1c67 100644
--- a/tests/generic/294.out
+++ b/tests/generic/294.out
@@ -1,5 +1,5 @@
 QA output created by 294
-mknod: `SCRATCH_MNT/294.test/testnode': File exists
-mkdir: cannot create directory `SCRATCH_MNT/294.test/testdir': File exists
-touch: cannot touch `SCRATCH_MNT/294.test/testtarget': Read-only file system
-ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists
+mknod: 'SCRATCH_MNT/294.test/testnode': File exists
+mkdir: cannot create directory 'SCRATCH_MNT/294.test/testdir': File exists
+touch: cannot touch 'SCRATCH_MNT/294.test/testtarget': Read-only file system
+ln: creating symbolic link 'SCRATCH_MNT/294.test/testlink': File exists
diff --git a/tests/generic/306.out b/tests/generic/306.out
index 69bfb42..fb3748b 100644
--- a/tests/generic/306.out
+++ b/tests/generic/306.out
@@ -1,6 +1,6 @@
 QA output created by 306
 == try to create new file
-touch: cannot touch `SCRATCH_MNT/this_should_fail': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/this_should_fail': Read-only file system
 == pwrite to null device
 wrote 512/512 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/xfs/103.out b/tests/xfs/103.out
index f939bcd..4ab3ad7 100644
--- a/tests/xfs/103.out
+++ b/tests/xfs/103.out
@@ -4,7 +4,7 @@ QA output created by 103
 *** testing nosymlinks directories
 *** setting nosymlinks bit
 --n-- SCRATCH_MNT/nosymlink
-ln: creating symbolic link `SCRATCH_MNT/nosymlink/target': Operation not permitted
+ln: creating symbolic link 'SCRATCH_MNT/nosymlink/target': Operation not permitted
 *** 1st listing...
 SCRATCH_MNT
 SCRATCH_MNT/nosymlink
diff --git a/tests/xfs/200.out b/tests/xfs/200.out
index 2629541..174838c 100644
--- a/tests/xfs/200.out
+++ b/tests/xfs/200.out
@@ -3,7 +3,7 @@ setting device read-only
 mounting read-only block device:
 mount: block device SCRATCH_DEV is write-protected, mounting read-only
 touching file on read-only filesystem (should fail)
-touch: cannot touch `SCRATCH_MNT/foo': Read-only file system
+touch: cannot touch 'SCRATCH_MNT/foo': Read-only file system
 unmounting read-only filesystem
 setting device read-write
 mounting read-write block device:
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH] xfstests: unify apostrophes in output files
  2013-09-19 16:20   ` [PATCH] xfstests: unify apostrophes in output files Eric Sandeen
@ 2013-09-19 16:54     ` Ilya Dryomov
  2013-09-19 17:03       ` Eric Sandeen
  2013-10-16 20:06     ` Rich Johnston
  1 sibling, 1 reply; 7+ messages in thread
From: Ilya Dryomov @ 2013-09-19 16:54 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Dave Chinner, Josef Bacik, xfs, linux-btrfs

On Thu, Sep 19, 2013 at 7:20 PM, Eric Sandeen <sandeen@redhat.com> wrote:
> xfstests: unify apostrophes in output files
>
> From: Tomas Racek <tracek@redhat.com>
>
> With coreutils v8.16 the style of apostrophes changed from `word' to
> 'word'. This is breaking some tests which use the older form.
>
> This commit introduces function changes the golden output of the
> affected tests and introduces a filter for the older style output.
>
> [dchinner: modified to use a global filter in check rather than
> per-test filters]
>
> Signed-off-by: Tomas Racek <tracek@redhat.com>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> (Resending as proper top-level, modified, reviewed patch --Eric)
>
>  check                 |  4 ++++
>  common/config         |  1 +
>  tests/generic/193.out | 16 ++++++++--------
>  tests/generic/230.out |  8 ++++----
>  tests/generic/235.out |  2 +-
>  tests/generic/245.out |  2 +-
>  tests/generic/294.out |  8 ++++----
>  tests/generic/306.out |  2 +-
>  tests/xfs/103.out     |  2 +-
>  tests/xfs/200.out     |  2 +-
>  10 files changed, 26 insertions(+), 21 deletions(-)
>
> diff --git a/check b/check
> index 4085eae..ba7fd21 100755
> --- a/check
> +++ b/check
> @@ -478,6 +478,10 @@ do
>                 echo " - no qualified output"
>                 err=true
>             else
> +
> +               # coreutils 2.16+ changed quote formats in error messages from

Should that be 8.16+?

Thanks,

                Ilya

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

* Re: [PATCH] xfstests: unify apostrophes in output files
  2013-09-19 16:54     ` Ilya Dryomov
@ 2013-09-19 17:03       ` Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2013-09-19 17:03 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Eric Sandeen, linux-btrfs, Josef Bacik, xfs

On 9/19/13 11:54 AM, Ilya Dryomov wrote:

...

>> diff --git a/check b/check
>> index 4085eae..ba7fd21 100755
>> --- a/check
>> +++ b/check
>> @@ -478,6 +478,10 @@ do
>>                 echo " - no qualified output"
>>                 err=true
>>             else
>> +
>> +               # coreutils 2.16+ changed quote formats in error messages from
> 
> Should that be 8.16+?

probably so!

> Thanks,
> 
>                 Ilya
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 


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

* Re: [PATCH] xfstests: unify apostrophes in output files
  2013-09-19 16:20   ` [PATCH] xfstests: unify apostrophes in output files Eric Sandeen
  2013-09-19 16:54     ` Ilya Dryomov
@ 2013-10-16 20:06     ` Rich Johnston
  1 sibling, 0 replies; 7+ messages in thread
From: Rich Johnston @ 2013-10-16 20:06 UTC (permalink / raw)
  To: Eric Sandeen, Dave Chinner; +Cc: linux-btrfs, Josef Bacik, xfs

This has been committed.

Thanks
--Rich

commit 774f4dd775340adc53565dce858882de0d4e6e85
Author: Tomas Racek <tracek@redhat.com>
Date:   Thu Sep 19 16:20:37 2013 +0000

     xfstests: unify apostrophes in output files



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

end of thread, other threads:[~2013-10-16 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18 20:29 [PATCH] xfstests: introduce _filter_backtick Josef Bacik
2013-09-18 21:13 ` Dave Chinner
2013-09-19 13:36   ` [BULK] " Josef Bacik
2013-09-19 16:20   ` [PATCH] xfstests: unify apostrophes in output files Eric Sandeen
2013-09-19 16:54     ` Ilya Dryomov
2013-09-19 17:03       ` Eric Sandeen
2013-10-16 20:06     ` Rich Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).