]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/pjdfstest/tests/chflags/02.t
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / pjdfstest / tests / chflags / 02.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 desc="chflags returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
5
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
8
9 require chflags
10
11 echo "1..12"
12
13 nx=`namegen_max`
14 nxx="${nx}x"
15
16 expect 0 create ${nx} 0644
17 expect 0 chflags ${nx} SF_IMMUTABLE
18 expect SF_IMMUTABLE stat ${nx} flags
19 expect 0 chflags ${nx} none
20 expect 0 unlink ${nx}
21 expect ENAMETOOLONG chflags ${nxx} SF_IMMUTABLE
22
23 expect 0 create ${nx} 0644
24 expect 0 lchflags ${nx} SF_IMMUTABLE
25 expect SF_IMMUTABLE stat ${nx} flags
26 expect 0 lchflags ${nx} none
27 expect 0 unlink ${nx}
28 expect ENAMETOOLONG lchflags ${nxx} SF_IMMUTABLE