xref: /freebsd/contrib/pjdfstest/tests/mkdir/11.t (revision 4ba73429a3a213248fbf8f0e124ca428e1d824ea)
140a8ac8fSEnji Cooper#!/bin/sh
240a8ac8fSEnji Cooper# $FreeBSD: head/tools/regression/pjdfstest/tests/mkdir/11.t 211352 2010-08-15 21:24:17Z pjd $
340a8ac8fSEnji Cooper
440a8ac8fSEnji Cooperdesc="mkdir returns ENOSPC if there are no free inodes on the file system on which the directory is being created"
540a8ac8fSEnji Cooper
640a8ac8fSEnji Cooperdir=`dirname $0`
740a8ac8fSEnji Cooper. ${dir}/../misc.sh
840a8ac8fSEnji Cooper
940a8ac8fSEnji Cooper[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit
1040a8ac8fSEnji Cooper
1140a8ac8fSEnji Cooperecho "1..3"
1240a8ac8fSEnji Cooper
1340a8ac8fSEnji Coopern0=`namegen`
1440a8ac8fSEnji Coopern1=`namegen`
1540a8ac8fSEnji Cooper
1640a8ac8fSEnji Cooperexpect 0 mkdir ${n0} 0755
17*4ba73429SEnji Coopern=`mdconfig -a -n -t malloc -s 512k` || exit
18*4ba73429SEnji Coopernewfs /dev/md${n} >/dev/null || exit
19*4ba73429SEnji Coopermount /dev/md${n} ${n0} || exit
2040a8ac8fSEnji Cooperi=0
2140a8ac8fSEnji Cooperwhile :; do
2240a8ac8fSEnji Cooper	mkdir ${n0}/${i} >/dev/null 2>&1
2340a8ac8fSEnji Cooper	if [ $? -ne 0 ]; then
2440a8ac8fSEnji Cooper		break
2540a8ac8fSEnji Cooper	fi
2640a8ac8fSEnji Cooper	i=`expr $i + 1`
2740a8ac8fSEnji Cooperdone
2840a8ac8fSEnji Cooperexpect ENOSPC mkdir ${n0}/${n1} 0755
2940a8ac8fSEnji Cooperumount /dev/md${n}
30*4ba73429SEnji Coopermdconfig -d -u ${n} || exit
3140a8ac8fSEnji Cooperexpect 0 rmdir ${n0}
32