8ebbfc0e2513d22f2dd60fb840b0bfdb5f183bd7
[platform/upstream/coreutils.git] / tests / ln / sf-1
1 #!/bin/sh
2
3 test=sf-1
4
5 if test "$VERBOSE" = yes; then
6   set -x
7   ln --version
8 fi
9
10 # Make sure we get English translations.
11 . $srcdir/../lang-default
12
13 tmp=t-ln.$$
14
15 test_failure=0
16 mkdir $tmp || test_failure=1
17 cd $tmp || test_failure=1
18 echo foo > a || test_failure=1
19 ln -s . b || test_failure=1
20
21 if test $test_failure = 1; then
22   echo 'failure in testing framework'
23   exit 1
24 fi
25
26 fail=0
27 ln -sf a b > err 2>&1 && fail=1
28 case `cat err` in
29   *'are the same file') ;;
30   *) fail=1 ;;
31 esac
32
33 cd ..
34 rm -rf $tmp
35
36 exit $fail