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:
Zorro Lang
2018-08-23 10:41:24 +08:00
committed by Eryu Guan
parent 84fdfc5d8a
commit 794f4594fb
24 changed files with 55 additions and 41 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
getfattr()
{
$GETFATTR_PROG --absolute-names -dh $@ 2>&1 | _filter_scratch
_getfattr --absolute-names -dh $@ 2>&1 | _filter_scratch
}
setfattr()
@@ -166,7 +166,7 @@ _backup()
# we *do* sort the output by path, since it otherwise would depend on
# readdir order, which on some filesystems may change after re-creating
# the files.
$GETFATTR_PROG --absolute-names -dh -R -m '.' $SCRATCH_MNT | _sort_getfattr_output >$1
_getfattr --absolute-names -dh -R -m '.' $SCRATCH_MNT | _sort_getfattr_output >$1
echo BACKUP $1 >>$seqres.full
cat $1 >> $seqres.full
[ ! -s $1 ] && echo "warning: $1 (backup file) is empty"