File: test_0430_access.sh

package info (click to toggle)
libnfs 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,648 kB
  • sloc: ansic: 39,600; sh: 1,654; makefile: 315; xml: 178
file content (44 lines) | stat: -rwxr-xr-x 1,226 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

. ./functions.sh

echo "NFSv${VERS} Basic access tests."

start_share

dd if=/dev/zero of=testdata/testfile count=1 bs=32768 2>/dev/null

echo -n "test access(R_OK) on a readable file ... "
chmod 400 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile R_OK || failure
success

echo -n "test access(W_OK) on a writeable file ... "
chmod 200 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile W_OK || failure
success

echo -n "test access(X_OK) on an executable file ... "
chmod 100 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile X_OK || failure
success

echo -n "test access(R_OK) on a non-readable file ... "
chmod 300 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile R_OK 2>/dev/null && failure
success

echo -n "test access(W_OK) on a non-writeable file ... "
chmod 500 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile W_OK 2>/dev/null && failure
success

echo -n "test access(X_OK) on a non-executable file ... "
chmod 600 "${TESTDIR}/testfile"
./prog_access "${TESTURL}/?version=${VERS}" "." /testfile X_OK 2>/dev/null && failure
success


stop_share

exit 0