155682Smarkm#!/bin/sh 2233294Sstas# $FreeBSD: head/tools/regression/pjdfstest/tests/rename/20.t 211352 2010-08-15 21:24:17Z pjd $ 355682Smarkm 455682Smarkmdesc="rename returns EEXIST or ENOTEMPTY if the 'to' argument is a directory and is not empty" 5233294Sstas 655682Smarkmdir=`dirname $0` 755682Smarkm. ${dir}/../misc.sh 855682Smarkm 9233294Sstasecho "1..25" 1055682Smarkm 1155682Smarkmn0=`namegen` 12233294Sstasn1=`namegen` 1355682Smarkmn2=`namegen` 1455682Smarkm 1555682Smarkmexpect 0 mkdir ${n0} 0755 16233294Sstasexpect 0 mkdir ${n1} 0755 1755682Smarkm 1855682Smarkmfor type in regular dir fifo block char socket symlink; do 1955682Smarkm create_file ${type} ${n1}/${n2} 20233294Sstas expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1} 2155682Smarkm if [ "${type}" = "dir" ]; then 2255682Smarkm expect 0 rmdir ${n1}/${n2} 2355682Smarkm else 2455682Smarkm expect 0 unlink ${n1}/${n2} 2555682Smarkm fi 2655682Smarkmdone 2755682Smarkm 2855682Smarkmexpect 0 rmdir ${n1} 2955682Smarkmexpect 0 rmdir ${n0} 3055682Smarkm