xref: /freebsd/contrib/pjdfstest/tests/rmdir/13.t (revision 2a243b9539a45b392a515569cab2091844cf2bdf)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/rmdir/13.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="rmdir returns EBUSY if the directory to be removed is the mount point for a mounted file system"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10[ "${os}" = "FreeBSD" ] || quick_exit
11
12echo "1..3"
13
14n0=`namegen`
15
16expect 0 mkdir ${n0} 0755
17n=`mdconfig -a -n -t malloc -s 1m` || exit
18newfs /dev/md${n} >/dev/null || exit
19mount /dev/md${n} ${n0} || exit
20expect EBUSY rmdir ${n0}
21umount /dev/md${n}
22mdconfig -d -u ${n} || exit
23expect 0 rmdir ${n0}
24