mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fstests: filter redundant output by getfattr
When getfattr dumps values of all extended attributes (-d option),
it doesn't print empty extended attributes. e.g: user.name. But from
attr-2.4.48 this behavior is changed, new getfattr prints
user.name="".
The {=""} will break the golden image, so filter the redundant =""
at the end if it has.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+4
-4
@@ -41,9 +41,9 @@ _attr()
|
||||
return $exit
|
||||
}
|
||||
|
||||
_getfattr()
|
||||
do_getfattr()
|
||||
{
|
||||
${GETFATTR_PROG} $* 2>$tmp.err >$tmp.out
|
||||
_getfattr $* 2>$tmp.err >$tmp.out
|
||||
exit=$?
|
||||
sed \
|
||||
-e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
|
||||
@@ -79,7 +79,7 @@ echo "*** make test file 1"
|
||||
touch $testfile.1
|
||||
echo "v1" | _attr -s "a1" $testfile.1 >/dev/null
|
||||
echo "v2--" | _attr -s "a2--" $testfile.1 >/dev/null
|
||||
_getfattr --absolute-names $testfile.1
|
||||
do_getfattr --absolute-names $testfile.1
|
||||
inum_1=`ls -li $testfile.1 | $AWK_PROG '{ print $1 }'`
|
||||
|
||||
echo "*** make test file 2"
|
||||
@@ -89,7 +89,7 @@ echo "value_1" | _attr -s "a1" $testfile.2 >/dev/null
|
||||
echo "value_2" | _attr -s "a2-----" $testfile.2 >/dev/null
|
||||
( echo start; POSIXLY_CORRECT=yes dd if=/dev/zero bs=65525 count=1; echo end )\
|
||||
| _attr -s "a3" $testfile.2 >/dev/null
|
||||
_getfattr --absolute-names $testfile.2
|
||||
do_getfattr --absolute-names $testfile.2
|
||||
|
||||
# print name and size from 1st line of output
|
||||
_attr -g "a3" $testfile.2 > $tmp.hahahahaplonk
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ _scratch_mount -o noattr2
|
||||
cd $SCRATCH_MNT
|
||||
touch testfile
|
||||
$SETFATTR_PROG -n user.test -v 0xbabe testfile
|
||||
$GETFATTR_PROG testfile
|
||||
_getfattr testfile
|
||||
cd $here
|
||||
$UMOUNT_PROG $SCRATCH_MNT
|
||||
_scratch_xfs_db -r -c version 2>&1 | _filter_version
|
||||
|
||||
Reference in New Issue
Block a user