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