erofs-utils: tests: check xattrs for all descendants under target directory
PATCH 1/2 erofs-utils: tests: check xattrs for all descendants under target directory
Enhance _check_xattrs() helper checking all descendants under the target directory.
--- tests/common/rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tests/common/rc +4 -4
@@ -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 }
Signature · 1 line
1.8.3.1
PATCH 2/2 erofs-utils: tests: add test for xattrs in random layouts
Generate and check random xattrs. Set xattrs on tested file as much as possible until the number or size of xattrs has reached the upper limit for single file, e.g. maximum one block size for xattrs for single file in ext4.
The same xattr may be shared among multiple tested files or not. Thus the layout of mixed inline and shared xattrs is tested.
--- tests/Makefile.am | 3 ++ tests/erofs/023 | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/erofs/023.out | 2 + 3 files changed, 109 insertions(+) create mode 100755 tests/erofs/023 create mode 100644 tests/erofs/023.out
tests/Makefile.am +3 -0
@@ -100,6 +100,9 @@ TESTS += erofs/021 # 022 - check long extended attribute name prefixes TESTS += erofs/022 +# 023 - check extended attributes in random layouts +TESTS += erofs/023 + EXTRA_DIST = common/rc erofs clean-local: clean-local-check
tests/erofs/023 new file +104 -0
104 lines not on this page · raw message
tests/erofs/023.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 023 +Silence is golden
Signature · 1 line
1.8.3.1
Quoted 4 lines · Jingbo Xu
Enhance
_check_xattrs()helper checking all descendants under the target directory.Signed-off-by Jingbo Xu <[email protected]>
I've folded this patch into
"erofs-utils: tests: add generic helper for xattrs"
Thanks,
Gao Xiang