"Fossies" - the Fresh Open Source Software Archive

Member "lessfs-1.7.0/regression/pjd-fstest-20080816-lessfs/tests/rename/20.t" (29 Mar 2008, 815 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/rename/20.t,v 1.1 2007/01/17 01:42:10 pjd Exp $
    3 
    4 desc="rename returns EEXIST or ENOTEMPTY if the 'to' argument is a directory and is not empty"
    5 
    6 dir=`dirname $0`
    7 . ${dir}/../misc.sh
    8 
    9 echo "1..16"
   10 
   11 n0=`namegen`
   12 n1=`namegen`
   13 n2=`namegen`
   14 
   15 expect 0 mkdir ${n0} 0755
   16 expect 0 mkdir ${n1} 0755
   17 
   18 expect 0 create ${n1}/${n2} 0644
   19 expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1}
   20 expect 0 unlink ${n1}/${n2}
   21 
   22 expect 0 mkdir ${n1}/${n2} 0755
   23 expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1}
   24 expect 0 rmdir ${n1}/${n2}
   25 
   26 expect 0 mkfifo ${n1}/${n2} 0644
   27 expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1}
   28 expect 0 unlink ${n1}/${n2}
   29 
   30 expect 0 symlink test ${n1}/${n2}
   31 expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1}
   32 expect 0 unlink ${n1}/${n2}
   33 
   34 expect 0 rmdir ${n1}
   35 expect 0 rmdir ${n0}