turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / fstest / tests / rename / 06.t
blob880c6045081afb4bf064f7bae867149f546879d8
1 #!/bin/sh
2 # $FreeBSD$
4 desc="rename returns EPERM if the file pointed at by the 'from' argument has its immutable, undeletable or append-only flag set"
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
9 require chflags
11 echo "1..84"
13 n0=`namegen`
14 n1=`namegen`
16 expect 0 create ${n0} 0644
17 for flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do
18 expect 0 chflags ${n0} ${flag}
19 expect ${flag} stat ${n0} flags
20 expect EPERM rename ${n0} ${n1}
21 done
22 expect 0 chflags ${n0} none
23 expect 0 unlink ${n0}
25 expect 0 mkdir ${n0} 0755
26 for flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do
27 expect 0 chflags ${n0} ${flag}
28 expect ${flag} stat ${n0} flags
29 expect EPERM rename ${n0} ${n1}
30 done
31 expect 0 chflags ${n0} none
32 expect 0 rmdir ${n0}
34 expect 0 mkfifo ${n0} 0644
35 for flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do
36 expect 0 chflags ${n0} ${flag}
37 expect ${flag} stat ${n0} flags
38 expect EPERM rename ${n0} ${n1}
39 done
40 expect 0 chflags ${n0} none
41 expect 0 unlink ${n0}
43 expect 0 symlink ${n1} ${n0}
44 for flag in SF_IMMUTABLE UF_IMMUTABLE SF_APPEND UF_APPEND SF_NOUNLINK UF_NOUNLINK; do
45 expect 0 lchflags ${n0} ${flag}
46 expect ${flag} lstat ${n0} flags
47 expect EPERM rename ${n0} ${n1}
48 done
49 expect 0 lchflags ${n0} none
50 expect 0 unlink ${n0}