turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / fstest / tests / unlink / 10.t
blobcf4188a59ab19bb66ed2b95dd628b75f8e2b20d8
1 #!/bin/sh
2 # $FreeBSD$
4 desc="unlink returns EPERM if the parent directory of the named file has its immutable or append-only flag set"
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
9 require chflags
11 echo "1..30"
13 n0=`namegen`
14 n1=`namegen`
16 expect 0 mkdir ${n0} 0755
18 expect 0 create ${n0}/${n1} 0644
19 expect 0 chflags ${n0} SF_IMMUTABLE
20 expect EPERM unlink ${n0}/${n1}
21 expect 0 chflags ${n0} none
22 expect 0 unlink ${n0}/${n1}
24 expect 0 create ${n0}/${n1} 0644
25 expect 0 chflags ${n0} UF_IMMUTABLE
26 expect EPERM unlink ${n0}/${n1}
27 expect 0 chflags ${n0} none
28 expect 0 unlink ${n0}/${n1}
30 expect 0 create ${n0}/${n1} 0644
31 expect 0 chflags ${n0} SF_APPEND
32 expect EPERM unlink ${n0}/${n1}
33 expect 0 chflags ${n0} none
34 expect 0 unlink ${n0}/${n1}
36 expect 0 create ${n0}/${n1} 0644
37 expect 0 chflags ${n0} UF_APPEND
38 expect EPERM unlink ${n0}/${n1}
39 expect 0 chflags ${n0} none
40 expect 0 unlink ${n0}/${n1}
42 expect 0 create ${n0}/${n1} 0644
43 expect 0 chflags ${n0} SF_NOUNLINK
44 expect 0 unlink ${n0}/${n1}
45 expect 0 chflags ${n0} none
47 expect 0 create ${n0}/${n1} 0644
48 expect 0 chflags ${n0} UF_NOUNLINK
49 expect 0 unlink ${n0}/${n1}
50 expect 0 chflags ${n0} none
52 expect 0 rmdir ${n0}