generic: convert tests to SPDX license tags
[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 # Something w/ enough data to fill 50M of fs...
17 filler=/lib/modules/
18
19 # fall back in case /lib/modules doesn't exist
20 [ -d $filler ] || filler=/usr
21
22 _cleanup()
23 {
24         cd /
25         echo "*** unmount"
26         _scratch_unmount 2>/dev/null
27 }
28 trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
29
30 # get standard environment, filters and checks
31 . ./common/rc
32 . ./common/filter
33 . ./common/attr
34
35 # real QA test starts here
36 _supported_fs generic
37 _supported_os Linux
38
39 [ ! -d $filler ] && _notrun "No directory to source files from"
40
41 _require_scratch
42 _require_attrs
43 _require_acls
44 _require_user
45
46 echo "*** create filesystem"
47
48 rm -f $seqres.full
49 _scratch_unmount >/dev/null 2>&1
50 echo "*** MKFS ***"                         >>$seqres.full
51 echo ""                                     >>$seqres.full
52 SIZE=`expr 50 \* 1024 \* 1024`
53 _scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
54         || _fail "mkfs failed"
55 _scratch_mount
56 mkdir $SCRATCH_MNT/subdir
57
58 echo "*** set default ACL"
59 setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx $SCRATCH_MNT/subdir
60
61 echo "*** populate filesystem, pass #1" | tee -a $seqres.full
62 cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
63
64 echo "*** populate filesystem, pass #2" | tee -a $seqres.full
65 cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
66
67 _check_scratch_fs
68
69 echo "*** all done"
70 rm -f $seqres.full
71 status=0
72 exit