[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Thu Mar 25 07:47:35 MDT 2010


The branch, master has been updated
       via  9a5d50b... s3-selftest: enable RAP-RPC test against s3.
       via  a2e65a2... s3-selftest: add RAP-RPC testsuite for crosschecking RAP and DCERPC calls.
      from  45f6eae... s4-smbtorture: fix drsblobs ndr torture test.

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


- Log -----------------------------------------------------------------
commit 9a5d50b7246b4c2aed75dc9113b35b17f9612be9
Author: Günther Deschner <gd at samba.org>
Date:   Thu Mar 25 14:40:40 2010 +0100

    s3-selftest: enable RAP-RPC test against s3.
    
    Guenther

commit a2e65a2addb38ebf57c04b83ae9a2312233d78b7
Author: Günther Deschner <gd at samba.org>
Date:   Thu Mar 25 13:17:05 2010 +0100

    s3-selftest: add RAP-RPC testsuite for crosschecking RAP and DCERPC calls.
    
    Guenther

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

Summary of changes:
 source3/script/tests/test_posix_s3.sh |    2 +-
 source4/torture/config.mk             |    2 +-
 source4/torture/rap/rap.c             |    1 +
 source4/torture/rap/rpc.c             |  104 +++++++++++++++++++++++++++++++++
 4 files changed, 107 insertions(+), 2 deletions(-)
 create mode 100644 source4/torture/rap/rpc.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 dfbeadb..44464a4 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -54,7 +54,7 @@ local="LOCAL-NSS-WRAPPER LOCAL-NDR"
 
 winbind="WINBIND-STRUCT WINBIND-WBCLIENT"
 
-rap="RAP-BASIC"
+rap="RAP-BASIC RAP-RPC"
 
 # NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
 # config to allow guest access. I'm not sure whether this would break other
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 56bfa9c..3315865 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -140,7 +140,7 @@ PRIVATE_DEPENDENCIES = TORTURE_UTIL LIBCLI_SMB
 # End SUBSYSTEM TORTURE_RAP
 #################################
 
-TORTURE_RAP_OBJ_FILES = $(torturesrcdir)/rap/rap.o
+TORTURE_RAP_OBJ_FILES = $(torturesrcdir)/rap/rap.o $(torturesrcdir)/rap/rpc.o
 
 $(eval $(call proto_header_template,$(torturesrcdir)/rap/proto.h,$(TORTURE_RAP_OBJ_FILES:.o=.c)))
 
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 78fc6a4..53966af 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -551,6 +551,7 @@ NTSTATUS torture_rap_init(void)
 	struct torture_suite *suite_basic = torture_suite_create(suite, "BASIC");
 
 	torture_suite_add_suite(suite, suite_basic);
+	torture_suite_add_suite(suite, torture_rap_rpc(suite));
 
 	torture_suite_add_1smb_test(suite_basic, "netserverenum", 
 				    test_netserverenum);
diff --git a/source4/torture/rap/rpc.c b/source4/torture/rap/rpc.c
new file mode 100644
index 0000000..68a1062
--- /dev/null
+++ b/source4/torture/rap/rpc.c
@@ -0,0 +1,104 @@
+/*
+   Unix SMB/CIFS implementation.
+   test suite for RAP / DCERPC consistency
+   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, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "libcli/libcli.h"
+#include "torture/smbtorture.h"
+#include "torture/util.h"
+#include "libcli/rap/rap.h"
+#include "torture/rap/proto.h"
+#include "param/param.h"
+#include "torture/rpc/rpc.h"
+#include "librpc/gen_ndr/ndr_srvsvc_c.h"
+
+static bool test_rpc_netservergetinfo(struct torture_context *tctx,
+				      struct smbcli_state *cli)
+{
+	struct rap_WserverGetInfo r;
+	struct dcerpc_pipe *p;
+	struct dcerpc_binding_handle *b;
+	struct srvsvc_NetSrvGetInfo s;
+	union srvsvc_NetSrvInfo info;
+
+	const char *server_name;
+
+	torture_assert_ntstatus_ok(tctx,
+		torture_rpc_connection(tctx, &p, &ndr_table_srvsvc),
+		"failed to open srvsvc");
+
+	b = p->binding_handle;
+
+	s.in.server_unc = NULL;
+	s.in.level = 101;
+	s.out.info = &info;
+
+	torture_assert_ntstatus_ok(tctx,
+		dcerpc_srvsvc_NetSrvGetInfo_r(b, tctx, &s),
+		"srvsvc_NetSrvGetInfo level 101 failed");
+	torture_assert_werr_ok(tctx, s.out.result,
+		"srvsvc_NetSrvGetInfo level 101 failed");
+
+	r.in.bufsize = 0xffff;
+	r.in.level = 0;
+
+	torture_assert_ntstatus_ok(tctx,
+		smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+		"rap_netservergetinfo level 0 failed");
+	torture_assert_int_equal(tctx, r.out.status, 0,
+		"rap_netservergetinfo level 0 failed");
+
+	server_name = talloc_strndup(tctx, info.info101->server_name, 16);
+
+	torture_assert_str_equal(tctx, r.out.info.info0.name, server_name, "server name");
+
+	if (torture_setting_bool(tctx, "samba3", false)) {
+		torture_skip(tctx, "skipping netservergetinfo level 1 against samba3");
+	}
+
+	r.in.level = 1;
+
+	torture_assert_ntstatus_ok(tctx,
+		smbcli_rap_netservergetinfo(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+		"rap_netservergetinfo level 1 failed");
+	torture_assert_int_equal(tctx, r.out.status, 0,
+		"rap_netservergetinfo level 1 failed");
+
+	torture_assert_str_equal(tctx, r.out.info.info1.name, server_name, "server name");
+	torture_assert_int_equal(tctx, r.out.info.info1.version_major, info.info101->version_major, "version major");
+	torture_assert_int_equal(tctx, r.out.info.info1.version_minor, info.info101->version_minor, "version minor");
+	torture_assert_int_equal(tctx, r.out.info.info1.servertype, info.info101->server_type, "server_type");
+	torture_assert_str_equal(tctx, r.out.info.info1.comment, info.info101->comment, "comment");
+
+	talloc_free(p);
+
+	return true;
+}
+
+struct torture_suite *torture_rap_rpc(TALLOC_CTX *mem_ctx)
+{
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "RPC");
+
+	torture_suite_add_1smb_test(suite, "netservergetinfo",
+				    test_rpc_netservergetinfo);
+
+	suite->description = talloc_strdup(suite,
+					   "RAP / DCERPC consistency tests");
+
+	return suite;
+}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list