xref: /freebsd/contrib/pjdfstest/tests/truncate/03.t (revision 531c2d7af3cd2e64eec94aa1b19c4b2f16fce515)
140a8ac8fSEnji Cooper#!/bin/sh
2*3416500aSEnji Cooper# vim: filetype=sh noexpandtab ts=8 sw=8
340a8ac8fSEnji Cooper# $FreeBSD: head/tools/regression/pjdfstest/tests/truncate/03.t 211352 2010-08-15 21:24:17Z pjd $
440a8ac8fSEnji Cooper
540a8ac8fSEnji Cooperdesc="truncate returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
640a8ac8fSEnji Cooper
740a8ac8fSEnji Cooperdir=`dirname $0`
840a8ac8fSEnji Cooper. ${dir}/../misc.sh
940a8ac8fSEnji Cooper
1040a8ac8fSEnji Cooperecho "1..5"
1140a8ac8fSEnji Cooper
1240a8ac8fSEnji Coopernx=`dirgen_max`
1340a8ac8fSEnji Coopernxx="${nx}x"
1440a8ac8fSEnji Cooper
1540a8ac8fSEnji Coopermkdir -p "${nx%/*}"
1640a8ac8fSEnji Cooper
1740a8ac8fSEnji Cooperexpect 0 create ${nx} 0644
1840a8ac8fSEnji Cooperexpect 0 truncate ${nx} 123
1940a8ac8fSEnji Cooperexpect regular,123 stat ${nx} type,size
2040a8ac8fSEnji Cooperexpect 0 unlink ${nx}
2140a8ac8fSEnji Cooperexpect ENAMETOOLONG truncate ${nxx} 123
2240a8ac8fSEnji Cooper
2340a8ac8fSEnji Cooperrm -rf "${nx%%/*}"
24