xref: /openbsd/regress/sys/ffs/tests/mkfifo/11.t (revision 5af055cd)
1#!/bin/sh
2# $FreeBSD: src/tools/regression/fstest/tests/mkfifo/11.t,v 1.1 2007/01/17 01:42:09 pjd Exp $
3
4desc="mkfifo returns ENOSPC if there are no free inodes on the file system on which the file 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 vnd1 tmpdisk
12newfs /dev/rvnd1c >/dev/null
13mount /dev/vnd1c ${n0}
14i=0
15while :; do
16	mkfifo ${n0}/${i} >/dev/null 2>&1
17	if [ $? -ne 0 ]; then
18		break
19	fi
20	i=`expr $i + 1`
21done
22expect ENOSPC mkfifo ${n0}/${n1} 0644
23umount /dev/vnd1c
24vnconfig -u vnd1
25rm tmpdisk
26expect 0 rmdir ${n0}
27