xref: /freebsd/contrib/pjdfstest/tests/link/15.t (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/link/15.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="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"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit
11
12echo "1..4"
13
14n0=`namegen`
15n1=`namegen`
16n2=`namegen`
17
18expect 0 mkdir ${n0} 0755
19n=`mdconfig -a -n -t malloc -s 512k` || exit
20newfs /dev/md${n} >/dev/null || exit
21mount /dev/md${n} ${n0} || exit
22expect 0 create ${n0}/${n1} 0644
23i=0
24while :; do
25	link ${n0}/${n1} ${n0}/${i} >/dev/null 2>&1
26	if [ $? -ne 0 ]; then
27		break
28	fi
29	i=`expr $i + 1`
30done
31expect ENOSPC link ${n0}/${n1} ${n0}/${n2}
32umount /dev/md${n}
33mdconfig -d -u ${n} || exit
34expect 0 rmdir ${n0}
35