"Fossies" - the Fresh Open Source Software Archive

Member "lessfs-1.7.0/regression/pjd-fstest-20080816-lessfs/tests/link/16.t" (29 Mar 2008, 830 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/link/16.t,v 1.1 2007/01/17 01:42:09 pjd Exp $
    3 
    4 desc="link returns EROFS if the requested link requires writing in a directory on a read-only file system"
    5 
    6 dir=`dirname $0`
    7 . ${dir}/../misc.sh
    8 
    9 case "${os}" in
   10 FreeBSD)
   11     echo "1..9"
   12 
   13     n0=`namegen`
   14     n1=`namegen`
   15     n2=`namegen`
   16 
   17     expect 0 mkdir ${n0} 0755
   18     n=`mdconfig -a -n -t malloc -s 1m`
   19     newfs /dev/md${n} >/dev/null
   20     mount /dev/md${n} ${n0}
   21     expect 0 create ${n0}/${n1} 0644
   22 
   23     expect 0 link ${n0}/${n1} ${n0}/${n2}
   24     expect 0 unlink ${n0}/${n2}
   25     mount -ur /dev/md${n}
   26     expect EROFS link ${n0}/${n1} ${n0}/${n2}
   27     mount -uw /dev/md${n}
   28     expect 0 link ${n0}/${n1} ${n0}/${n2}
   29     expect 0 unlink ${n0}/${n2}
   30 
   31     expect 0 unlink ${n0}/${n1}
   32     umount /dev/md${n}
   33     mdconfig -d -u ${n}
   34     expect 0 rmdir ${n0}
   35     ;;
   36 *)
   37     quick_exit
   38     ;;
   39 esac