summaryrefslogtreecommitdiffstats
path: root/tools/regression/fstest/tests/rmdir/14.t
diff options
context:
space:
mode:
Diffstat (limited to 'tools/regression/fstest/tests/rmdir/14.t')
-rw-r--r--tools/regression/fstest/tests/rmdir/14.t32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/regression/fstest/tests/rmdir/14.t b/tools/regression/fstest/tests/rmdir/14.t
new file mode 100644
index 0000000..b195933
--- /dev/null
+++ b/tools/regression/fstest/tests/rmdir/14.t
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $FreeBSD$
+
+desc="rmdir returns EROFS if the named file resides on a read-only file system"
+
+dir=`dirname $0`
+. ${dir}/../misc.sh
+
+case "${os}:${fs}" in
+FreeBSD:UFS)
+ echo "1..5"
+
+ n0=`namegen`
+ n1=`namegen`
+
+ expect 0 mkdir ${n0} 0755
+ n=`mdconfig -a -n -t malloc -s 1m`
+ newfs /dev/md${n} >/dev/null
+ mount /dev/md${n} ${n0}
+ expect 0 mkdir ${n0}/${n1} 0755
+ mount -ur /dev/md${n}
+ expect EROFS rmdir ${n0}/${n1}
+ mount -uw /dev/md${n}
+ expect 0 rmdir ${n0}/${n1}
+ umount /dev/md${n}
+ mdconfig -d -u ${n}
+ expect 0 rmdir ${n0}
+ ;;
+*)
+ quick_exit
+ ;;
+esac
OpenPOWER on IntegriCloud