mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-03 10:55:20 +00:00
New versions of getfattr will quote empty attr values.
Instead of messing with quotes and using grep for the correct xattr name, directly query the value of the xattr being tested only, and compare that to the input. Side effect is that this is significantly simpler and faster. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -27,15 +27,9 @@ test_xattr_lengths() {
|
||||
echo "key len $name_len val len $val_len" >> "$T_TMP.log"
|
||||
setfattr -n $name -v \"$val\" "$FILE"
|
||||
|
||||
# grep has trouble with enormous args? so we dump the
|
||||
# name=value to a file and compare with a known good file
|
||||
getfattr -d --absolute-names "$FILE" | grep "$name" > "$T_TMP.got"
|
||||
getfattr -d --only-values --absolute-names "$FILE" -n "$name" > "$T_TMP.got"
|
||||
echo -n "$val" > "$T_TMP.good"
|
||||
|
||||
if [ $val_len == 0 ]; then
|
||||
echo "$name" > "$T_TMP.good"
|
||||
else
|
||||
echo "$name=\"$val\"" > "$T_TMP.good"
|
||||
fi
|
||||
cmp "$T_TMP.good" "$T_TMP.got" || \
|
||||
t_fail "cmp failed name len $name_len val len $val_len"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user