summaryrefslogtreecommitdiff
path: root/tests/xattrs.script
blob: 8b7cb688d9426e79c6c56a4d66ea4da8a354d8e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -eu

umask 0002
mkdir -m 0775 "$DATADIR/xattrs"
touch "$DATADIR/xattrs/file"
if setfattr -n user.foo -v "$(printf '\177')" "$DATADIR/xattrs/file" 2> /dev/null &&
   setfattr -n user.empty -v '""' "$DATADIR/xattrs/file" 2> /dev/null
then
    ./summain --exclude=mtime --exclude=uid --exclude=username \
        --exclude=gid --exclude=group --exclude=ino --exclude=dev \
        --exclude=nlink --exclude=size --exclude=sha1 --exclude=sha256 \
        --relative "$DATADIR/xattrs"
else
    # Fake results when xattrs not available.
    cat "$SRCDIR/tests/xattrs.stdout"
fi