"Fossies" - the Fresh Open Source Software Archive

Member "lessfs-1.7.0/regression/pjd-fstest-20080816-lessfs/tests/chmod/09.t" (29 Mar 2008, 828 Bytes) of package /linux/misc/old/lessfs-1.7.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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