xref: /freebsd/contrib/pjdfstest/tests/chflags/02.t (revision 09a53ad8f1318c5daae6cfb19d97f4f6459f0013)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/chflags/02.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="chflags returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9require chflags
10
11echo "1..12"
12
13nx=`namegen_max`
14nxx="${nx}x"
15
16expect 0 create ${nx} 0644
17expect 0 chflags ${nx} SF_IMMUTABLE
18expect SF_IMMUTABLE stat ${nx} flags
19expect 0 chflags ${nx} none
20expect 0 unlink ${nx}
21expect ENAMETOOLONG chflags ${nxx} SF_IMMUTABLE
22
23expect 0 create ${nx} 0644
24expect 0 lchflags ${nx} SF_IMMUTABLE
25expect SF_IMMUTABLE stat ${nx} flags
26expect 0 lchflags ${nx} none
27expect 0 unlink ${nx}
28expect ENAMETOOLONG lchflags ${nxx} SF_IMMUTABLE
29