Skip to content

Commit

Permalink
tests: Copy a file over to the share before reading it back.
Browse files Browse the repository at this point in the history
Remove the dependency that a file callet CAT must pre-exist on the
share when running the tests.

Signed-off-by: Ronnie Sahlberg <[email protected]>
  • Loading branch information
sahlberg committed Oct 25, 2024
1 parent af5e622 commit 02481bf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
15 changes: 15 additions & 0 deletions tests/test_0201_mkdir_valgrind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

. ./functions.sh

echo "mkdir test with valgrind"

echo -n "Testing mkdir on root of share ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_mkdir "${TESTURL}/testdir" >/dev/null 2>&1 || failure
success

echo -n "Testing rmdir on root of share ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_rmdir "${TESTURL}/testdir" >/dev/null 2>&1 || failure
success

exit 0
3 changes: 1 addition & 2 deletions tests/test_0300_cat_basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

echo "basic cat test"

# This test depends on the file CAT existing on the share used for testing
# TODO: should create the file first
../utils/smb2-cp ./prog_cat.c "${TESTURL}/CAT"

echo -n "Testing prog_cat on root of share/CAT ... "
./prog_cat "${TESTURL}/CAT" > /dev/null || failure
Expand Down
3 changes: 1 addition & 2 deletions tests/test_0301_cat_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

echo "basic cat test with valgrind"

# This test depends on the file CAT existing on the share used for testing
# TODO: should create the file first
../utils/smb2-cp ./prog_cat.c "${TESTURL}/CAT"

echo -n "Testing prog_cat on root of share/CAT ... "
libtool --mode=execute valgrind --leak-check=full --error-exitcode=1 ./prog_cat "${TESTURL}/CAT" >/dev/null 2>&1 || failure
Expand Down
3 changes: 1 addition & 2 deletions tests/test_0302_cat_valgrind_socket_error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

echo "basic cat test with valgrind and session errors"

# This test depends on the file CAT existing on the share used for testing
# TODO: should create the file first
../utils/smb2-cp ./prog_cat.c "${TESTURL}/CAT"

NUM_CALLS=`libtool --mode=execute strace ./prog_cat "${TESTURL}/CAT" 2>&1 >/dev/null | grep readv |wc -l`

Expand Down

0 comments on commit 02481bf

Please sign in to comment.