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