Rev 11487: Add simple NDR epmap test. in file:///home/jelmer/bzr.samba/SAMBA_4_0/

Jelmer Vernooij jelmer at samba.org
Fri Feb 16 01:05:20 GMT 2007


At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11487
revision-id: jelmer at samba.org-20070216010504-03udexhmrhje5w5c
parent: svn-v2:21377 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: SAMBA_4_0
timestamp: Fri 2007-02-16 02:05:04 +0100
message:
  Add simple NDR epmap test.
added:
  source/torture/ndr/epmap.c     epmap.c-20070216010313-hk7pxh9btce290tm-1
modified:
  source/librpc/idl/epmapper.idl svn-v2:6 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flibrpc%2fidl%2fepmapper.idl
  source/torture/config.mk       svn-v2:860 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2fconfig.mk
  source/torture/ndr/ndr.c       svn-v2:21347 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2fndr%2fndr.c
=== added file 'source/torture/ndr/epmap.c'
--- a/source/torture/ndr/epmap.c	1970-01-01 00:00:00 +0000
+++ b/source/torture/ndr/epmap.c	2007-02-16 01:05:04 +0000
@@ -0,0 +1,78 @@
+/* 
+   Unix SMB/CIFS implementation.
+   test suite for epmap ndr operations
+
+   Copyright (C) Jelmer Vernooij 2007
+   
+   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 2 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/ndr/ndr.h"
+#include "librpc/gen_ndr/ndr_epmapper.h"
+
+static const uint8_t map_in_data[] = {
+  0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+  0x4b, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x13, 0x00,
+  0x0d, 0x78, 0x57, 0x34, 0x12, 0x34, 0x12, 0xcd, 0xab, 0xef, 0x00, 0x01,
+  0x23, 0x45, 0x67, 0x89, 0xac, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13,
+  0x00, 0x0d, 0x04, 0x5d, 0x88, 0x8a, 0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8,
+  0x08, 0x00, 0x2b, 0x10, 0x48, 0x60, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x0b, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x02, 0x00,
+  0x00, 0x00, 0x01, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
+};
+
+static bool map_in_check(struct torture_context *tctx, 
+						 struct epm_Map *r)
+{
+	/* FIXME: Object */
+	torture_assert_int_equal(tctx, r->in.max_towers, 1, "max towers");
+	torture_assert(tctx, r->in.map_tower != NULL, "map tower");
+	torture_assert_int_equal(tctx, r->in.map_tower->tower_length, 75, "tower len");
+	/* FIXME: entry handle */
+
+	return true;
+}
+
+static const uint8_t map_out_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x47, 0xdd, 0xe6, 0x5a, 0x8b, 0x42,
+  0xb3, 0xb7, 0xc7, 0x79, 0x7b, 0xf0, 0x45, 0xe0, 0x01, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x05, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00
+};
+
+static bool map_out_check(struct torture_context *tctx, 
+						  struct epm_Map *r)
+{
+	torture_assert_int_equal(tctx, *r->out.num_towers, 1, "num towers");
+	torture_assert_int_equal(tctx, r->out.result, 0x4b, "return code");
+	/* FIXME: entry handle */
+
+	return true;
+}
+
+struct torture_suite *ndr_epmap_suite(TALLOC_CTX *ctx)
+{
+	struct torture_suite *suite = torture_suite_create(ctx, "epmap");
+
+	torture_suite_add_ndr_pull_fn_test(suite, epm_Map, map_in_data, NDR_IN, map_in_check );
+	/* torture_suite_add_ndr_pull_fn_test(suite, epm_Map, map_out_data, NDR_OUT, map_out_check ); */
+
+	return suite;
+}
+

=== modified file 'source/librpc/idl/epmapper.idl'
--- a/source/librpc/idl/epmapper.idl	2007-01-05 20:51:19 +0000
+++ b/source/librpc/idl/epmapper.idl	2007-02-16 01:05:04 +0000
@@ -265,7 +265,7 @@
 		epm_twr_t *twr;
 	} epm_twr_p_t;
 
-	error_status_t epm_Map(
+	[public] error_status_t epm_Map(
 		[in,ptr]       GUID            *object,
 		[in,ptr]       epm_twr_t       *map_tower,
 		[in,out]        policy_handle   *entry_handle,

=== modified file 'source/torture/config.mk'
--- a/source/torture/config.mk	2007-02-15 22:07:18 +0000
+++ b/source/torture/config.mk	2007-02-16 01:05:04 +0000
@@ -103,7 +103,8 @@
 OBJ_FILES = ndr/ndr.o \
 			ndr/winreg.o \
 			ndr/atsvc.o \
-			ndr/lsa.o
+			ndr/lsa.o \
+			ndr/epmap.o
 
 [MODULE::torture_rpc]
 # TORTURE_NET and TORTURE_NBT use functions from torture_rpc...

=== modified file 'source/torture/ndr/ndr.c'
--- a/source/torture/ndr/ndr.c	2007-02-15 22:07:18 +0000
+++ b/source/torture/ndr/ndr.c	2007-02-16 01:05:04 +0000
@@ -88,6 +88,7 @@
 	torture_suite_add_suite(suite, ndr_winreg_suite(suite));
 	torture_suite_add_suite(suite, ndr_atsvc_suite(suite));
 	torture_suite_add_suite(suite, ndr_lsa_suite(suite));
+	torture_suite_add_suite(suite, ndr_epmap_suite(suite));
 
 	torture_register_suite(suite);
 



More information about the samba-cvs mailing list