source: MondoRescue/branches/3.2/mindi-busybox/testsuite/readlink.tests@ 3232

Last change on this file since 3232 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 977 bytes
Line 
1#!/bin/sh
2
3# Readlink tests.
4# Copyright 2006 by Natanael Copa <n@tanael.org>
5# Licensed under GPLv2, see file LICENSE in this source tree.
6
7. ./testing.sh
8
9TESTDIR=readlink_testdir
10TESTFILE="$TESTDIR/testfile"
11TESTLINK="testlink"
12FAILLINK="$TESTDIR/$TESTDIR/testlink"
13
14# create the dir and test files
15mkdir -p "./$TESTDIR"
16touch "./$TESTFILE"
17ln -s "./$TESTFILE" "./$TESTLINK"
18
19testing "readlink on a file" "readlink ./$TESTFILE" "" "" ""
20testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" ""
21
22optional FEATURE_READLINK_FOLLOW
23
24testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" ""
25testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" ""
26testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" ""
27testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$TESTFILE\n" "" ""
28
29
30# clean up
31rm -r "$TESTLINK" "$TESTDIR"
32
33exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))
Note: See TracBrowser for help on using the repository browser.