12.t revision 166065
1#!/bin/sh 2# $FreeBSD: head/tools/regression/fstest/tests/chflags/12.t 166065 2007-01-17 01:42:12Z pjd $ 3 4desc="chflags returns EROFS if the named file resides on a read-only file system" 5 6dir=`dirname $0` 7. ${dir}/../misc.sh 8 9require chflags 10 11case "${os}:${fs}" in 12FreeBSD:UFS) 13 echo "1..14" 14 15 n0=`namegen` 16 n1=`namegen` 17 18 expect 0 mkdir ${n0} 0755 19 n=`mdconfig -a -n -t malloc -s 1m` 20 newfs /dev/md${n} >/dev/null 21 mount /dev/md${n} ${n0} 22 expect 0 create ${n0}/${n1} 0644 23 expect 0 chflags ${n0}/${n1} UF_IMMUTABLE 24 expect UF_IMMUTABLE stat ${n0}/${n1} flags 25 expect 0 chflags ${n0}/${n1} none 26 expect none stat ${n0}/${n1} flags 27 mount -ur /dev/md${n} 28 expect EROFS chflags ${n0}/${n1} UF_IMMUTABLE 29 expect none stat ${n0}/${n1} flags 30 mount -uw /dev/md${n} 31 expect 0 chflags ${n0}/${n1} UF_IMMUTABLE 32 expect UF_IMMUTABLE stat ${n0}/${n1} flags 33 expect 0 chflags ${n0}/${n1} none 34 expect none stat ${n0}/${n1} flags 35 expect 0 unlink ${n0}/${n1} 36 umount /dev/md${n} 37 mdconfig -d -u ${n} 38 expect 0 rmdir ${n0} 39 ;; 40*) 41 quick_exit 42 ;; 43esac 44