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