diff options
Diffstat (limited to 'source3/script/tests/test_smbclient_s3.sh')
-rwxr-xr-x | source3/script/tests/test_smbclient_s3.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 264f483ff34..b178670296f 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -1699,6 +1699,44 @@ EOF fi } +# Test smbclient non-empty rmdir command +test_del_nedir() +{ + tmpfile=$PREFIX/smbclient_interactive_prompt_commands + del_nedir="$LOCAL_PATH/del_nedir" + + rm -rf $del_nedir + mkdir $del_nedir + touch $del_nedir/afile + cat > $tmpfile <<EOF +rmdir del_nedir +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=$? + rm -rf $del_nedir + + if [ $ret != 0 ] ; then + echo "$out" + echo "failed test_del_nedir test with output $ret" + false + return + fi + +# Should get NT_STATUS_DIRECTORY_NOT_EMPTY error from rmdir + echo "$out" | grep 'NT_STATUS_DIRECTORY_NOT_EMPTY' + ret=$? + if [ $ret -ne 0 ] ; then + echo "$out" + echo "test_del_nedir failed - should get an NT_STATUS_DIRECTORY_NOT_EMPTY error" + false + return + fi +} + +# # LOGDIR_PREFIX=test_smbclient_s3 @@ -1843,4 +1881,8 @@ testit "rm -rf $LOGDIR" \ rm -rf $LOGDIR || \ failed=`expr $failed + 1` +testit "delete a non empty directory" \ + test_del_nedir || \ + failed=`expr $failed + 1` + testok $0 $failed |