1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:tests: Do not delete the contets of LOCAL_PATH with tarmode test

The test_smbclient_tarmode.pl test operates on $LOCAL_PATH by default
and removes everything. So it deletes all precreated files and
directories which the setup_fileserver() function initially set up.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12867

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andreas Schneider 2017-06-26 23:18:30 +02:00 committed by Stefan Metzmacher
parent eedebe2ef1
commit 4f5cfe2713
3 changed files with 10 additions and 7 deletions

View File

@ -767,6 +767,9 @@ sub setup_fileserver($$)
my $smbget_sharedir="$share_dir/smbget";
push(@dirs,$smbget_sharedir);
my $tarmode_sharedir="$share_dir/tarmode";
push(@dirs,$tarmode_sharedir);
my $fileserver_options = "
[lowercase]
path = $lower_case_share_dir

View File

@ -94,10 +94,10 @@ test_tarmode_creation() {
# Clear temp data
rm -rf -- "$PREFIX"/tarmode > /dev/null 2>&1
rm -f "$PREFIX"/tarmode.tar > /dev/null 2>&1
rm -rf "$LOCAL_PATH"/tarmode > /dev/null 2>&1
rm -rf "$LOCAL_PATH" > /dev/null 2>&1
# Build the test data
if ! create_test_data "$LOCAL_PATH/tarmode"; then
if ! create_test_data "$LOCAL_PATH"; then
echo "Test data creation failed"
false
return
@ -119,7 +119,7 @@ test_tarmode_creation() {
fi
# Verify data
if ! validate_data "$PREFIX/tarmode" "$LOCAL_PATH/tarmode"; then
if ! validate_data "$PREFIX/tarmode" "$LOCAL_PATH"; then
echo "Data not equivalent"
false
return
@ -136,7 +136,7 @@ test_tarmode_extraction() {
# Clear temp data
rm -rf -- "$PREFIX"/tarmode > /dev/null 2>&1
rm -f "$PREFIX"/tarmode.tar > /dev/null 2>&1
rm -rf "$LOCAL_PATH"/tarmode > /dev/null 2>&1
rm -rf "$LOCAL_PATH" > /dev/null 2>&1
# Build the test data
if ! create_test_data "$PREFIX/tarmode"; then
@ -161,7 +161,7 @@ test_tarmode_extraction() {
fi
# Verify data
if ! validate_data "$PREFIX/tarmode" "$LOCAL_PATH/tarmode"; then
if ! validate_data "$PREFIX/tarmode" "$LOCAL_PATH"; then
echo "Data not equivalent"
false
return

View File

@ -248,13 +248,13 @@ for env in ["fileserver"]:
plantestsuite("samba3.blackbox.smbclient_tarmode (%s)" % env, env,
[os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.sh"),
'$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD',
'$LOCAL_PATH', '$PREFIX', smbclient3, configuration])
'$LOCAL_PATH/tarmode', '$PREFIX', smbclient3, configuration])
# Test suite for new smbclient/tar with libarchive (GSoC 13)
plantestsuite("samba3.blackbox.smbclient_tar (%s)" % env, env,
[os.path.join(samba3srcdir, "script/tests/test_smbclient_tarmode.pl"),
'-n', '$SERVER', '-i', '$SERVER_IP', '-s', 'tmp',
'-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH',
'-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode',
'-d', '$PREFIX', '-b', smbclient3,
'--subunit', '--', configuration])