Last change
on this file since 3706 was 3621, checked in by Bruno Cornec, 8 years ago |
New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.
|
-
Property svn:executable
set to
*
|
File size:
1.2 KB
|
Rev | Line | |
---|
[821] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | # Readlink tests.
|
---|
| 4 | # Copyright 2006 by Natanael Copa <n@tanael.org>
|
---|
[2725] | 5 | # Licensed under GPLv2, see file LICENSE in this source tree.
|
---|
[821] | 6 |
|
---|
[2725] | 7 | . ./testing.sh
|
---|
[821] | 8 |
|
---|
| 9 | TESTDIR=readlink_testdir
|
---|
| 10 | TESTFILE="$TESTDIR/testfile"
|
---|
| 11 | TESTLINK="testlink"
|
---|
| 12 | FAILLINK="$TESTDIR/$TESTDIR/testlink"
|
---|
| 13 |
|
---|
| 14 | # create the dir and test files
|
---|
| 15 | mkdir -p "./$TESTDIR"
|
---|
| 16 | touch "./$TESTFILE"
|
---|
| 17 | ln -s "./$TESTFILE" "./$TESTLINK"
|
---|
| 18 |
|
---|
| 19 | testing "readlink on a file" "readlink ./$TESTFILE" "" "" ""
|
---|
| 20 | testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" ""
|
---|
| 21 |
|
---|
| 22 | optional FEATURE_READLINK_FOLLOW
|
---|
| 23 |
|
---|
[3621] | 24 | # shell's $PWD may leave symlinks unresolved.
|
---|
| 25 | # "pwd" may be a built-in and have the same problem.
|
---|
| 26 | # External pwd _can't_ have that problem (current dir on Unix is physical).
|
---|
| 27 | pwd=`which pwd`
|
---|
| 28 | pwd=`$pwd`
|
---|
| 29 | testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$pwd/$TESTFILE\n" "" ""
|
---|
| 30 | testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$pwd/$TESTFILE\n" "" ""
|
---|
[821] | 31 | testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" ""
|
---|
[3621] | 32 | testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$pwd/$TESTFILE\n" "" ""
|
---|
[821] | 33 |
|
---|
| 34 |
|
---|
| 35 | # clean up
|
---|
[1765] | 36 | rm -r "$TESTLINK" "$TESTDIR"
|
---|
[821] | 37 |
|
---|
[2725] | 38 | exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))
|
---|
Note:
See
TracBrowser
for help on using the repository browser.