turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / fstest / tests / unlink / 09.t
blobc069b0dc1e44c368d778ffcacb16dc667ffa5e93
1 #!/bin/sh
2 # $FreeBSD$
4 desc="unlink returns EPERM if the named file has its immutable, undeletable or append-only flag set"
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
9 require chflags
11 echo "1..30"
13 n0=`namegen`
15 expect 0 create ${n0} 0644
16 expect 0 chflags ${n0} SF_IMMUTABLE
17 expect EPERM unlink ${n0}
18 expect 0 chflags ${n0} none
19 expect 0 unlink ${n0}
21 expect 0 create ${n0} 0644
22 expect 0 chflags ${n0} UF_IMMUTABLE
23 expect EPERM unlink ${n0}
24 expect 0 chflags ${n0} none
25 expect 0 unlink ${n0}
27 expect 0 create ${n0} 0644
28 expect 0 chflags ${n0} SF_NOUNLINK
29 expect EPERM unlink ${n0}
30 expect 0 chflags ${n0} none
31 expect 0 unlink ${n0}
33 expect 0 create ${n0} 0644
34 expect 0 chflags ${n0} UF_NOUNLINK
35 expect EPERM unlink ${n0}
36 expect 0 chflags ${n0} none
37 expect 0 unlink ${n0}
39 expect 0 create ${n0} 0644
40 expect 0 chflags ${n0} SF_APPEND
41 expect EPERM unlink ${n0}
42 expect 0 chflags ${n0} none
43 expect 0 unlink ${n0}
45 expect 0 create ${n0} 0644
46 expect 0 chflags ${n0} UF_APPEND
47 expect EPERM unlink ${n0}
48 expect 0 chflags ${n0} none
49 expect 0 unlink ${n0}