File: test_0230_creat_paths.sh

package info (click to toggle)
libnfs 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,364 kB
  • sloc: ansic: 34,693; sh: 1,558; makefile: 302; xml: 178
file content (51 lines) | stat: -rwxr-xr-x 1,379 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
45
46
47
48
49
50
51
#!/bin/sh

. ./functions.sh

echo "NFSv${VERS} Basic creat path tests."

start_share

mkdir "${TESTDIR}/subdir"
mkdir "${TESTDIR}/subdir2"

echo -n "Create a file in root (abs) (1) ... "
./prog_create "${TESTURL}/?version=${VERS}" "." /creat1 0750 || failure
success

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

echo -n "Verifying it is a regular file ... "
grep "nfs_mode:100750" "${TESTDIR}/output" >/dev/null || failure
success

echo -n "Remove the file ... "
./prog_unlink "${TESTURL}/?version=${VERS}" "." /creat1 || failure
success

echo -n "Create a file in root (rel) (2) ... "
./prog_create "${TESTURL}/?version=${VERS}" "." creat2 0750 || failure
success

echo -n "Create a file in subdirectory (abs) (3) ... "
./prog_create "${TESTURL}/?version=${VERS}" "." /subdir/creat3 0750 || failure
success

echo -n "Create a file in subdirectory (rel) (4) ... "
./prog_create "${TESTURL}/?version=${VERS}" "." subdir/creat4 0750 || failure
success

echo -n "Create a file from a different cwd (rel) (5) ... "
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/creat5 0750 || failure
success

echo -n "Create a file outside the share (rel) (6) ... "
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/creat6 0750 2>/dev/null && failure
success


stop_share

exit 0