File: test_0370_chmod.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 (63 lines) | stat: -rwxr-xr-x 1,638 bytes parent folder | download
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh

. ./functions.sh

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

start_share

dd if=/dev/zero of=${TESTDIR}/testfile count=1 bs=32768 2>/dev/null

echo -n "test chmod(0600) ... "
./prog_chmod "${TESTURL}/?version=${VERS}" "." /testfile 0600 || failure
success

echo -n "Stat the file ... "
./prog_stat "${TESTURL}/?version=${VERS}" "." testfile > "${TESTDIR}/output" || failure
success

echo -n "Verifying the mode is 0600 ... "
grep "nfs_mode:100600" "${TESTDIR}/output" >/dev/null || failure
success

echo -n "test chmod(0755) ... "
./prog_chmod "${TESTURL}/?version=${VERS}" "." /testfile 0755 || failure
success

echo -n "Stat the file ... "
./prog_stat "${TESTURL}/?version=${VERS}" "." testfile > "${TESTDIR}/output" || failure
success

echo -n "Verifying the mode is 0755 ... "
grep "nfs_mode:100755" "${TESTDIR}/output" >/dev/null || failure
success

mkdir ${TESTDIR}/testdir

echo -n "test chmod(0600) on dir ... "
./prog_chmod "${TESTURL}/?version=${VERS}" "." /testdir 0600 || failure
success

echo -n "Stat the dir ... "
./prog_stat "${TESTURL}/?version=${VERS}" "." testdir > "${TESTDIR}/output" || failure
success

echo -n "Verifying the mode is 0600 on dir ... "
grep "nfs_mode:40600" "${TESTDIR}/output" >/dev/null || failure
success

echo -n "test chmod(0755) on dir ... "
./prog_chmod "${TESTURL}/?version=${VERS}" "." /testdir 0755 || failure
success

echo -n "Stat the dir ... "
./prog_stat "${TESTURL}/?version={VERS}" "." testdir > "${TESTDIR}/output" || failure
success

echo -n "Verifying the mode is 0755 on dir ... "
grep "nfs_mode:40755" "${TESTDIR}/output" >/dev/null || failure
success

stop_share

exit 0