15.t revision 256281
172172Sphantom#!/bin/sh
2290494Sbapt# $FreeBSD: stable/10/tools/regression/pjdfstest/tests/link/15.t 210984 2010-08-06 23:58:54Z pjd $
3290494Sbapt
472172Sphantomdesc="link returns ENOSPC if the directory in which the entry for the new link is being placed cannot be extended because there is no space left on the file system containing the directory"
5290083Sbdrewery
6290494Sbaptdir=`dirname $0`
7290494Sbapt. ${dir}/../misc.sh
872172Sphantom
972172Sphantom[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit
10290494Sbapt
1172172Sphantomecho "1..4"
12290494Sbapt
13290494Sbaptn0=`namegen`
14290494Sbaptn1=`namegen`
15290494Sbaptn2=`namegen`
16290494Sbapt
17290494Sbaptexpect 0 mkdir ${n0} 0755
18290494Sbaptn=`mdconfig -a -n -t malloc -s 256k`
19290494Sbaptnewfs /dev/md${n} >/dev/null
20290494Sbaptmount /dev/md${n} ${n0}
21290494Sbaptexpect 0 create ${n0}/${n1} 0644
22290494Sbapti=0
23290494Sbaptwhile :; do
24290494Sbapt	link ${n0}/${n1} ${n0}/${i} >/dev/null 2>&1
25290494Sbapt	if [ $? -ne 0 ]; then
26290494Sbapt		break
27290494Sbapt	fi
28290866Sbapt	i=`expr $i + 1`
29290494Sbaptdone
30290494Sbaptexpect ENOSPC link ${n0}/${n1} ${n0}/${n2}
31290494Sbaptumount /dev/md${n}
32290494Sbaptmdconfig -d -u ${n}
33290494Sbaptexpect 0 rmdir ${n0}
34290494Sbapt