xref: /freebsd/contrib/pjdfstest/tests/rename/14.t (revision a0ee8cc636cd5c2374ec44ca71226564ea0bca95)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/rename/14.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="rename returns EISDIR when the 'to' argument is a directory, but 'from' is not a directory"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9echo "1..32"
10
11n0=`namegen`
12n1=`namegen`
13
14expect 0 mkdir ${n0} 0755
15
16for type in regular fifo block char socket symlink; do
17	create_file ${type} ${n1}
18	expect EISDIR rename ${n1} ${n0}
19	expect dir lstat ${n0} type
20	expect ${type} lstat ${n1} type
21	expect 0 unlink ${n1}
22done
23
24expect 0 rmdir ${n0}
25