1#!/bin/sh
2
3. ./functions.sh
4
5echo "NFSv${VERS} Basic access2 tests."
6
7start_share
8
9dd if=/dev/zero of=testdata/testfile count=1 bs=32768 2>/dev/null
10
11echo -n "test access2(R_OK) on a readable file ... "
12chmod 400 "${TESTDIR}/testfile"
13./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile R_OK || failure
14success
15
16echo -n "test access2(W_OK) on a writeable file ... "
17chmod 200 "${TESTDIR}/testfile"
18./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile W_OK || failure
19success
20
21echo -n "test access2(X_OK) on an executable file ... "
22chmod 100 "${TESTDIR}/testfile"
23./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile X_OK || failure
24success
25
26echo -n "test access2(R_OK) on a non-readable file ... "
27chmod 300 "${TESTDIR}/testfile"
28./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile R_OK 2>/dev/null && failure
29success
30
31echo -n "test access2(W_OK) on a non-writeable file ... "
32chmod 500 "${TESTDIR}/testfile"
33./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile W_OK 2>/dev/null && failure
34success
35
36echo -n "test access2(X_OK) on a non-executable file ... "
37chmod 600 "${TESTDIR}/testfile"
38./prog_access2 "${TESTURL}/?version=${VERS}" "." /testfile X_OK 2>/dev/null && failure
39success
40
41
42stop_share
43
44exit 0
45