generic/554: hide permision warning on exfat
[xfstests-dev.git] / tests / generic / 077
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 077
6 #
7 # Check use of ACLs (extended attributes) on a full filesystem
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1
16
17 # Something w/ enough data to fill 256M of fs...
18 filler=""
19 [ -d /lib/modules ] && \
20         [ $(( $(du -h -m /lib/modules | tail -1| cut -f1) * 2 )) -ge 256 ] && \
21         filler=/lib/modules
22
23 # fall back in case /lib/modules doesn't exist or smaller
24 [[ -z $filler ]] && \
25         [ -d /usr ] && \
26         [ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -ge 256 ] && \
27         filler=/usr
28
29 _cleanup()
30 {
31         cd /
32         echo "*** unmount"
33         _scratch_unmount 2>/dev/null
34 }
35 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
36
37 # get standard environment, filters and checks
38 . ./common/rc
39 . ./common/filter
40 . ./common/attr
41
42 # real QA test starts here
43 _supported_fs generic
44
45 [ ! -d $filler ] && _notrun "No directory at least 256MB to source files from"
46
47 _require_scratch
48 _require_attrs
49 _require_acls
50 _require_user
51
52 echo "*** create filesystem"
53
54 rm -f $seqres.full
55 _scratch_unmount >/dev/null 2>&1
56 echo "*** MKFS ***"                         >>$seqres.full
57 echo ""                                     >>$seqres.full
58 fs_size=$((256 * 1024 * 1024))
59 _scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
60 _scratch_mount
61 mkdir $SCRATCH_MNT/subdir
62
63 echo "*** set default ACL"
64 setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx $SCRATCH_MNT/subdir
65
66 echo "*** populate filesystem, pass #1" | tee -a $seqres.full
67 cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
68
69 echo "*** populate filesystem, pass #2" | tee -a $seqres.full
70 cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
71
72 _check_scratch_fs
73
74 echo "*** all done"
75 status=0
76 exit