summaryrefslogtreecommitdiff
path: root/source3/script/tests
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-07-06 10:52:45 -0700
committerAndreas Schneider <asn@cryptomilk.org>2017-07-07 13:38:24 +0200
commitb21ee14e2265a6dd11dd83c8e252a40de394585a (patch)
treebe5e468b8dd9b80259a56428289be3767c619822 /source3/script/tests
parentf2f9f51fef8e264fdad11018e3c447db0ad03cc1 (diff)
downloadsamba-b21ee14e2265a6dd11dd83c8e252a40de394585a.tar.gz
s3: tests: Add test for new smbclient "deltree" command.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jul 7 13:38:24 CEST 2017 on sn-devel-144
Diffstat (limited to 'source3/script/tests')
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 4cfd054b018..3cbe6f51d4b 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -1189,6 +1189,49 @@ EOF
fi
}
+# Test smbclient deltree command
+test_deltree()
+{
+ tmpfile=$PREFIX/smbclient_interactive_prompt_commands
+ deltree_dir=$PREFIX/deltree_dir
+
+ rm -rf $deltree_dir
+ cat > $tmpfile <<EOF
+mkdir deltree_dir
+mkdir deltree_dir/foo
+mkdir deltree_dir/foo/bar
+put ${SMBCLIENT} deltree_dir/foo/bar/client
+deltree deltree_dir
+quit
+EOF
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+ ret=$?
+
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "failed deltree test with output $ret"
+ false
+ return
+ fi
+
+ echo "$out" | grep 'NT_STATUS_'
+ ret=$?
+ if [ $ret -eq 0 ] ; then
+ echo "$out"
+ echo "failed - got an NT_STATUS error"
+ false
+ return
+ fi
+
+ if [ -d $deltree_dir ] ; then
+ echo "deltree did not delete everything"
+ false
+ return
+ fi
+}
+
test_server_os_message()
{
tmpfile=$PREFIX/smbclient_interactive_prompt_commands
@@ -1326,6 +1369,10 @@ testit "follow local symlinks" \
test_local_symlinks || \
failed=`expr $failed + 1`
+testit "smbclient deltree command" \
+ test_deltree || \
+ failed=`expr $failed + 1`
+
testit "server os message" \
test_server_os_message || \
failed=`expr $failed + 1`