]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/fs/misc/acl.sh
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / qa / workunits / fs / misc / acl.sh
1 #!/bin/sh -x
2
3 set -e
4 mkdir -p testdir
5 cd testdir
6
7 set +e
8 setfacl -d -m u:nobody:rw .
9 if test $? != 0; then
10 echo "Filesystem does not support ACL"
11 exit 0
12 fi
13
14 expect_failure() {
15 if "$@"; then return 1; else return 0; fi
16 }
17
18 set -e
19 c=0
20 while [ $c -lt 100 ]
21 do
22 c=`expr $c + 1`
23 # inherited ACL from parent directory's default ACL
24 mkdir d1
25 c1=`getfacl d1 | grep -c "nobody:rw"`
26 echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null
27 c2=`getfacl d1 | grep -c "nobody:rw"`
28 rmdir d1
29 if [ $c1 -ne 2 ] || [ $c2 -ne 2 ]
30 then
31 echo "ERROR: incorrect ACLs"
32 exit 1
33 fi
34 done
35
36 mkdir d1
37
38 # The ACL xattr only contains ACL header. ACL should be removed
39 # in this case.
40 setfattr -n system.posix_acl_access -v 0x02000000 d1
41 setfattr -n system.posix_acl_default -v 0x02000000 .
42
43 expect_failure getfattr -n system.posix_acl_access d1
44 expect_failure getfattr -n system.posix_acl_default .
45
46
47 rmdir d1
48 cd ..
49 rmdir testdir
50 echo OK