Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TESTS: Split the leak checks tests out based on function
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
- Loading branch information
Showing
9 changed files
with
367 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
|
||
. ./functions.sh | ||
|
||
echo "basic valgrind leak check for nfs_mkdir()/nfs_rmdir()" | ||
|
||
start_share | ||
|
||
mkdir "${TESTDIR}/subdir" | ||
mkdir "${TESTDIR}/subdir2" | ||
|
||
echo -n "Test nfs_mkdir() (1) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "." /mkdir1 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (2) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "." /mkdir1 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_mkdir() (3) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "." mkdir3 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (4) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "." mkdir3 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_mkdir() (5) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "." /subdir/mkdir5 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (6) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "." /subdir/mkdir5 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_mkdir() (7) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "." subdir/mkdir7 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (8) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "." subdir/mkdir7 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_mkdir() (9) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "subdir" ../subdir2/mkdir9 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (10) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "subdir" ../subdir2/mkdir9 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_mkdir() (11) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_mkdir "${TESTURL}/" "subdir" ../../subdir2/mkdir9 2>/dev/null || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_rmdir() (12) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rmdir "${TESTURL}/" "subdir" ../../subdir2/mkdir12 2>/dev/null || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
|
||
stop_share | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
. ./functions.sh | ||
|
||
echo "basic valgrind leak check for nfs_unlink()" | ||
|
||
start_share | ||
|
||
mkdir "${TESTDIR}/subdir" | ||
mkdir "${TESTDIR}/subdir2" | ||
|
||
|
||
echo -n "test nfs_unlink() (1) ... " | ||
touch "${TESTDIR}/unlink" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." /unlink 2>/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_unlink() (2) ... " | ||
touch "${TESTDIR}/unlink" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." unlink 2>/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_unlink() (3) ... " | ||
touch "${TESTDIR}/subdir/unlink" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." /subdir/unlink 2>/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_unlink() (4) ... " | ||
touch "${TESTDIR}/subdir/unlink" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "." subdir/unlink 2>/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_unlink() (5) ... " | ||
touch "${TESTDIR}/subdir2/unlink" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "subdir" ../subdir2/unlink 2>/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_unlink() (6) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_unlink "${TESTURL}/" "subdir" ../../subdir2/unlink 2>/dev/null || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
|
||
stop_share | ||
|
||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/sh | ||
|
||
. ./functions.sh | ||
|
||
echo "basic symlink test" | ||
|
||
start_share | ||
|
||
mkdir "${TESTDIR}/subdir" | ||
mkdir "${TESTDIR}/subdir2" | ||
|
||
echo -n "Create a symlink in root (abs) (1) ... " | ||
./prog_symlink "${TESTURL}/" "." kangabanga /symlink1 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/symlink1" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink in root (rel) (2) ... " | ||
./prog_symlink "${TESTURL}/" "." kangabanga symlink2 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/symlink2" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink from a subdir (abs) (3) ... " | ||
./prog_symlink "${TESTURL}/" "." kangabanga /subdir/symlink3 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/subdir/symlink3" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink from a subdir (rel) (4) ... " | ||
./prog_symlink "${TESTURL}/" "." kangabanga subdir/symlink4 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/subdir/symlink4" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink from a subdir (rel) (5) ... " | ||
./prog_symlink "${TESTURL}/" "/subdir" kangabanga symlink5 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/subdir/symlink5" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink in a parent directory (rel) (6) ... " | ||
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../symlink6 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/symlink6" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink from different cwd (rel) (7) ... " | ||
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../subdir2/symlink7 || failure | ||
success | ||
|
||
echo -n "Verify the link ... " | ||
ls -l "${TESTDIR}/subdir2/symlink7" | egrep "\-> kangabanga$" >/dev/null || failure | ||
success | ||
|
||
echo -n "Create a symlink outside the share (rel) (8) ... " | ||
./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../../symlink8 2>/dev/null && failure | ||
success | ||
|
||
stop_share | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
. ./functions.sh | ||
|
||
echo "basic valgrind leak check for nfs_symlink()" | ||
|
||
start_share | ||
|
||
mkdir "${TESTDIR}/subdir" | ||
mkdir "${TESTDIR}/subdir2" | ||
|
||
echo -n "Test nfs_symlink() (1) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "." kangabanga /symlink1 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (2) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "." kangabanga symlink2 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (3) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "." kangabanga /subdir/symlink3 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (4) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "." kangabanga subdir/symlink4 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (5) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "/subdir" kangabanga symlink5 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (6) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../symlink6 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (7) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../subdir2/symlink7 2>/dev/null || failure | ||
success | ||
|
||
echo -n "Test nfs_symlink() (8) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_symlink "${TESTURL}/" "/subdir" kangabanga ../../symlink8 2>/dev/null || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
|
||
stop_share | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh | ||
|
||
. ./functions.sh | ||
|
||
echo "basic valgrind leak check for nfs_rename()" | ||
|
||
start_share | ||
|
||
mkdir "${TESTDIR}/subdir" | ||
mkdir "${TESTDIR}/subdir2" | ||
|
||
|
||
echo -n "test nfs_rename() (1) ... " | ||
echo "kangabanga" > "${TESTDIR}/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /testfile /renamed1 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (2) ... " | ||
echo "kangabanga" > "${TESTDIR}/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." testfile /renamed2 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (3) ... " | ||
echo "kangabanga" > "${TESTDIR}/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." testfile renamed3 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (4) ... " | ||
echo "kangabanga" > "${TESTDIR}/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /testfile renamed4 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (5) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile /subdir/renamed5 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (6) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." subdir/testfile /subdir/renamed6 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (7) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." subdir/testfile subdir/renamed7 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (8) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile subdir/renamed8 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (9) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "." /subdir/testfile subdir2/renamed9 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (10) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rename "${TESTURL}/" "subdir" ./testfile ../subdir2/renamed10 >/dev/null 2>&1 || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (11) ... " | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/" "subdir" ../../testfile ../subdir2/renamed11 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
echo -n "test nfs_rename() (12) ... " | ||
echo "kangabanga" > "${TESTDIR}/subdir/testfile" | ||
libtool --mode=execute valgrind --leak-check=full --error-exitcode=99 ./prog_rename "${TESTURL}/" "subdir" ./testfile ../../subdir2/renamed12 >/dev/null 2>&1 || expr $? != 99 >/dev/null || failure | ||
success | ||
|
||
|
||
stop_share | ||
|
||
exit 0 |
Oops, something went wrong.