1#!/bin/sh
2
3. ./functions.sh
4
5echo "NFSv${VERS} Basic nfs_unlink() test."
6
7start_share
8
9mkdir "${TESTDIR}/subdir"
10mkdir "${TESTDIR}/subdir2"
11
12echo -n "Unlink a file from the root (abs) (1)... "
13touch "${TESTDIR}/unlink"
14./prog_unlink "${TESTURL}/?version=${VERS}" "." /unlink || failure
15success
16
17echo -n "Verify the file is gone ... "
18./prog_stat "${TESTURL}/?version=${VERS}" "." unlink 2>/dev/null && failure
19success
20
21echo -n "Unlink a file from the root (rel) (2)... "
22touch "${TESTDIR}/unlink"
23./prog_unlink "${TESTURL}/?version=${VERS}" "." unlink || failure
24success
25
26echo -n "Unlink a file from a subdir (abs) (3)... "
27touch "${TESTDIR}/subdir/unlink"
28./prog_unlink "${TESTURL}/?version=${VERS}" "." /subdir/unlink || failure
29success
30
31echo -n "Unlink a file from a subdir (rel) (4)... "
32touch "${TESTDIR}/subdir/unlink"
33./prog_unlink "${TESTURL}/?version=${VERS}" "." subdir/unlink || failure
34success
35
36echo -n "Unlink a file from a different dir (rel) (5)... "
37touch "${TESTDIR}/subdir2/unlink"
38./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/unlink || failure
39success
40
41echo -n "Unlink a file from outside the share (rel) (6)... "
42./prog_unlink "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/unlink 2>/dev/null && failure
43success
44
45stop_share
46
47exit 0
48