svn commit: samba r21373 - in branches/SAMBA_4_0: . source/librpc/idl source/torture source/torture/ndr

jelmer at samba.org jelmer at samba.org
Thu Feb 15 21:06:34 GMT 2007


Author: jelmer
Date: 2007-02-15 21:06:33 +0000 (Thu, 15 Feb 2007)
New Revision: 21373

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21373

Log:
More tests.
Added:
   branches/SAMBA_4_0/source/torture/ndr/atsvc.c
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/librpc/idl/atsvc.idl
   branches/SAMBA_4_0/source/librpc/idl/winreg.idl
   branches/SAMBA_4_0/source/torture/config.mk
   branches/SAMBA_4_0/source/torture/ndr/ndr.c
   branches/SAMBA_4_0/source/torture/ndr/winreg.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq
jelmer at samba.org-20070215210330-ve8q1mdkjymv6fr1


Modified: branches/SAMBA_4_0/source/librpc/idl/atsvc.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/atsvc.idl	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/librpc/idl/atsvc.idl	2007-02-15 21:06:33 UTC (rev 21373)
@@ -71,7 +71,7 @@
 
 	/******************/
 	/* Function: 0x00 */
-	NTSTATUS atsvc_JobAdd(
+	[public] NTSTATUS atsvc_JobAdd(
 		[in,unique,string,charset(UTF16)] uint16 *servername,
 		[in] atsvc_JobInfo *job_info,
 		[out,ref]	 uint32 *job_id
@@ -79,7 +79,7 @@
 
 	/******************/
 	/* Function: 0x01 */
-	NTSTATUS atsvc_JobDel(
+	[public] NTSTATUS atsvc_JobDel(
 		[in,unique,string,charset(UTF16)] uint16 *servername,
 		[in]	uint32 min_job_id,
 		[in]	uint32 max_job_id
@@ -101,7 +101,7 @@
 
 	/******************/
 	/* Function: 0x02 */
-	NTSTATUS atsvc_JobEnum(
+	[public] NTSTATUS atsvc_JobEnum(
 		[in,unique,string,charset(UTF16)] uint16 *servername,
 		[in,out] 	 atsvc_enum_ctr *ctr,
 		[in]	     uint32 preferred_max_len,

Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2007-02-15 21:06:33 UTC (rev 21373)
@@ -148,7 +148,7 @@
 		[size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
 	} winreg_StringBuf;
 
-	WERROR winreg_EnumKey(
+	[public] WERROR winreg_EnumKey(
 		[in,ref]        policy_handle    *handle,
 		[in]            uint32           enum_index,
 		[in,out,ref]    winreg_StringBuf *name,

Modified: branches/SAMBA_4_0/source/torture/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/config.mk	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/torture/config.mk	2007-02-15 21:06:33 UTC (rev 21373)
@@ -101,7 +101,8 @@
 INIT_FUNCTION = torture_ndr_init
 PRIVATE_PROTO_HEADER = ndr/proto.h
 OBJ_FILES = ndr/ndr.o \
-			ndr/winreg.o
+			ndr/winreg.o \
+			ndr/atsvc.o
 
 [MODULE::torture_rpc]
 # TORTURE_NET and TORTURE_NBT use functions from torture_rpc...

Added: branches/SAMBA_4_0/source/torture/ndr/atsvc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ndr/atsvc.c	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/torture/ndr/atsvc.c	2007-02-15 21:06:33 UTC (rev 21373)
@@ -0,0 +1,215 @@
+/* 
+   Unix SMB/CIFS implementation.
+   test suite for atsvc 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_atsvc.h"
+
+static const uint8_t jobenum_in_data[] = {
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x57, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x32, 0x00,
+  0x4b, 0x00, 0x44, 0x00, 0x43, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool jobenum_in_check(struct torture_context *tctx, 
+							 struct atsvc_JobEnum *r)
+{
+	torture_assert(tctx, r->in.servername != NULL, "servername ptr");
+	torture_assert_str_equal(tctx, r->in.servername, "WIN2KDC1", "servername");
+	torture_assert_int_equal(tctx, r->in.ctr->entries_read, 0, "ctr entries read");
+	torture_assert(tctx, r->in.ctr->first_entry == NULL, "ctr entries first_entry");
+	torture_assert_int_equal(tctx, r->in.preferred_max_len, -1, "preferred max len");
+	torture_assert(tctx, r->in.resume_handle != NULL, "resume handle ptr");
+	torture_assert_int_equal(tctx, *r->in.resume_handle, 0, "resume handle");
+	return true;
+}
+
+static const uint8_t jobenum_out_data[] = {
+  0x07, 0x00, 0x00, 0x00, 0x28, 0x14, 0x0a, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00,
+  0x02, 0x13, 0x00, 0x00, 0x40, 0x18, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x00, 0x00,
+  0x30, 0x18, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc0, 0xe4, 0x0a, 0x05,
+  0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x00, 0x00, 0x20, 0x18, 0x0a, 0x00,
+  0x04, 0x00, 0x00, 0x00, 0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00,
+  0x02, 0x13, 0x00, 0x00, 0x10, 0x18, 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00,
+  0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x00, 0x00,
+  0x00, 0x18, 0x0a, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0xe4, 0x0a, 0x05,
+  0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x00, 0x00, 0xf0, 0x17, 0x0a, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00,
+  0x02, 0x13, 0x00, 0x00, 0xe0, 0x17, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00,
+  0x6f, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00,
+  0x65, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x2e, 0x00,
+  0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00,
+  0x6f, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00,
+  0x65, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x2e, 0x00,
+  0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00,
+  0x6f, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0xac, 0x34, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};
+
+static bool jobenum_out_check(struct torture_context *tctx, 
+							 struct atsvc_JobEnum *r)
+{
+	torture_assert_int_equal(tctx, r->out.ctr->entries_read, 7, "entries read");
+	torture_assert(tctx, r->out.ctr->first_entry != NULL, "first entry");
+	torture_assert_int_equal(tctx, r->out.ctr->first_entry[0].job_id, 1, "job id");
+	torture_assert_int_equal(tctx, r->out.ctr->first_entry[0].job_time, 84600000, "job time");
+	torture_assert_int_equal(tctx, r->out.ctr->first_entry[0].days_of_week, 0x2, "days of week");
+	torture_assert_int_equal(tctx, r->out.ctr->first_entry[0].flags, 0x13, "flags");
+	torture_assert_str_equal(tctx, r->out.ctr->first_entry[0].command, "foo.exe", "command");
+	torture_assert(tctx, r->out.total_entries != NULL, "total entries ptr");
+	torture_assert_int_equal(tctx, *r->out.total_entries, 7, "total entries");
+	torture_assert(tctx, r->out.resume_handle, "resume handle ptr");
+	torture_assert_int_equal(tctx, *r->out.resume_handle, 0, "resume handle");
+	torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+
+	return true;
+}
+
+static const uint8_t jobadd_in_data[] = {
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x57, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x32, 0x00,
+  0x4b, 0x00, 0x44, 0x00, 0x43, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x2e, 0x00,
+  0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00
+};
+
+static bool jobadd_in_check(struct torture_context *tctx, 
+							 struct atsvc_JobAdd *r)
+{
+	torture_assert_str_equal(tctx, r->in.servername, "WIN2KDC1", "servername");
+	torture_assert_int_equal(tctx, r->in.job_info->job_time, 84600000, "time");
+	torture_assert_int_equal(tctx, r->in.job_info->days_of_month, 0, "days of month");
+	torture_assert_int_equal(tctx, r->in.job_info->days_of_week, 0x2, "days of week");
+	torture_assert_int_equal(tctx, r->in.job_info->flags, 17, "flags");
+	torture_assert_str_equal(tctx, r->in.job_info->command, "foo.exe", "command");
+
+	return true;
+}
+
+static const uint8_t jobadd_out_data[] = {
+  0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool jobadd_out_check(struct torture_context *tctx, 
+							 struct atsvc_JobAdd *r)
+{
+	torture_assert_int_equal(tctx, *r->out.job_id, 14, "job id");
+	torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+	return true;
+}
+
+static const uint8_t jobdel_in_data[] = {
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x57, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x32, 0x00,
+  0x4b, 0x00, 0x44, 0x00, 0x43, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00
+};
+
+static bool jobdel_in_check(struct torture_context *tctx, 
+							 struct atsvc_JobDel *r)
+{
+	torture_assert_str_equal(tctx, r->in.servername, "WIN2KDC1", "servername");
+	torture_assert_int_equal(tctx, r->in.min_job_id, 14, "min job id");
+	torture_assert_int_equal(tctx, r->in.max_job_id, 14, "max job id");
+	return true;
+}
+
+static const uint8_t jobdel_out_data[] = {
+  0xde, 0x0e, 0x00, 0x00
+};
+
+static bool jobdel_out_check(struct torture_context *tctx, 
+							 struct atsvc_JobDel *r)
+{
+	/* FIXME: Check for unknown code 0x00000ede */
+	return true;
+}
+
+static const uint8_t jobgetinfo_in_data[] = {
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x09, 0x00, 0x00, 0x00, 0x57, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x32, 0x00,
+  0x4b, 0x00, 0x44, 0x00, 0x43, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00
+};
+
+static bool jobgetinfo_in_check(struct torture_context *tctx, 
+								struct atsvc_JobGetInfo *r)
+{
+	torture_assert_str_equal(tctx, r->in.servername, "WIN2KDC1", "servername");
+	torture_assert_int_equal(tctx, r->in.job_id, 1, "job id");
+	return true;
+}
+
+static const uint8_t jobgetinfo_out_data[] = {
+  0x88, 0xe2, 0x09, 0x00, 0xc0, 0xe4, 0x0a, 0x05, 0x00, 0x00, 0x00, 0x00,
+  0x02, 0x13, 0x09, 0x00, 0x98, 0xe2, 0x09, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x66, 0x00, 0x6f, 0x00,
+  0x6f, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};
+
+static bool jobgetinfo_out_check(struct torture_context *tctx, 
+								struct atsvc_JobGetInfo *r)
+{
+	torture_assert(tctx, *r->out.job_info != NULL, "job info");
+	torture_assert_int_equal(tctx, (*r->out.job_info)->job_time, 84600000, "time");
+	torture_assert_int_equal(tctx, (*r->out.job_info)->days_of_month, 0, "days of month");
+	torture_assert_int_equal(tctx, (*r->out.job_info)->days_of_week, 0x2, "days of week");
+	torture_assert_int_equal(tctx, (*r->out.job_info)->flags, 0x13, "flags");
+	torture_assert_str_equal(tctx, (*r->out.job_info)->command, "foo.exe", "command");
+	return true;
+}
+
+struct torture_suite *ndr_atsvc_suite(TALLOC_CTX *ctx)
+{
+	struct torture_suite *suite = torture_suite_create(ctx, "atsvc");
+
+	torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobEnum, jobenum_in_data, NDR_IN, jobenum_in_check );
+	/* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobEnum, jobenum_out_data, NDR_IN, jobenum_out_check ); */
+
+	torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobAdd, jobadd_in_data, NDR_IN, jobadd_in_check );
+	/* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobAdd, jobadd_out_data, NDR_IN, jobadd_out_check ); */
+
+	torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobDel, jobdel_in_data, NDR_IN, jobdel_in_check );
+	/* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobDel, jobdel_out_data, NDR_IN, jobdel_out_check ); */
+
+	torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobGetInfo, jobgetinfo_in_data, NDR_IN, jobgetinfo_in_check );
+	/* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobGetInfo, jobgetinfo_out_data, NDR_IN, jobgetinfo_out_check ); */
+
+	return suite;
+}
+

Modified: branches/SAMBA_4_0/source/torture/ndr/ndr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ndr/ndr.c	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/torture/ndr/ndr.c	2007-02-15 21:06:33 UTC (rev 21373)
@@ -86,6 +86,7 @@
 	struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "NDR");
 
 	torture_suite_add_suite(suite, ndr_winreg_suite(suite));
+	torture_suite_add_suite(suite, ndr_atsvc_suite(suite));
 
 	torture_register_suite(suite);
 

Modified: branches/SAMBA_4_0/source/torture/ndr/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ndr/winreg.c	2007-02-15 19:33:03 UTC (rev 21372)
+++ branches/SAMBA_4_0/source/torture/ndr/winreg.c	2007-02-15 21:06:33 UTC (rev 21373)
@@ -473,6 +473,45 @@
 	return true;
 }
 
+static const uint8_t enumkey_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0x85, 0xb8, 0x41, 0xb0, 0x17, 0xe4, 0x28, 0x45,
+  0x8a, 0x69, 0xbf, 0x40, 0x79, 0x82, 0x8b, 0xcb, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x14, 0x04, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f
+};
+
+static bool enumkey_in_check(struct torture_context *tctx, struct winreg_EnumKey *r)
+{
+	torture_assert_int_equal(tctx, r->in.enum_index, 0, "enum index");
+	torture_assert_int_equal(tctx, r->in.name->size, 1044, "name size");
+	torture_assert_int_equal(tctx, r->in.name->length, 0, "name len");
+	torture_assert(tctx, r->in.keyclass != NULL, "keyclass pointer");
+	torture_assert(tctx, r->in.keyclass->name == NULL, "keyclass");
+	torture_assert(tctx, r->in.last_changed_time != NULL, "last_changed_time != NULL");
+	return true;
+}
+
+static const uint8_t enumkey_out_data[] = {
+  0x08, 0x00, 0x14, 0x04, 0x18, 0xe8, 0x07, 0x00, 0x0a, 0x02, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x53, 0x00, 0x41, 0x00,
+  0x4d, 0x00, 0x00, 0x00, 0xd0, 0x62, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xdc, 0x62, 0x07, 0x00, 0x50, 0x67, 0xd0, 0x8b,
+  0x16, 0x06, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool enumkey_out_check(struct torture_context *tctx, struct winreg_EnumKey *r)
+{
+	torture_assert_int_equal(tctx, r->out.name->size, 1044, "name size");
+	torture_assert_int_equal(tctx, r->out.name->length, 8, "name len");
+	torture_assert(tctx, r->out.keyclass != NULL, "keyclass pointer");
+	torture_assert(tctx, r->out.keyclass->name == NULL, "keyclass");
+	torture_assert(tctx, r->out.last_changed_time != NULL, "last_changed_time pointer");
+	/* FIXME: *last_changed_time */
+	return true;
+}
+
 struct torture_suite *ndr_winreg_suite(TALLOC_CTX *ctx)
 {
 	struct torture_suite *suite = torture_suite_create(ctx, "winreg");
@@ -516,6 +555,9 @@
 	/*torture_suite_add_ndr_pull_fn_test(suite, winreg_GetKeySecurity, getkeysecurity_in_data, NDR_IN, getkeysecurity_in_check );
 	torture_suite_add_ndr_pull_fn_test(suite, winreg_GetKeySecurity, getkeysecurity_out_data, NDR_OUT, getkeysecurity_out_check );*/
 
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumKey, enumkey_in_data, NDR_IN, enumkey_in_check );
+	torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumKey, enumkey_out_data, NDR_OUT, enumkey_out_check );
+
 	return suite;
 }
 



More information about the samba-cvs mailing list