1#!/bin/sh
| 1#!/bin/sh
|
2# $FreeBSD: head/tools/regression/fstest/tests/link/03.t 166065 2007-01-17 01:42:12Z pjd $
| 2# $FreeBSD: head/tools/regression/fstest/tests/link/03.t 211178 2010-08-11 16:33:17Z pjd $
|
3
| 3
|
4desc="link returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters"
| 4desc="link returns ENAMETOOLONG if an entire length of either path name exceeded {PATH_MAX} characters"
|
5 6dir=`dirname $0` 7. ${dir}/../misc.sh 8
| 5 6dir=`dirname $0` 7. ${dir}/../misc.sh 8
|
9echo "1..16"
| 9echo "1..13"
|
10 11n0=`namegen`
| 10 11n0=`namegen`
|
| 12nx=`dirgen_max` 13nxx="${nx}x"
|
12
| 14
|
13expect 0 mkdir ${name255} 0755 14expect 0 mkdir ${name255}/${name255} 0755 15expect 0 mkdir ${name255}/${name255}/${name255} 0755 16expect 0 mkdir ${path1021} 0755 17expect 0 create ${path1023} 0644 18expect 0 link ${path1023} ${n0} 19expect 0 unlink ${path1023} 20expect 0 link ${n0} ${path1023} 21expect 0 unlink ${path1023} 22expect ENAMETOOLONG link ${n0} ${path1024}
| 15mkdir -p "${nx%/*}" 16 17expect 0 create ${nx} 0644 18expect 0 link ${nx} ${n0} 19expect 2 stat ${n0} nlink 20expect 2 stat ${nx} nlink 21expect 0 unlink ${nx} 22expect 0 link ${n0} ${nx} 23expect 2 stat ${n0} nlink 24expect 2 stat ${nx} nlink 25expect 0 unlink ${nx} 26expect ENAMETOOLONG link ${n0} ${nxx} 27expect 1 stat ${n0} nlink
|
23expect 0 unlink ${n0}
| 28expect 0 unlink ${n0}
|
24expect ENAMETOOLONG link ${path1024} ${n0} 25expect 0 rmdir ${path1021} 26expect 0 rmdir ${name255}/${name255}/${name255} 27expect 0 rmdir ${name255}/${name255} 28expect 0 rmdir ${name255}
| 29expect ENAMETOOLONG link ${nxx} ${n0} 30 31rm -rf "${nx%%/*}"
|
| |