xref: /freebsd/contrib/pjdfstest/tests/chmod/04.t (revision b2d48be1bc7df45ddd13b143a160d0acb5a383c5)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/chmod/04.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="chmod returns ENOENT if the named file does not exist"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9if supported lchmod; then
10	echo "1..9"
11else
12	echo "1..7"
13fi
14
15n0=`namegen`
16n1=`namegen`
17n2=`namegen`
18
19expect 0 mkdir ${n0} 0755
20expect ENOENT chmod ${n0}/${n1}/test 0644
21expect ENOENT chmod ${n0}/${n1} 0644
22if supported lchmod; then
23	expect ENOENT lchmod ${n0}/${n1}/test 0644
24	expect ENOENT lchmod ${n0}/${n1} 0644
25fi
26expect 0 symlink ${n2} ${n0}/${n1}
27expect ENOENT chmod ${n0}/${n1} 0644
28expect 0 unlink ${n0}/${n1}
29expect 0 rmdir ${n0}
30