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