[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Tue Jul 13 17:35:21 MDT 2010


The branch, master has been updated
       via  bfdd85d... s3-selftest: enable RPC-BIND against s3.
       via  595c5a2... s4-smbtorture: add very simple RPC-BIND testsuite.
      from  14cf257... s4-smbtorture: rename rpc/bind.c to rpc/multi_bind.c.

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


- Log -----------------------------------------------------------------
commit bfdd85d4a592fcf95d9cea4f63d86330df62ac58
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 14 01:32:02 2010 +0200

    s3-selftest: enable RPC-BIND against s3.
    
    Guenther

commit 595c5a2498d0c71731c9d5cee0bfd53746350b9d
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 14 01:31:12 2010 +0200

    s4-smbtorture: add very simple RPC-BIND testsuite.
    
    Guenther

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

Summary of changes:
 source3/script/tests/test_posix_s3.sh |    2 +-
 source4/torture/config.mk             |    2 +-
 source4/torture/rpc/bind.c            |   96 +++++++++++++++++++++++++++++++++
 source4/torture/rpc/rpc.c             |    1 +
 source4/torture/wscript_build         |    2 +-
 5 files changed, 100 insertions(+), 3 deletions(-)
 create mode 100644 source4/torture/rpc/bind.c


Changeset truncated at 500 lines:

diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
index 3864b6b..59551d0 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -49,7 +49,7 @@ rpc="$rpc RPC-LSA-PRIVILEGES "
 rpc="$rpc RPC-SAMR RPC-SAMR-USERS RPC-SAMR-USERS-PRIVILEGES RPC-SAMR-PASSWORDS"
 rpc="$rpc RPC-SAMR-PASSWORDS-PWDLASTSET RPC-SAMR-LARGE-DC RPC-SAMR-MACHINE-AUTH"
 rpc="$rpc RPC-NETLOGON-S3 RPC-NETLOGON-ADMIN"
-rpc="$rpc RPC-SCHANNEL RPC-SCHANNEL2 RPC-BENCH-SCHANNEL1 RPC-JOIN"
+rpc="$rpc RPC-SCHANNEL RPC-SCHANNEL2 RPC-BENCH-SCHANNEL1 RPC-JOIN RPC-BIND"
 
 local="LOCAL-NSS-WRAPPER LOCAL-NDR"
 
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 025834f..49273d0 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -129,7 +129,7 @@ torture_rpc_OBJ_FILES = $(addprefix $(torturesrcdir)/rpc/, \
 		eventlog.o epmapper.o winreg.o initshutdown.o oxidresolve.o remact.o mgmt.o \
 		scanner.o autoidl.o countcalls.o testjoin.o schannel.o netlogon.o remote_pac.o samlogon.o \
 		samsync.o multi_bind.o dssetup.o alter_context.o bench.o samba3rpc.o rpc.o async_bind.o \
-		handles.o frsapi.o object_uuid.o ntsvcs.o browser.o)
+		handles.o frsapi.o object_uuid.o ntsvcs.o browser.o bind.o)
 
 $(eval $(call proto_header_template,$(torturesrcdir)/rpc/proto.h,$(torture_rpc_OBJ_FILES:.o=.c)))
 
diff --git a/source4/torture/rpc/bind.c b/source4/torture/rpc/bind.c
new file mode 100644
index 0000000..b36e54c
--- /dev/null
+++ b/source4/torture/rpc/bind.c
@@ -0,0 +1,96 @@
+/*
+   Unix SMB/CIFS implementation.
+   test suite for rpc bind operations
+
+   Copyright (C) Guenther Deschner 2010
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "torture/rpc/torture_rpc.h"
+#include "librpc/gen_ndr/ndr_lsa_c.h"
+#include "lib/cmdline/popt_common.h"
+
+static bool test_openpolicy(struct torture_context *tctx,
+			    struct dcerpc_pipe *p)
+{
+	struct dcerpc_binding_handle *b = p->binding_handle;
+	struct policy_handle *handle;
+
+	torture_assert(tctx,
+		test_lsa_OpenPolicy2(b, tctx, &handle),
+		"failed to open policy");
+
+	torture_assert(tctx,
+		test_lsa_Close(b, tctx, handle),
+		"failed to close policy");
+
+	return true;
+}
+
+static bool test_bind(struct torture_context *tctx,
+		      const void *private_data)
+{
+	struct dcerpc_binding *binding;
+	struct dcerpc_pipe *p;
+	const uint32_t *flags = (const uint32_t *)private_data;
+
+	torture_assert_ntstatus_ok(tctx,
+		torture_rpc_binding(tctx, &binding),
+		"failed to parse binding string");
+
+	binding->flags |= *flags;
+
+	torture_assert_ntstatus_ok(tctx,
+		dcerpc_pipe_connect_b(tctx, &p, binding,
+				      &ndr_table_lsarpc,
+				      cmdline_credentials,
+				      tctx->ev,
+				      tctx->lp_ctx),
+		"failed to connect pipe");
+
+	torture_assert(tctx,
+		test_openpolicy(tctx, p),
+		"failed to test openpolicy");
+
+	talloc_free(p);
+
+	return true;
+}
+
+static void test_bind_op(struct torture_suite *suite,
+			 const char *name,
+			 uint32_t flags)
+{
+	uint32_t *flags_p = talloc(suite, uint32_t);
+
+	*flags_p = flags;
+
+	torture_suite_add_simple_tcase_const(suite, name, test_bind, flags_p);
+}
+
+
+struct torture_suite *torture_rpc_bind(TALLOC_CTX *mem_ctx)
+{
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "BIND");
+
+	test_bind_op(suite, "ntlm,sign", DCERPC_AUTH_NTLM | DCERPC_SIGN);
+	test_bind_op(suite, "ntlm,sign,seal", DCERPC_AUTH_NTLM | DCERPC_SIGN | DCERPC_SEAL);
+	test_bind_op(suite, "spnego,sign", DCERPC_AUTH_SPNEGO | DCERPC_SIGN);
+	test_bind_op(suite, "spnego,sign,seal", DCERPC_AUTH_SPNEGO | DCERPC_SIGN | DCERPC_SEAL);
+
+	return suite;
+}
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index a860bda..b386c6a 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -489,6 +489,7 @@ NTSTATUS torture_rpc_init(void)
 	torture_suite_add_simple_test(suite, "BENCH-RPC", torture_bench_rpc);
 	torture_suite_add_simple_test(suite, "ASYNCBIND", torture_async_bind);
 	torture_suite_add_suite(suite, torture_rpc_ntsvcs(suite));
+	torture_suite_add_suite(suite, torture_rpc_bind(suite));
 
 	suite->description = talloc_strdup(suite, "DCE/RPC protocol and interface tests");
 
diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index bfa8b9b..b5e80bf 100644
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -40,7 +40,7 @@ bld.SAMBA_SUBSYSTEM('TORTURE_NDR',
 
 
 bld.SAMBA_MODULE('torture_rpc',
-	source='rpc/join.c rpc/lsa.c rpc/lsa_lookup.c rpc/session_key.c rpc/echo.c rpc/dfs.c rpc/drsuapi.c rpc/drsuapi_cracknames.c rpc/dssync.c rpc/dsgetinfo.c rpc/spoolss.c rpc/spoolss_notify.c rpc/spoolss_win.c rpc/spoolss_access.c rpc/unixinfo.c rpc/samr.c rpc/samr_accessmask.c rpc/wkssvc.c rpc/srvsvc.c rpc/svcctl.c rpc/atsvc.c rpc/eventlog.c rpc/epmapper.c rpc/winreg.c rpc/initshutdown.c rpc/oxidresolve.c rpc/remact.c rpc/mgmt.c rpc/scanner.c rpc/autoidl.c rpc/countcalls.c rpc/testjoin.c rpc/schannel.c rpc/netlogon.c rpc/remote_pac.c rpc/samlogon.c rpc/samsync.c rpc/multi_bind.c rpc/dssetup.c rpc/alter_context.c rpc/bench.c rpc/samba3rpc.c rpc/rpc.c rpc/async_bind.c rpc/handles.c rpc/frsapi.c rpc/object_uuid.c rpc/ntsvcs.c rpc/browser.c',
+	source='rpc/join.c rpc/lsa.c rpc/lsa_lookup.c rpc/session_key.c rpc/echo.c rpc/dfs.c rpc/drsuapi.c rpc/drsuapi_cracknames.c rpc/dssync.c rpc/dsgetinfo.c rpc/spoolss.c rpc/spoolss_notify.c rpc/spoolss_win.c rpc/spoolss_access.c rpc/unixinfo.c rpc/samr.c rpc/samr_accessmask.c rpc/wkssvc.c rpc/srvsvc.c rpc/svcctl.c rpc/atsvc.c rpc/eventlog.c rpc/epmapper.c rpc/winreg.c rpc/initshutdown.c rpc/oxidresolve.c rpc/remact.c rpc/mgmt.c rpc/scanner.c rpc/autoidl.c rpc/countcalls.c rpc/testjoin.c rpc/schannel.c rpc/netlogon.c rpc/remote_pac.c rpc/samlogon.c rpc/samsync.c rpc/multi_bind.c rpc/dssetup.c rpc/alter_context.c rpc/bench.c rpc/samba3rpc.c rpc/rpc.c rpc/async_bind.c rpc/handles.c rpc/frsapi.c rpc/object_uuid.c rpc/ntsvcs.c rpc/browser.c rpc/bind.c',
 	autoproto='rpc/proto.h',
 	subsystem='smbtorture',
 	init_function='torture_rpc_init',


-- 
Samba Shared Repository


More information about the samba-cvs mailing list