From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: hsiangkao@linux.alibaba.com, linux-erofs@lists.ozlabs.org
Cc: huyue2@coolpad.com
Subject: [PATCH 1/2] erofs-utils: tests: check xattrs for all descendants under target directory
Date: Wed, 14 Jun 2023 11:26:41 +0800 [thread overview]
Message-ID: <20230614032642.8186-1-jefflexu@linux.alibaba.com> (raw)
Enhance _check_xattrs() helper checking all descendants under the
target directory.
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
tests/common/rc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/common/rc b/tests/common/rc
index dcd63a9..f234fdc 100644
--- a/tests/common/rc
+++ b/tests/common/rc
@@ -350,11 +350,11 @@ _check_xattrs()
{
local dir1="$1"
local dir2="$2"
- local dirs=`ls $dir1`
+ local entries=`find $dir1 -mindepth 1 -printf '%P\n' -type f`
- for d in $dirs; do
- xattr1=`getfattr --absolute-names -d $dir1/$d | tail -n+2`
- xattr2=`getfattr --absolute-names -d $dir2/$d | tail -n+2`
+ for entry in $entries; do
+ xattr1=`getfattr --absolute-names -d $dir1/$entry | tail -n+2`
+ xattr2=`getfattr --absolute-names -d $dir2/$entry | tail -n+2`
[ "x$xattr1" = "x$xattr2" ] || _fail "-->check xattrs FAILED"
done
}
--
1.8.3.1
next reply other threads:[~2023-06-14 3:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 3:26 Jingbo Xu [this message]
2023-06-14 3:26 ` [PATCH 2/2] erofs-utils: tests: add test for xattrs in random layouts Jingbo Xu
2023-06-14 7:49 ` [PATCH 1/2] erofs-utils: tests: check xattrs for all descendants under target directory Gao Xiang
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=20230614032642.8186-1-jefflexu@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=huyue2@coolpad.com \
--cc=linux-erofs@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox