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
+4 -4
View File
@@ -35,9 +35,9 @@ _attr()
return $exit
}
_getfattr()
do_getfattr()
{
$GETFATTR_PROG $* 2>$tmp.err >$tmp.out
_getfattr $* 2>$tmp.err >$tmp.out
exit=$?
_filter $tmp.out
_filter $tmp.err 1>&2
@@ -49,7 +49,7 @@ _attr_list()
file=$1
echo " *** print attributes"
if ! _getfattr -d -e text --absolute-names $file
if ! do_getfattr -d -e text --absolute-names $file
then
echo " !!! error return"
return 1
@@ -110,7 +110,7 @@ done
echo "*** check"
# don't print it all out...
getfattr --absolute-names $testfile \
_getfattr --absolute-names $testfile \
| tee -a $seqres.full \
| $AWK_PROG '
/^#/ { next }