1#!/bin/sh
2
3. ./functions.sh
4
5echo "NFSv${VERS} Basic valgrind leak check for nfs_rename()."
6
7start_share
8
9mkdir "${TESTDIR}/subdir"
10mkdir "${TESTDIR}/subdir2"
11
12
13echo -n "test nfs_rename() (1) ... "
14echo "kangabanga" > "${TESTDIR}/testfile"
15libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile /renamed1 >/dev/null 2>&1 || failure
16success
17
18echo -n "test nfs_rename() (2) ... "
19echo "kangabanga" > "${TESTDIR}/testfile"
20libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." testfile /renamed2 >/dev/null 2>&1 || failure
21success
22
23echo -n "test nfs_rename() (3) ... "
24echo "kangabanga" > "${TESTDIR}/testfile"
25libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." testfile renamed3 >/dev/null 2>&1 || failure
26success
27
28echo -n "test nfs_rename() (4) ... "
29echo "kangabanga" > "${TESTDIR}/testfile"
30libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /testfile renamed4 >/dev/null 2>&1 || failure
31success
32
33echo -n "test nfs_rename() (5) ... "
34echo "kangabanga" > "${TESTDIR}/subdir/testfile"
35libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile /subdir/renamed5 >/dev/null 2>&1 || failure
36success
37
38echo -n "test nfs_rename() (6) ... "
39echo "kangabanga" > "${TESTDIR}/subdir/testfile"
40libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile /subdir/renamed6 >/dev/null 2>&1 || failure
41success
42
43echo -n "test nfs_rename() (7) ... "
44echo "kangabanga" > "${TESTDIR}/subdir/testfile"
45libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." subdir/testfile subdir/renamed7 >/dev/null 2>&1 || failure
46success
47
48echo -n "test nfs_rename() (8) ... "
49echo "kangabanga" > "${TESTDIR}/subdir/testfile"
50libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir/renamed8 >/dev/null 2>&1 || failure
51success
52
53echo -n "test nfs_rename() (9) ... "
54echo "kangabanga" > "${TESTDIR}/subdir/testfile"
55libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "." /subdir/testfile subdir2/renamed9 >/dev/null 2>&1 || failure
56success
57
58echo -n "test nfs_rename() (10) ... "
59echo "kangabanga" > "${TESTDIR}/subdir/testfile"
60libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../subdir2/renamed10 >/dev/null 2>&1 || failure
61success
62
63echo -n "test nfs_rename() (11) ... "
64libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ../../testfile ../subdir2/renamed11 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
65success
66
67echo -n "test nfs_rename() (12) ... "
68echo "kangabanga" > "${TESTDIR}/subdir/testfile"
69libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/?version=${VERS}" "subdir" ./testfile ../../subdir2/renamed12 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure
70success
71
72
73stop_share
74
75exit 0
76