forked from zfsonlinux/fstest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path03.t
executable file
·43 lines (38 loc) · 1.06 KB
/
03.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
# $FreeBSD: src/tools/regression/fstest/tests/symlink/03.t,v 1.1 2007/01/17 01:42:11 pjd Exp $
desc="symlink returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters"
dir=`dirname $0`
. ${dir}/../misc.sh
case ${os}:${fs} in
Darwin:HFS+|Darwin:ZFS)
echo "1..10"
;;
*)
echo "1..14"
;;
esac
n0=`namegen`
expect 0 symlink ${path1023} ${n0}
expect 0 unlink ${n0}
expect 0 mkdir ${name255} 0755
expect 0 mkdir ${name255}/${name255} 0755
expect 0 mkdir ${name255}/${name255}/${name255} 0755
expect 0 mkdir ${path1021} 0755
case ${os}:${fs} in
Darwin:HFS+|Darwin:ZFS)
# HFS+ on Darwin unfortunately creates the file, which then can't
# be deleted short of recreating the filesystem, loosing all data.
;;
*)
expect 0 symlink ${n0} ${path1023}
expect 0 unlink ${path1023}
create_too_long
expect ENAMETOOLONG symlink ${n0} ${too_long}
expect ENAMETOOLONG symlink ${too_long} ${n0}
unlink_too_long
;;
esac
expect 0 rmdir ${path1021}
expect 0 rmdir ${name255}/${name255}/${name255}
expect 0 rmdir ${name255}/${name255}
expect 0 rmdir ${name255}