117680Spst#!/bin/sh
298527Sfenner# $FreeBSD: src/tools/regression/fstest/tests/link/15.t,v 1.1 2007/01/17 01:42:09 pjd Exp $
317680Spst
417680Spstdesc="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"
517680Spst
617680Spstn0=`namegen`
717680Spstn1=`namegen`
817680Spstn2=`namegen`
917680Spst
1017680Spstexpect 0 mkdir ${n0} 0755
1117680Spstdd if=/dev/zero of=tmpdisk bs=1k count=256 status=none
1217680Spstvnconfig vnd1 tmpdisk
1317680Spstnewfs /dev/rvnd1c >/dev/null
1417680Spstmount /dev/vnd1c ${n0}
1517680Spstexpect 0 create ${n0}/${n1} 0644
1617680Spsti=0
1717680Spstwhile :; do
1817680Spst	ln ${n0}/${n1} ${n0}/${i} 2>/dev/null
1917680Spst	if [ $? -ne 0 ]; then
2017680Spst		break
2153146Sbrian	fi
22172686Smlaier	i=$((i + 1))
2317680Spstdone
2417680Spstexpect ENOSPC link ${n0}/${n1} ${n0}/${n2}
2517680Spstumount /dev/vnd1c
2617680Spstvnconfig -u vnd1
2717680Spstrm tmpdisk
2817680Spstexpect 0 rmdir ${n0}
2917680Spst