]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - tools/regression/pjdfstest/tests/chmod/04.t
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / tools / regression / pjdfstest / tests / chmod / 04.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 desc="chmod returns ENOENT if the named file does not exist"
5
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
8
9 if supported lchmod; then
10         echo "1..9"
11 else
12         echo "1..7"
13 fi
14
15 n0=`namegen`
16 n1=`namegen`
17 n2=`namegen`
18
19 expect 0 mkdir ${n0} 0755
20 expect ENOENT chmod ${n0}/${n1}/test 0644
21 expect ENOENT chmod ${n0}/${n1} 0644
22 if supported lchmod; then
23         expect ENOENT lchmod ${n0}/${n1}/test 0644
24         expect ENOENT lchmod ${n0}/${n1} 0644
25 fi
26 expect 0 symlink ${n2} ${n0}/${n1}
27 expect ENOENT chmod ${n0}/${n1} 0644
28 expect 0 unlink ${n0}/${n1}
29 expect 0 rmdir ${n0}