summaryrefslogtreecommitdiff
path: root/regress/sys/ffs/tests/chmod/09.t
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-03-30 19:02:53 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-03-30 19:02:53 +0000
commita43ee3c02d87b24b5d42a21bea8c53251ff63ba1 (patch)
treebd8ac259df6b2244d1a16cb5cb1b652eeaff32d6 /regress/sys/ffs/tests/chmod/09.t
parent01d780afe96118f9a23cd8132c1965c12c6ddb17 (diff)
Add regression test suite for FFS, from FreeBSD, okay art@ deraadt@
Diffstat (limited to 'regress/sys/ffs/tests/chmod/09.t')
-rw-r--r--regress/sys/ffs/tests/chmod/09.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/regress/sys/ffs/tests/chmod/09.t b/regress/sys/ffs/tests/chmod/09.t
new file mode 100644
index 00000000000..326e105771a
--- /dev/null
+++ b/regress/sys/ffs/tests/chmod/09.t
@@ -0,0 +1,27 @@
+#!/bin/sh
+# $FreeBSD: src/tools/regression/fstest/tests/chmod/09.t,v 1.1 2007/01/17 01:42:08 pjd Exp $
+
+desc="chmod returns EROFS if the named file resides on a read-only file system"
+
+n0=`namegen`
+n1=`namegen`
+
+expect 0 mkdir ${n0} 0755
+dd if=/dev/zero of=tmpdisk bs=1k count=1024 2>/dev/null
+vnconfig svnd1 tmpdisk
+newfs /dev/rsvnd1c >/dev/null
+mount /dev/svnd1c ${n0}
+expect 0 create ${n0}/${n1} 0644
+expect 0 chmod ${n0}/${n1} 0640
+expect 0640 stat ${n0}/${n1} mode
+mount -ur /dev/svnd1c
+expect EROFS chmod ${n0}/${n1} 0600
+expect 0640 stat ${n0}/${n1} mode
+mount -uw /dev/svnd1c
+expect 0 chmod ${n0}/${n1} 0600
+expect 0600 stat ${n0}/${n1} mode
+expect 0 unlink ${n0}/${n1}
+umount /dev/svnd1c
+vnconfig -u svnd1
+rm tmpdisk
+expect 0 rmdir ${n0}