xref: /freebsd/contrib/pjdfstest/tests/symlink/00.t (revision 02e9120893770924227138ba49df1edb3896112a)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/symlink/00.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="symlink creates symbolic links"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..14"
11
12n0=`namegen`
13n1=`namegen`
14
15expect 0 create ${n0} 0644
16expect regular,0644 lstat ${n0} type,mode
17expect 0 symlink ${n0} ${n1}
18expect symlink lstat ${n1} type
19expect regular,0644 stat ${n1} type,mode
20expect 0 unlink ${n0}
21expect ENOENT stat ${n1} type,mode
22expect 0 unlink ${n1}
23
24expect 0 mkdir ${n0} 0755
25time=`${fstest} stat ${n0} ctime`
26sleep 1
27expect 0 symlink test ${n0}/${n1}
28mtime=`${fstest} stat ${n0} mtime`
29test_check $time -lt $mtime
30ctime=`${fstest} stat ${n0} ctime`
31test_check $time -lt $ctime
32expect 0 unlink ${n0}/${n1}
33expect 0 rmdir ${n0}
34