xref: /freebsd/contrib/pjdfstest/tests/link/14.t (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/link/14.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="link returns EXDEV if the source and the destination files are on different file systems"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10[ "${os}" = "FreeBSD" ] || quick_exit
11
12echo "1..8"
13
14n0=`namegen`
15n1=`namegen`
16n2=`namegen`
17
18expect 0 mkdir ${n0} 0755
19n=`mdconfig -a -n -t malloc -s 1m` || exit
20newfs /dev/md${n} >/dev/null || exit
21mount /dev/md${n} ${n0} || exit
22expect 0 create ${n0}/${n1} 0644
23expect EXDEV link ${n0}/${n1} ${n2}
24expect 0 unlink ${n0}/${n1}
25expect 0 create ${n1} 0644
26expect EXDEV link ${n1} ${n0}/${n2}
27expect 0 unlink ${n1}
28umount /dev/md${n}
29mdconfig -d -u ${n} || exit
30expect 0 rmdir ${n0}
31