1166065Spjd#!/bin/sh 2166065Spjd# $FreeBSD: releng/10.2/tools/regression/pjdfstest/tests/open/14.t 210984 2010-08-06 23:58:54Z pjd $ 3166065Spjd 4166065Spjddesc="open returns EROFS if the named file resides on a read-only file system, and the file is to be modified" 5166065Spjd 6166065Spjddir=`dirname $0` 7166065Spjd. ${dir}/../misc.sh 8166065Spjd 9210984Spjd[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit 10166065Spjd 11210984Spjdecho "1..10" 12166065Spjd 13210984Spjdn0=`namegen` 14210984Spjdn1=`namegen` 15210984Spjd 16210984Spjdexpect 0 mkdir ${n0} 0755 17210984Spjdn=`mdconfig -a -n -t malloc -s 1m` 18210984Spjdnewfs /dev/md${n} >/dev/null 19210984Spjdmount /dev/md${n} ${n0} 20210984Spjdexpect 0 create ${n0}/${n1} 0644 21210984Spjdexpect 0 open ${n0}/${n1} O_WRONLY 22210984Spjdexpect 0 open ${n0}/${n1} O_RDWR 23210984Spjdexpect 0 open ${n0}/${n1} O_RDONLY,O_TRUNC 24210984Spjdmount -ur /dev/md${n} 25210984Spjdexpect EROFS open ${n0}/${n1} O_WRONLY 26210984Spjdexpect EROFS open ${n0}/${n1} O_RDWR 27210984Spjdexpect EROFS open ${n0}/${n1} O_RDONLY,O_TRUNC 28210984Spjdmount -uw /dev/md${n} 29210984Spjdexpect 0 unlink ${n0}/${n1} 30210984Spjdumount /dev/md${n} 31210984Spjdmdconfig -d -u ${n} 32210984Spjdexpect 0 rmdir ${n0} 33