Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] erofs-utils: tests: check xattrs for all descendants under target directory
@ 2023-06-14  3:26 Jingbo Xu
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Jingbo Xu @ 2023-06-14  3:26 UTC (permalink / raw)
  To: hsiangkao, linux-erofs; +Cc: huyue2

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


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

end of thread, other threads:[~2023-06-14  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14  3:26 [PATCH 1/2] erofs-utils: tests: check xattrs for all descendants under target directory Jingbo Xu
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

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