xref: /openbsd/regress/sys/ffs/tests/mkdir/11.t (revision 7b36286a)
1#!/bin/sh
2# $FreeBSD: src/tools/regression/fstest/tests/mkdir/11.t,v 1.1 2007/01/17 01:42:09 pjd Exp $
3
4desc="mkdir returns ENOSPC if there are no free inodes on the file system on which the directory is being created"
5
6n0=`namegen`
7n1=`namegen`
8
9expect 0 mkdir ${n0} 0755
10dd if=/dev/zero of=tmpdisk bs=1k count=256 2>/dev/null
11vnconfig svnd1 tmpdisk
12newfs /dev/rsvnd1c >/dev/null
13mount /dev/svnd1c ${n0}
14i=0
15while :; do
16	mkdir ${n0}/${i} >/dev/null 2>&1
17	if [ $? -ne 0 ]; then
18		break
19	fi
20	i=`expr $i + 1`
21done
22expect ENOSPC mkdir ${n0}/${n1} 0755
23umount /dev/svnd1c
24vnconfig -u svnd1
25rm tmpdisk
26expect 0 rmdir ${n0}
27