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