From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Theodore Tso <tytso@MIT.EDU>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Yu Jian <yujian@whamcloud.com>,
Andreas Dilger <adilger@whamcloud.com>, xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] xfstests: Sort recursive getfattr output in 062
Date: Wed, 25 Jan 2012 15:38:54 -0600 [thread overview]
Message-ID: <4F20766E.9040902@sandeen.net> (raw)
In-Reply-To: <4ECD28D1.1080800@redhat.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Test 062 was made "generic" a while back, but it fails on any filesystem
which returns getfattr -R results (aka readdir results) in something
other than inode-order.
With a little awk-fu we can sort the records from getfattr -R so that
the output is the same for xfs as well as ext4, etc.
Also filter out lost+found which extN creates at mkfs time, but
some other filesystems do not.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
- ---
V2: move sorting function into common.attr
diff --git a/062 b/062
index f666e1b..9800e33 100755
- --- a/062
+++ b/062
@@ -67,7 +67,7 @@ _create_test_bed()
mknod $SCRATCH_MNT/dev/c c 0 0
mknod $SCRATCH_MNT/dev/p p
# sanity check
- - find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
+ find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch | grep -v "lost+found"
}
# real QA test starts here
@@ -160,18 +160,18 @@ _extend_test_bed()
# whack a symlink in the middle, just to be difficult
ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
# dump out our new starting point
- - find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
+ find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch | grep -v "lost+found"
}
_extend_test_bed
echo
echo "*** directory descent with us following symlinks"
- -getfattr -h -L -R -m '.' -e hex $SCRATCH_MNT
+getfattr -h -L -R -m '.' -e hex $SCRATCH_MNT | _sort_getfattr_output
echo
echo "*** directory descent without following symlinks"
- -getfattr -h -P -R -m '.' -e hex $SCRATCH_MNT
+getfattr -h -P -R -m '.' -e hex $SCRATCH_MNT | _sort_getfattr_output
#
diff --git a/062.out b/062.out
index 699254a..8cc3c65 100644
- --- a/062.out
+++ b/062.out
@@ -508,21 +508,21 @@ SCRATCH_MNT/lnk
SCRATCH_MNT/reg
*** directory descent with us following symlinks
- -# file: SCRATCH_MNT/reg
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
+# file: SCRATCH_MNT/descend
+user.1=0x3233
+user.x=0x797a
- -# file: SCRATCH_MNT/dir
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
+# file: SCRATCH_MNT/descend/and/ascend
+trusted.9=0x3837
+trusted.a=0x6263
- -# file: SCRATCH_MNT/lnk
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
+# file: SCRATCH_MNT/descend/down
+user.1=0x3233
+user.x=0x797a
+
+# file: SCRATCH_MNT/descend/down/here
+user.1=0x3233
+user.x=0x797a
# file: SCRATCH_MNT/dev/b
trusted.name=0xbabe
@@ -536,6 +536,12 @@ trusted.name3=0xdeface
trusted.name=0xbabe
trusted.name3=0xdeface
+# file: SCRATCH_MNT/dir
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
# file: SCRATCH_MNT/here
trusted.9=0x3837
trusted.a=0x6263
@@ -548,6 +554,18 @@ trusted.a=0x6263
trusted.9=0x3837
trusted.a=0x6263
+# file: SCRATCH_MNT/lnk
+trusted.name=0xbabe
+trusted.name3=0xdeface
+
+# file: SCRATCH_MNT/reg
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
+
+*** directory descent without following symlinks
# file: SCRATCH_MNT/descend
user.1=0x3233
user.x=0x797a
@@ -560,28 +578,6 @@ user.x=0x797a
user.1=0x3233
user.x=0x797a
- -# file: SCRATCH_MNT/descend/and/ascend
- -trusted.9=0x3837
- -trusted.a=0x6263
- -
- -
- -*** directory descent without following symlinks
- -# file: SCRATCH_MNT/reg
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
- -
- -# file: SCRATCH_MNT/dir
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
- -
- -# file: SCRATCH_MNT/lnk
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -
# file: SCRATCH_MNT/dev/b
trusted.name=0xbabe
trusted.name3=0xdeface
@@ -594,6 +590,12 @@ trusted.name3=0xdeface
trusted.name=0xbabe
trusted.name3=0xdeface
+# file: SCRATCH_MNT/dir
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
# file: SCRATCH_MNT/here
trusted.9=0x3837
trusted.a=0x6263
@@ -606,17 +608,15 @@ trusted.a=0x6263
trusted.9=0x3837
trusted.a=0x6263
- -# file: SCRATCH_MNT/descend
- -user.1=0x3233
- -user.x=0x797a
- -
- -# file: SCRATCH_MNT/descend/down
- -user.1=0x3233
- -user.x=0x797a
+# file: SCRATCH_MNT/lnk
+trusted.name=0xbabe
+trusted.name3=0xdeface
- -# file: SCRATCH_MNT/descend/down/here
- -user.1=0x3233
- -user.x=0x797a
+# file: SCRATCH_MNT/reg
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
diff --git a/common.attr b/common.attr
index 3e2ba85..b49d990 100644
- --- a/common.attr
+++ b/common.attr
@@ -176,6 +176,13 @@ _require_attrs()
rm -f $TEST_DIR/syscalltest.out
}
+# getfattr -R returns info in readdir order which varies from fs to fs.
+# This sorts the output by filename
+_sort_getfattr_output()
+{
+ awk '{a[FNR]=$0}END{n = asort(a); for(i=1; i <= n; i++) print a[i]"\n"}' RS=''
+}
+
# set maximum total attr space based on fs type
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" ]; then
MAX_ATTRS=1000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPIHZtAAoJECCuFpLhPd7g2yMP/1VU2RhD8gdfpJIQKGvZjurP
XGmv2tLY/3eDWTwbpm3E5m3EmXIAZpq+ahUYT9C+I8afw0oLv4zggAQ3M6P20JlM
dM/M7imNHYfafIMr7wIw0+Iv0pt/tpDv3cm2kxJDJq+yW88Y+tRG/ifU8uSjREyX
WBSqKjo3mJ0CJ03Chh9xWDK7AV4reYW3cxlCNMMzUrRPho7hWIrZN58GhDO4esqa
x11eFp4qk6I5ApExfpa5PJIGTT7xepCsQsDSaf2HNKzSEg3c5fzV43nHUFl+qRNH
FQ0CPx10VMhxtr3RZI7laN01yHk5qWjMFB9ufldot6Xv/CFwU++zBVH21IwKAgvR
D/tihuxUf8Sllpa0+DuMTuobg2cZuvlyshkWeU4YGAbyFfxirPNVjqEcnfnIMnoA
+C3Sc/8DTd70C8WG9M5ON9sMmGtJr/s93OAZMwiLHGvBC1GZf51BvAI+l7ln3Ug3
jws77r4x1P01da6ciUsESNibCrilCiw3Q2XcYJU/VfbxpFZ0ro0ib3wA4O654vqN
V38zh7BOipn7ukWIn8KRc09d9X/PqsqeFNVaLJA+tMsxH021J8uluG4nTmn3a+jM
t79YFK0JccMk8t0ShCTUjhnhHXwdrVVs8MCCghc9QoYg2/HEQrcDPKft69hM9UTL
OrK3+QKMf3JATAYdgXSg
=w2HJ
-----END PGP SIGNATURE-----
WARNING: multiple messages have this Message-ID (diff)
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Andreas Dilger <adilger@whamcloud.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Theodore Tso <tytso@MIT.EDU>, Yu Jian <yujian@whamcloud.com>,
xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] xfstests: Sort recursive getfattr output in 062
Date: Wed, 25 Jan 2012 15:38:54 -0600 [thread overview]
Message-ID: <4F20766E.9040902@sandeen.net> (raw)
In-Reply-To: <4ECD28D1.1080800@redhat.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Test 062 was made "generic" a while back, but it fails on any filesystem
which returns getfattr -R results (aka readdir results) in something
other than inode-order.
With a little awk-fu we can sort the records from getfattr -R so that
the output is the same for xfs as well as ext4, etc.
Also filter out lost+found which extN creates at mkfs time, but
some other filesystems do not.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
- ---
V2: move sorting function into common.attr
diff --git a/062 b/062
index f666e1b..9800e33 100755
- --- a/062
+++ b/062
@@ -67,7 +67,7 @@ _create_test_bed()
mknod $SCRATCH_MNT/dev/c c 0 0
mknod $SCRATCH_MNT/dev/p p
# sanity check
- - find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
+ find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch | grep -v "lost+found"
}
# real QA test starts here
@@ -160,18 +160,18 @@ _extend_test_bed()
# whack a symlink in the middle, just to be difficult
ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
# dump out our new starting point
- - find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
+ find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch | grep -v "lost+found"
}
_extend_test_bed
echo
echo "*** directory descent with us following symlinks"
- -getfattr -h -L -R -m '.' -e hex $SCRATCH_MNT
+getfattr -h -L -R -m '.' -e hex $SCRATCH_MNT | _sort_getfattr_output
echo
echo "*** directory descent without following symlinks"
- -getfattr -h -P -R -m '.' -e hex $SCRATCH_MNT
+getfattr -h -P -R -m '.' -e hex $SCRATCH_MNT | _sort_getfattr_output
#
diff --git a/062.out b/062.out
index 699254a..8cc3c65 100644
- --- a/062.out
+++ b/062.out
@@ -508,21 +508,21 @@ SCRATCH_MNT/lnk
SCRATCH_MNT/reg
*** directory descent with us following symlinks
- -# file: SCRATCH_MNT/reg
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
+# file: SCRATCH_MNT/descend
+user.1=0x3233
+user.x=0x797a
- -# file: SCRATCH_MNT/dir
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
+# file: SCRATCH_MNT/descend/and/ascend
+trusted.9=0x3837
+trusted.a=0x6263
- -# file: SCRATCH_MNT/lnk
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
+# file: SCRATCH_MNT/descend/down
+user.1=0x3233
+user.x=0x797a
+
+# file: SCRATCH_MNT/descend/down/here
+user.1=0x3233
+user.x=0x797a
# file: SCRATCH_MNT/dev/b
trusted.name=0xbabe
@@ -536,6 +536,12 @@ trusted.name3=0xdeface
trusted.name=0xbabe
trusted.name3=0xdeface
+# file: SCRATCH_MNT/dir
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
# file: SCRATCH_MNT/here
trusted.9=0x3837
trusted.a=0x6263
@@ -548,6 +554,18 @@ trusted.a=0x6263
trusted.9=0x3837
trusted.a=0x6263
+# file: SCRATCH_MNT/lnk
+trusted.name=0xbabe
+trusted.name3=0xdeface
+
+# file: SCRATCH_MNT/reg
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
+
+*** directory descent without following symlinks
# file: SCRATCH_MNT/descend
user.1=0x3233
user.x=0x797a
@@ -560,28 +578,6 @@ user.x=0x797a
user.1=0x3233
user.x=0x797a
- -# file: SCRATCH_MNT/descend/and/ascend
- -trusted.9=0x3837
- -trusted.a=0x6263
- -
- -
- -*** directory descent without following symlinks
- -# file: SCRATCH_MNT/reg
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
- -
- -# file: SCRATCH_MNT/dir
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -user.name=0xbabe
- -user.name3=0xdeface
- -
- -# file: SCRATCH_MNT/lnk
- -trusted.name=0xbabe
- -trusted.name3=0xdeface
- -
# file: SCRATCH_MNT/dev/b
trusted.name=0xbabe
trusted.name3=0xdeface
@@ -594,6 +590,12 @@ trusted.name3=0xdeface
trusted.name=0xbabe
trusted.name3=0xdeface
+# file: SCRATCH_MNT/dir
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
+
# file: SCRATCH_MNT/here
trusted.9=0x3837
trusted.a=0x6263
@@ -606,17 +608,15 @@ trusted.a=0x6263
trusted.9=0x3837
trusted.a=0x6263
- -# file: SCRATCH_MNT/descend
- -user.1=0x3233
- -user.x=0x797a
- -
- -# file: SCRATCH_MNT/descend/down
- -user.1=0x3233
- -user.x=0x797a
+# file: SCRATCH_MNT/lnk
+trusted.name=0xbabe
+trusted.name3=0xdeface
- -# file: SCRATCH_MNT/descend/down/here
- -user.1=0x3233
- -user.x=0x797a
+# file: SCRATCH_MNT/reg
+trusted.name=0xbabe
+trusted.name3=0xdeface
+user.name=0xbabe
+user.name3=0xdeface
diff --git a/common.attr b/common.attr
index 3e2ba85..b49d990 100644
- --- a/common.attr
+++ b/common.attr
@@ -176,6 +176,13 @@ _require_attrs()
rm -f $TEST_DIR/syscalltest.out
}
+# getfattr -R returns info in readdir order which varies from fs to fs.
+# This sorts the output by filename
+_sort_getfattr_output()
+{
+ awk '{a[FNR]=$0}END{n = asort(a); for(i=1; i <= n; i++) print a[i]"\n"}' RS=''
+}
+
# set maximum total attr space based on fs type
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" ]; then
MAX_ATTRS=1000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPIHZtAAoJECCuFpLhPd7g2yMP/1VU2RhD8gdfpJIQKGvZjurP
XGmv2tLY/3eDWTwbpm3E5m3EmXIAZpq+ahUYT9C+I8afw0oLv4zggAQ3M6P20JlM
dM/M7imNHYfafIMr7wIw0+Iv0pt/tpDv3cm2kxJDJq+yW88Y+tRG/ifU8uSjREyX
WBSqKjo3mJ0CJ03Chh9xWDK7AV4reYW3cxlCNMMzUrRPho7hWIrZN58GhDO4esqa
x11eFp4qk6I5ApExfpa5PJIGTT7xepCsQsDSaf2HNKzSEg3c5fzV43nHUFl+qRNH
FQ0CPx10VMhxtr3RZI7laN01yHk5qWjMFB9ufldot6Xv/CFwU++zBVH21IwKAgvR
D/tihuxUf8Sllpa0+DuMTuobg2cZuvlyshkWeU4YGAbyFfxirPNVjqEcnfnIMnoA
+C3Sc/8DTd70C8WG9M5ON9sMmGtJr/s93OAZMwiLHGvBC1GZf51BvAI+l7ln3Ug3
jws77r4x1P01da6ciUsESNibCrilCiw3Q2XcYJU/VfbxpFZ0ro0ib3wA4O654vqN
V38zh7BOipn7ukWIn8KRc09d9X/PqsqeFNVaLJA+tMsxH021J8uluG4nTmn3a+jM
t79YFK0JccMk8t0ShCTUjhnhHXwdrVVs8MCCghc9QoYg2/HEQrcDPKft69hM9UTL
OrK3+QKMf3JATAYdgXSg
=w2HJ
-----END PGP SIGNATURE-----
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-01-25 21:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 12:15 ceph and ext4 Martin Mailand
2011-11-14 13:09 ` Tomasz Paszkowski
2011-11-14 13:33 ` Martin Mailand
2011-11-14 19:10 ` Gregory Farnum
2011-11-14 19:40 ` Martin Mailand
[not found] ` <CAF3hT9DbnQLJb5YPZJ15ekt5JWZLwyoMymm2x=s9V64kw5qKWQ@mail.gmail.com>
2011-11-14 19:54 ` Fwd: " Gregory Farnum
2011-11-14 20:03 ` Sage Weil
2011-11-14 20:08 ` Martin Mailand
2011-11-14 20:08 ` Gregory Farnum
2011-11-15 8:29 ` Christian Brunner
2011-11-15 14:22 ` Ted Ts'o
2011-11-15 16:43 ` Andreas Dilger
2011-11-15 18:43 ` Yehuda Sadeh Weinraub
2011-11-21 12:22 ` Increase xattr space by allocating contiguous xattr blocks Yu Jian
2011-11-21 15:08 ` Theodore Tso
2011-11-22 3:32 ` Yu Jian
2011-11-22 4:53 ` Eric Sandeen
2011-11-23 17:09 ` [PATCH] xfstests: Sort recursive getfattr output in 062 Eric Sandeen
2011-11-23 17:09 ` Eric Sandeen
2011-11-28 11:03 ` Christoph Hellwig
2011-11-28 11:03 ` Christoph Hellwig
2012-01-25 21:38 ` Eric Sandeen [this message]
2012-01-25 21:38 ` [PATCH V2] " Eric Sandeen
2012-01-27 10:53 ` Christoph Hellwig
2012-01-27 10:53 ` Christoph Hellwig
2011-12-08 22:59 ` ceph and ext4 Christian Brunner
2011-12-09 22:24 ` Andreas Dilger
2012-02-12 4:05 ` Yehuda Sadeh Weinraub
2012-02-12 17:18 ` Andreas Dilger
2012-02-12 19:50 ` Yehuda Sadeh Weinraub
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F20766E.9040902@sandeen.net \
--to=sandeen@sandeen.net \
--cc=adilger@whamcloud.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@MIT.EDU \
--cc=xfs@oss.sgi.com \
--cc=yujian@whamcloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.