xref: /freebsd/contrib/pjdfstest/tests/rename/13.t (revision 0f7f3352c8bc463607912e2463d13e52d44a4cae)
1#!/bin/sh
2# $FreeBSD: head/tools/regression/pjdfstest/tests/rename/13.t 211352 2010-08-15 21:24:17Z pjd $
3
4desc="rename returns ENOTDIR when the 'from' argument is a directory, but 'to' 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 ENOTDIR rename ${n0} ${n1}
19	expect dir lstat ${n0} type
20	expect ${type} lstat ${n1} type
21	expect 0 unlink ${n1}
22done
23
24expect 0 rmdir ${n0}
25