xref: /freebsd/contrib/pjdfstest/tests/truncate/12.t (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/truncate/12.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="truncate returns EFBIG or EINVAL if the length argument was greater than the maximum file size"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..3"
11
12n0=`namegen`
13
14expect 0 create ${n0} 0644
15r=`${fstest} truncate ${n0} 999999999999999 2>/dev/null`
16case "${r}" in
17EFBIG|EINVAL)
18	expect 0 stat ${n0} size
19	;;
200)
21	expect 999999999999999 stat ${n0} size
22	;;
23*)
24	echo "not ok ${ntest}"
25	ntest=`expr ${ntest} + 1`
26	;;
27esac
28expect 0 unlink ${n0}
29