[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Jan 27 16:14:06 MST 2012


The branch, master has been updated
       via  965b831 s3-selftest: Add test for posix large reads and writes
       via  7d14f89 s3-libsmb Do not limit read replies to NBT packet sizes
      from  0027cd2 s3-pdb: Make ADS-type backends updates secrets.tdb.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 965b83158d12dc9fabe96471162c51529206d8e1
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Jan 27 15:20:17 2012 +1100

    s3-selftest: Add test for posix large reads and writes
    
    This includes encrypted reads and writes, both NTLM and kerberos.
    
    Andrew Bartlett
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Sat Jan 28 00:13:57 CET 2012 on sn-devel-104

commit 7d14f89e29ac96227aca9af5f3deba38182618ce
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Jan 27 11:48:11 2012 +1100

    s3-libsmb Do not limit read replies to NBT packet sizes
    
    With the posix extensions, we can read 16MB at a time, so we need to check
    the full size of the packet, not the size rounded down to the old NBT
    limit.
    
    Andrew Bartlett
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/Samba3.pm                          |    5 ++
 source3/libsmb/clireadwrite.c                      |    2 +-
 source3/script/tests/test_smbclient_posix_large.sh |   62 ++++++++++++++++++++
 source3/selftest/tests.py                          |   25 ++++++--
 4 files changed, 88 insertions(+), 6 deletions(-)
 create mode 100755 source3/script/tests/test_smbclient_posix_large.sh


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 211bbb6..10f673f 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -485,6 +485,11 @@ $ret->{USERNAME} = KTEST\\Administrator
 	system("cp $self->{srcdir}/source3/selftest/ktest-krb5_ccache-3 $prefix/krb5_ccache-3");
 	chmod 0600, "$prefix/krb5_ccache-3";
 
+	# We need world access to this share, as otherwise the domain
+	# administrator from the AD domain provided by ktest can't
+	# access the share for tests.
+	chmod 0777, "$prefix/share";
+
 	$self->check_or_start($ret, "yes", "no", "yes");
 
 	if (not $self->wait_for_start($ret)) {
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 2a39edf..8e845ee 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -244,7 +244,7 @@ static void cli_read_andx_done(struct tevent_req *subreq)
 
 	state->buf = discard_const_p(uint8_t, smb_base(inbuf)) + SVAL(vwv+6, 0);
 
-	if (trans_oob(smb_len(inbuf), SVAL(vwv+6, 0), state->received)
+	if (trans_oob(smb_len_tcp(inbuf), SVAL(vwv+6, 0), state->received)
 	    || ((state->received != 0) && (state->buf < bytes))) {
 		DEBUG(5, ("server returned invalid read&x data offset\n"));
 		tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
diff --git a/source3/script/tests/test_smbclient_posix_large.sh b/source3/script/tests/test_smbclient_posix_large.sh
new file mode 100755
index 0000000..a5fdbba
--- /dev/null
+++ b/source3/script/tests/test_smbclient_posix_large.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: test_smbclient_posix_large.sh ccache smbclient3 server prefix <smbclient args>
+EOF
+exit 1;
+fi
+
+KRB5CCNAME=$1
+export KRB5CCNAME
+SMBCLIENT3=$2
+SERVER=$3
+PREFIX=$4
+shift 4
+ADDARGS="$*"
+
+# Test that a noninteractive smbclient does not prompt
+test_large_write_read()
+{
+
+    cat > $PREFIX/largefile-script <<EOF
+posix
+put $PREFIX/largefile largefile
+get largefile $PREFIX/largefile2
+rm largefile
+quit
+EOF
+
+    cmd='$SMBCLIENT3 //$SERVER/xcopy_share $ADDARGS < $PREFIX/largefile-script 2>&1'
+    eval echo "$cmd"
+    out=`eval $cmd`
+
+    if [ $? != 0 ] ; then
+	echo "$out"
+	echo "command failed"
+	false
+	return
+    fi
+
+    echo "$out" | grep "getting file" >/dev/null 2>&1
+
+    if [ $? = 0 ] ; then
+	true
+    else
+	echo did not get success message
+	false
+    fi
+}
+
+rm -f $PREFIX/largefile
+dd if=/dev/zero of=$PREFIX/largefile skip=20M count=1 bs=1
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+testit "smbclient large posix write read" test_large_write_read || failed=`expr $failed + 1`
+
+testit "cmp of read and written files" cmp $PREFIX/largefile $PREFIX/largefile2 || failed=`expr $failed + 1`
+rm -f $PREFIX/largefile2
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 5d5f366..6a3ccb9 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -302,19 +302,34 @@ for s in signseal_options:
                                                                                                                               "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
 
 
-if have_ads_support:
-    options_list = ["", "-e"]
-    for options in options_list:
+options_list = ["", "-e"]
+for options in options_list:
+    if have_ads_support:
         plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local", 
                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
                        "$PREFIX/ktest/krb5_ccache-2", 
                        binpath('smbclient3'), "$SERVER", options, configuration])
 
-        plantestsuite("samba3.blackbox.smbclient_krb5 %s" % options, "ktest:local", 
+        plantestsuite("samba3.blackbox.smbclient_krb5 old ccache %s" % options, "ktest:local",
                       [os.path.join(samba3srcdir, "script/tests/test_smbclient_krb5.sh"),
-                       "$PREFIX/ktest/krb5_ccache-3", 
+                       "$PREFIX/ktest/krb5_ccache-2",
                        binpath('smbclient3'), "$SERVER", options, configuration])
 
+        plantestsuite("samba3.blackbox.smbclient_large_file %s" % options, "ktest:local",
+                      [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
+                       "$PREFIX/ktest/krb5_ccache-3",
+                       binpath('smbclient3'), "$SERVER", "$PREFIX", options, "-k " + configuration])
+
+        plantestsuite("samba3.blackbox.smbclient_posix_large %s krb5" % options, "ktest:local",
+                      [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
+                       "$PREFIX/ktest/krb5_ccache-3",
+                       binpath('smbclient3'), "$SERVER", "$PREFIX", options, "-k " + configuration])
+
+    plantestsuite("samba3.blackbox.smbclient_posix_large %s NTLM" % options, "s3dc:local",
+                  [os.path.join(samba3srcdir, "script/tests/test_smbclient_posix_large.sh"),
+                   "none",
+                   binpath('smbclient3'), "$SERVER", "$PREFIX", options, "-U$USERNAME%$PASSWORD " + configuration])
+
 for e in endianness_options:
     for a in auth_options:
         for s in signseal_options:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list