3 PATH
=..
/..
/..
/src
:$PATH
7 mkdir
$tmp || test_failure
=1
8 cd $tmp || test_failure
=1
10 if test $test_failure = 1; then
11 echo 'failure in testing framework'
18 ld
=tln-symlink-to-subdir
22 # Create a simple symlink with both source and destination files
23 # in current directory.
24 touch $f || test_failure
=1
25 rm -f $t || test_failure
=1
30 # Create a symlink with source file and explicit destination directory/file.
31 touch $f || test_failure
=1
32 rm -rf $d || test_failure
=1
33 mkdir
$d || test_failure
=1
34 ln -s ..
/$f $d/$t || fail
=1
35 test -f $d/$t || fail
=1
38 # Create a symlink with source file and destination directory.
39 touch $f || test_failure
=1
40 rm -rf $d || test_failure
=1
41 mkdir
$d || test_failure
=1
42 ln -s ..
/$f $d || fail
=1
43 test -f $d/$f || fail
=1
46 # Make sure we get a failure with existing dest without -f option
47 touch $t || test_failure
=1
48 # FIXME: don't ignore the error message but rather test
49 # it to make sure it's the right one.
50 ln -s $t $t 2> /dev
/null
&& fail
=1
53 # Make sure -sf fails when src and dest are the same
54 touch $t && test_failure
=1
55 ln -sf $t $t 2> /dev
/null
&& fail
=1
58 # Create a symlink with source file and no explicit directory
59 rm -rf $d || test_failure
=1
60 mkdir
$d || test_failure
=1
61 touch $d/$f || test_failure
=1
66 # Create a symlink with source file and destination symlink-to-directory.
67 rm -rf $d $f $ld || test_failure
=1
68 touch $f || test_failure
=1
69 mkdir
$d || test_failure
=1
71 ln -s ..
/$f $ld || fail
=1
72 test -f $d/$f || fail
=1
75 # Create a symlink with source file and destination symlink-to-directory.
76 # BUT use the new --no-dereference option.
77 rm -rf $d $f $ld || test_failure
=1
78 touch $f || test_failure
=1
79 mkdir
$d || test_failure
=1
82 ln --no-dereference -fs $af $ld || fail
=1