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:
+3
-3
@@ -58,7 +58,7 @@ testf() {
|
||||
|
||||
echo "Testing ${key} ($(hexbytes "${key}")) -> ${value}" >> $seqres.full
|
||||
|
||||
actual_value="$($GETFATTR_PROG --absolute-names --only-values -n "user.${key}" "${testfile}")"
|
||||
actual_value="$(_getfattr --absolute-names --only-values -n "user.${key}" "${testfile}")"
|
||||
if [ "${actual_value}" != "${value}" ]; then
|
||||
echo "Key ${key} has value ${actual_value}, expected ${value}."
|
||||
fi
|
||||
@@ -127,7 +127,7 @@ setf "zerojoin_moo\xe2\x80\x8ccow.txt" "zero width joiners"
|
||||
setf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks"
|
||||
setf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks"
|
||||
|
||||
$GETFATTR_PROG --absolute-names -d "${testfile}" >> $seqres.full
|
||||
_getfattr --absolute-names -d "${testfile}" >> $seqres.full
|
||||
|
||||
echo "Test files"
|
||||
testf "french_caf\xc3\xa9.txt" "NFC"
|
||||
@@ -175,7 +175,7 @@ testf "combmark_\xe1\x80\x9c\xe1\x80\xad\xe1\x80\xaf.txt" "combining marks"
|
||||
testf "combmark_\xe1\x80\x9c\xe1\x80\xaf\xe1\x80\xad.txt" "combining marks"
|
||||
|
||||
echo "Uniqueness of keys?"
|
||||
crazy_keys="$($GETFATTR_PROG --absolute-names -d "${testfile}" | egrep -c '(french_|chinese_|greek_|arabic_|urk)')"
|
||||
crazy_keys="$(_getfattr --absolute-names -d "${testfile}" | egrep -c '(french_|chinese_|greek_|arabic_|urk)')"
|
||||
expected_keys=11
|
||||
test "${crazy_keys}" -ne "${expected_keys}" && echo "Expected ${expected_keys} keys, saw ${crazy_keys}."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user