diff options
-rw-r--r-- | selftest/target/Samba3.pm | 2 | ||||
-rwxr-xr-x | source3/script/tests/test_smbclient_s3.sh | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 2f65be4ae3..595780aa14 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -866,6 +866,8 @@ sub provision($$$$$$$) resolv:host file = $dns_host_file + message command = mv %s $shrdir/message.%m + # Begin extra options $extra_options # End extra options diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 0395f3e12c..60c3610ee8 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -218,6 +218,7 @@ EOF if [ $ret != 0 ] ; then echo "$out" echo "failed writing into read-only directory with error $ret" + false return fi @@ -235,6 +236,49 @@ EOF fi } + +# Test sending a message +test_message() +{ + tmpfile=$PREFIX/message_in.$$ + + cat > $tmpfile <<EOF +Test message from pid $$ +EOF + + cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD -M $SERVER -p 139 $ADDARGS -n msgtest < $tmpfile 2>&1' + eval echo "$cmd" + out=`eval $cmd` + ret=$? + + if [ $ret != 0 ] ; then + echo "$out" + echo "failed sending message to $SERVER with error $ret" + false + rm -f $tmpfile + return + fi + + cmd='$SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmpguest -p 139 $ADDARGS -c "get message.msgtest $PREFIX/message_out.$$" 2>&1' + eval echo "$cmd" + out=`eval $cmd` + ret=$? + + if [ $ret != 0 ] ; then + echo "$out" + echo "failed getting sent message from $SERVER with error $ret" + false + return + fi + + if [ cmp $PREFIX/message_out.$$ $tmpfile != 0 ] ; then + echo "failed comparison of message from $SERVER" + false + return + fi + true +} + # Test reading an owner-only file (logon as guest) fails. test_owner_only_file() { @@ -444,6 +488,10 @@ testit "ccache access works for smbclient" \ test_ccache_access || \ failed=`expr $failed + 1` +testit "sending a message to the remote server" \ + test_message || \ + failed=`expr $failed + 1` + testit "rm -rf $LOGDIR" \ rm -rf $LOGDIR || \ failed=`expr $failed + 1` |