[PATCH 4/5] torture: add new tests for dfsblobs

Matthieu Patou mat at matws.net
Sun Dec 13 08:41:53 MST 2009


---
 source4/librpc/config.mk      |    7 +++++-
 source4/torture/config.mk     |    2 +-
 source4/torture/ndr/dfsblob.c |   50 +++++++++++++++++++++++++++++++++++++++++
 source4/torture/ndr/ndr.c     |    1 +
 4 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 source4/torture/ndr/dfsblob.c

diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 501b88b..ca6e7a8 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -134,6 +134,11 @@ PUBLIC_DEPENDENCIES = LIBNDR NDR_DRSUAPI
 
 NDR_DRSBLOBS_OBJ_FILES = ../librpc/gen_ndr/ndr_drsblobs.o ../librpc/ndr/ndr_drsblobs.o
 
+[SUBSYSTEM::NDR_DFSBLOBS]
+PUBLIC_DEPENDENCIES = LIBNDR NDR_DRSUAPI
+
+NDR_DFSBLOBS_OBJ_FILES = ../librpc/gen_ndr/ndr_dfsblobs.o
+
 [SUBSYSTEM::NDR_SASL_HELPERS]
 PUBLIC_DEPENDENCIES = LIBNDR
 
@@ -352,7 +357,7 @@ PUBLIC_DEPENDENCIES = \
 	NDR_FRSRPC NDR_FRSAPI NDR_FRSTRANS \
 	NDR_NFS4ACL NDR_NTP_SIGND \
 	NDR_DCOM NDR_WMI NDR_NAMED_PIPE_AUTH \
-	NDR_NTLMSSP
+	NDR_NTLMSSP NDR_DFSBLOBS
 
 NDR_TABLE_OBJ_FILES = ../librpc/ndr/ndr_table.o $(gen_ndrsrcdir)/tables.o
 
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 00362b6..6efcf4a 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -94,7 +94,7 @@ mkinclude libnetapi/config.mk
 [SUBSYSTEM::TORTURE_NDR]
 PRIVATE_DEPENDENCIES = torture SERVICE_SMB
 
-TORTURE_NDR_OBJ_FILES = $(addprefix $(torturesrcdir)/ndr/, ndr.o winreg.o atsvc.o lsa.o epmap.o dfs.o netlogon.o drsuapi.o spoolss.o samr.o)
+TORTURE_NDR_OBJ_FILES = $(addprefix $(torturesrcdir)/ndr/, ndr.o winreg.o atsvc.o lsa.o epmap.o dfs.o netlogon.o drsuapi.o spoolss.o samr.o dfsblob.o) 
 
 $(eval $(call proto_header_template,$(torturesrcdir)/ndr/proto.h,$(TORTURE_NDR_OBJ_FILES:.o=.c)))
 
diff --git a/source4/torture/ndr/dfsblob.c b/source4/torture/ndr/dfsblob.c
new file mode 100644
index 0000000..a227f78
--- /dev/null
+++ b/source4/torture/ndr/dfsblob.c
@@ -0,0 +1,50 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   Test NTP authentication support
+
+   Copyright (C) Andrew Bartlet <abartlet at samba.org> 2008
+   
+   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 "torture/ndr/ndr.h"
+#include "librpc/gen_ndr/ndr_dfsblobs.h"
+
+static const uint8_t dfs_get_ref_in[] = {
+	0x03, 0x00, 0x5c, 0x00, 0x57, 0x00, 0x32, 0x00, 
+	0x4b, 0x00, 0x33, 0x00, 0x00, 0x00 };
+
+static const uint8_t dfs_get_ref_out[] = {
+	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 
+	0x02, 0x00, 0x58, 0x02, 0x00, 0x00, 0x22, 0x00, 
+	0x01, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+	0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x57, 0x00, 
+	0x32, 0x00, 0x4b, 0x00, 0x33, 0x00, 0x00, 0x00, 
+	0x5c, 0x00, 0x57, 0x00, 0x32, 0x00, 0x4b, 0x00, 
+	0x33, 0x00, 0x2d, 0x00, 0x31, 0x00, 0x30, 0x00, 
+	0x31, 0x00, 0x00, 0x00 };
+
+struct torture_suite *ndr_dfsblob_suite(TALLOC_CTX *ctx)
+{
+	struct torture_suite *suite = torture_suite_create(ctx, "dfsblob");
+
+	torture_suite_add_ndr_pull_fn_test(suite, dfs_GetDFSReferral, dfs_get_ref_in, NDR_IN, NULL);
+	torture_suite_add_ndr_pull_fn_test(suite, dfs_GetDFSReferral, dfs_get_ref_out, NDR_OUT, NULL);
+	
+	return suite;
+}
diff --git a/source4/torture/ndr/ndr.c b/source4/torture/ndr/ndr.c
index 7bd3631..8602003 100644
--- a/source4/torture/ndr/ndr.c
+++ b/source4/torture/ndr/ndr.c
@@ -252,6 +252,7 @@ struct torture_suite *torture_local_ndr(TALLOC_CTX *mem_ctx)
 	torture_suite_add_suite(suite, ndr_lsa_suite(suite));
 	torture_suite_add_suite(suite, ndr_epmap_suite(suite));
 	torture_suite_add_suite(suite, ndr_dfs_suite(suite));
+	torture_suite_add_suite(suite, ndr_dfsblob_suite(suite));
 	torture_suite_add_suite(suite, ndr_netlogon_suite(suite));
 	torture_suite_add_suite(suite, ndr_drsuapi_suite(suite));
 	torture_suite_add_suite(suite, ndr_spoolss_suite(suite));
-- 
1.6.3.3


--------------080502050808070106020509
Content-Type: text/x-patch;
 name="0005-add-ignore-for-autogenrated-files-as-they-are-not-us.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0005-add-ignore-for-autogenrated-files-as-they-are-not-us.pa";
 filename*1="tch"



More information about the samba-technical mailing list