xref: /freebsd/contrib/pjdfstest/tests/mkdir/11.t (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/mkdir/11.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="mkdir returns ENOSPC if there are no free inodes on the file system on which the directory 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	mkdir ${n0}/${i} >/dev/null 2>&1
24	if [ $? -ne 0 ]; then
25		break
26	fi
27	i=`expr $i + 1`
28done
29expect ENOSPC mkdir ${n0}/${n1} 0755
30umount /dev/md${n}
31mdconfig -d -u ${n} || exit
32expect 0 rmdir ${n0}
33