1271294Sngie#!/bin/sh 2271294Sngie# $FreeBSD: head/tools/regression/pjdfstest/tests/open/14.t 211352 2010-08-15 21:24:17Z pjd $ 3271294Sngie 4271294Sngiedesc="open returns EROFS if the named file resides on a read-only file system, and the file is to be modified" 5271294Sngie 6271294Sngiedir=`dirname $0` 7271294Sngie. ${dir}/../misc.sh 8271294Sngie 9271294Sngie[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit 10271294Sngie 11271294Sngieecho "1..10" 12271294Sngie 13271294Sngien0=`namegen` 14271294Sngien1=`namegen` 15271294Sngie 16271294Sngieexpect 0 mkdir ${n0} 0755 17275504Sngien=`mdconfig -a -n -t malloc -s 1m` || exit 18275504Sngienewfs /dev/md${n} >/dev/null || exit 19275504Sngiemount /dev/md${n} ${n0} || exit 20271294Sngieexpect 0 create ${n0}/${n1} 0644 21271294Sngieexpect 0 open ${n0}/${n1} O_WRONLY 22271294Sngieexpect 0 open ${n0}/${n1} O_RDWR 23271294Sngieexpect 0 open ${n0}/${n1} O_RDONLY,O_TRUNC 24271294Sngiemount -ur /dev/md${n} 25271294Sngieexpect EROFS open ${n0}/${n1} O_WRONLY 26271294Sngieexpect EROFS open ${n0}/${n1} O_RDWR 27271294Sngieexpect EROFS open ${n0}/${n1} O_RDONLY,O_TRUNC 28271294Sngiemount -uw /dev/md${n} 29271294Sngieexpect 0 unlink ${n0}/${n1} 30271294Sngieumount /dev/md${n} 31275504Sngiemdconfig -d -u ${n} || exit 32271294Sngieexpect 0 rmdir ${n0} 33