1#!/bin/sh
2
3. ./functions.sh
4
5echo "NFSv${VERS} Basic link test."
6
7start_share
8
9mkdir "${TESTDIR}/subdir"
10mkdir "${TESTDIR}/subdir2"
11echo "kangabanga" > "${TESTDIR}/testfile"
12
13echo -n "Link a root path (abs -> abs) (1) ... "
14./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /link1 || failure
15success
16
17echo -n "Link a root path (abs -> rel) (2) ... "
18./prog_link "${TESTURL}/?version=${VERS}" "." /testfile link2 || failure
19success
20
21echo -n "Link a root path (rel -> abs) (3) ... "
22./prog_link "${TESTURL}/?version=${VERS}" "." testfile /link3 || failure
23success
24
25echo -n "Link a root path (rel -> rel) (4) ... "
26./prog_link "${TESTURL}/?version=${VERS}" "." testfile link4 || failure
27success
28
29echo -n "Link a subdir path (abs -> abs) (5) ... "
30./prog_link "${TESTURL}/?version=${VERS}" "." /testfile /subdir/link5 || failure
31success
32
33echo -n "Link a subdir path (abs -> rel) (6) ... "
34./prog_link "${TESTURL}/?version=${VERS}" "." /subdir/link5 subdir2/link6 || failure
35success
36
37echo -n "Link a subdir path (rel -> abs) (7) ... "
38./prog_link "${TESTURL}/?version=${VERS}" "." subdir/link5 /subdir2/link7 || failure
39success
40
41echo -n "Link a subdir path (rel -> rel) (8) ... "
42./prog_link "${TESTURL}/?version=${VERS}" "." subdir2/link7 subdir/link8 || failure
43success
44
45echo -n "Link from a different cwd (rel -> rel) (9) ... "
46./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../subdir/link9 || failure
47success
48
49echo -n "Link from outside the share (rel -> rel) (10) ... "
50./prog_link "${TESTURL}/?version=${VERS}" "subdir2" ../../link7 ../subdir/link10 2>/dev/null && failure
51success
52
53echo -n "Link to outside the share (rel -> rel) (11) ... "
54./prog_link "${TESTURL}/?version=${VERS}" "subdir2" link7 ../../subdir/link11 2>/dev/null && failure
55success
56
57
58stop_share
59
60exit 0
61
62