2017-07-04 01:11:14 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./functions.sh
|
|
|
|
|
2017-07-16 00:46:38 +03:00
|
|
|
echo "NFSv${VERS} Basic valgrind leak check for nfs_open()."
|
2017-07-04 01:11:14 +03:00
|
|
|
|
|
|
|
start_share
|
|
|
|
|
|
|
|
mkdir "${TESTDIR}/subdir"
|
|
|
|
mkdir "${TESTDIR}/subdir2"
|
|
|
|
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (1) ... "
|
|
|
|
echo -n "kangabanga" > "${TESTDIR}/open1"
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." /open1 O_RDONLY >/dev/null 2>&1 || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (2) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." open1 O_RDONLY >/dev/null 2>&1 || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (3) ... "
|
|
|
|
echo -n "kangabanga" > "${TESTDIR}/subdir/open3"
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." /subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (4) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "." subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (5) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../subdir/open3 O_RDONLY >/dev/null 2>&1 || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
echo -n "test nfs_open() (6) ... "
|
2017-07-16 00:46:38 +03:00
|
|
|
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_open_read "${TESTURL}/?version=${VERS}" "subdir2" ../../subdir/open3 O_RDONLY 2>/dev/null || expr $? != 99 >/dev/null || failure
|
2017-07-04 01:11:14 +03:00
|
|
|
success
|
|
|
|
|
|
|
|
|
|
|
|
stop_share
|
|
|
|
|
|
|
|
exit 0
|