2017-07-03 00:00:10 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./functions.sh
|
|
|
|
|
2017-07-16 00:46:38 +03:00
|
|
|
echo "NFSv${VERS} Basic creat path tests."
|
2017-07-03 00:00:10 +03:00
|
|
|
|
|
|
|
start_share
|
|
|
|
|
|
|
|
mkdir "${TESTDIR}/subdir"
|
|
|
|
mkdir "${TESTDIR}/subdir2"
|
|
|
|
|
|
|
|
echo -n "Create a file in root (abs) (1) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "." /creat1 0750 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Stat the new file ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_stat "${TESTURL}/?version=${VERS}" "." creat1 > "${TESTDIR}/output" || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Verifying it is a regular file ... "
|
|
|
|
grep "nfs_mode:100750" "${TESTDIR}/output" >/dev/null || failure
|
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Remove the file ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_unlink "${TESTURL}/?version=${VERS}" "." /creat1 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Create a file in root (rel) (2) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "." creat2 0750 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Create a file in subdirectory (abs) (3) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "." /subdir/creat3 0750 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Create a file in subdirectory (rel) (4) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "." subdir/creat4 0750 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Create a file from a different cwd (rel) (5) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../subdir2/creat5 0750 || failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "Create a file outside the share (rel) (6) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
./prog_create "${TESTURL}/?version=${VERS}" "subdir" ../../subdir2/creat6 0750 2>/dev/null && failure
|
2017-07-03 00:00:10 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
|
|
|
|
stop_share
|
|
|
|
|
|
|
|
exit 0
|