Author: gd
Date: 2007-11-27 12:18:23 +0000 (Tue, 27 Nov 2007)
New Revision: 26165

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

Log:
Add IDL and torture test for wkssvc_NetrGetJoinableOus() and
wkssvc_NetrGetJoinableOus2() (both unavailable remotely).

Guenther

Modified:
   branches/SAMBA_4_0/source/librpc/idl/wkssvc.idl
   branches/SAMBA_4_0/source/rpc_server/wkssvc/dcesrv_wkssvc.c
   branches/SAMBA_4_0/source/torture/rpc/wkssvc.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/wkssvc.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/wkssvc.idl     2007-11-27 12:11:49 UTC 
(rev 26164)
+++ branches/SAMBA_4_0/source/librpc/idl/wkssvc.idl     2007-11-27 12:18:23 UTC 
(rev 26165)
@@ -516,7 +516,14 @@
 
        /*****************************/
        /* Function        0x15      */
-       WERROR WKSSVC_NETRGETJOINABLEOUS ();
+       WERROR wkssvc_NetrGetJoinableOus(
+               [in] [string,charset(UTF16)] uint16 *server_name,
+               [in,ref] [string,charset(UTF16)] uint16 *domain_name,
+               [in] [string,charset(UTF16)] uint16 *Account,
+               [in] [string,charset(UTF16)] uint16 *unknown,
+               [in,out,ref] uint32 *num_ous,
+               [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 
***ous
+               );
 
        typedef struct {
                uint8 data[524];
@@ -591,7 +598,14 @@
 
        /*****************************/
        /* Function        0x1a      */
-       WERROR WKSSVC_NETRGETJOINABLEOUS2 ();
+       WERROR wkssvc_NetrGetJoinableOus2(
+               [in] [string,charset(UTF16)] uint16 *server_name,
+               [in,ref] [string,charset(UTF16)] uint16 *domain_name,
+               [in] [string,charset(UTF16)] uint16 *Account,
+               [in] wkssvc_PasswordBuffer *EncryptedPassword,
+               [in,out,ref] uint32 *num_ous,
+               [out,ref] [size_is(*num_ous)] [string,charset(UTF16)] uint16 
***ous
+               );
 
        /*****************************/
        /* Function        0x1b      */

Modified: branches/SAMBA_4_0/source/rpc_server/wkssvc/dcesrv_wkssvc.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/wkssvc/dcesrv_wkssvc.c 2007-11-27 
12:11:49 UTC (rev 26164)
+++ branches/SAMBA_4_0/source/rpc_server/wkssvc/dcesrv_wkssvc.c 2007-11-27 
12:18:23 UTC (rev 26165)
@@ -313,10 +313,10 @@
 
 
 /*
-  WKSSVC_NETRGETJOINABLEOUS
+  wkssvc_NetrGetJoinableOus
 */
-static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS(struct dcesrv_call_state 
*dce_call, TALLOC_CTX *mem_ctx,
-                      struct WKSSVC_NETRGETJOINABLEOUS *r)
+static WERROR dcesrv_wkssvc_NetrGetJoinableOus(struct dcesrv_call_state 
*dce_call, TALLOC_CTX *mem_ctx,
+                      struct wkssvc_NetrGetJoinableOus *r)
 {
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
@@ -363,10 +363,10 @@
 
 
 /*
-  WKSSVC_NETRGETJOINABLEOUS2
+  wkssvc_NetrGetJoinableOus2
 */
-static WERROR dcesrv_WKSSVC_NETRGETJOINABLEOUS2(struct dcesrv_call_state 
*dce_call, TALLOC_CTX *mem_ctx,
-                      struct WKSSVC_NETRGETJOINABLEOUS2 *r)
+static WERROR dcesrv_wkssvc_NetrGetJoinableOus2(struct dcesrv_call_state 
*dce_call, TALLOC_CTX *mem_ctx,
+                      struct wkssvc_NetrGetJoinableOus2 *r)
 {
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }

Modified: branches/SAMBA_4_0/source/torture/rpc/wkssvc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/wkssvc.c      2007-11-27 12:11:49 UTC 
(rev 26164)
+++ branches/SAMBA_4_0/source/torture/rpc/wkssvc.c      2007-11-27 12:18:23 UTC 
(rev 26165)
@@ -1000,6 +1000,57 @@
        return true;
 }
 
+static bool test_NetrGetJoinableOus(struct torture_context *tctx,
+                                   struct dcerpc_pipe *p)
+{
+       NTSTATUS status;
+       struct wkssvc_NetrGetJoinableOus r;
+       uint32_t num_ous = 0;
+       const char **ous = NULL;
+
+       r.in.server_name = dcerpc_server_name(p);
+       r.in.domain_name = lp_workgroup(global_loadparm);
+       r.in.Account = NULL;
+       r.in.unknown = NULL;
+       r.in.num_ous = r.out.num_ous = &num_ous;
+       r.out.ous = &ous;
+
+       torture_comment(tctx, "testing NetrGetJoinableOus\n");
+
+       status = dcerpc_wkssvc_NetrGetJoinableOus(p, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "NetrGetJoinableOus failed");
+       torture_assert_werr_equal(tctx, r.out.result,
+                                 WERR_NOT_SUPPORTED,
+                                 "NetrGetJoinableOus failed");
+
+       return true;
+}
+
+static bool test_NetrGetJoinableOus2(struct torture_context *tctx,
+                                    struct dcerpc_pipe *p)
+{
+       NTSTATUS status;
+       struct wkssvc_NetrGetJoinableOus2 r;
+       uint32_t num_ous = 0;
+       const char **ous = NULL;
+
+       r.in.server_name = dcerpc_server_name(p);
+       r.in.domain_name = lp_workgroup(global_loadparm);
+       r.in.Account = NULL;
+       r.in.EncryptedPassword = NULL;
+       r.in.num_ous = r.out.num_ous = &num_ous;
+       r.out.ous = &ous;
+
+       torture_comment(tctx, "testing NetrGetJoinableOus2\n");
+
+       status = dcerpc_wkssvc_NetrGetJoinableOus2(p, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "NetrGetJoinableOus2 failed");
+       torture_assert_werr_equal(tctx, r.out.result,
+                                 WERR_RPC_E_REMOTE_DISABLED,
+                                 "NetrGetJoinableOus2 failed");
+
+       return true;
+}
 struct torture_suite *torture_rpc_wkssvc(TALLOC_CTX *mem_ctx)
 {
        struct torture_suite *suite;
@@ -1060,6 +1111,10 @@
 
        torture_rpc_tcase_add_test(tcase, "NetrGetJoinInformation",
                                   test_NetrGetJoinInformation);
+       torture_rpc_tcase_add_test(tcase, "NetrGetJoinableOus",
+                                  test_NetrGetJoinableOus);
+       torture_rpc_tcase_add_test(tcase, "NetrGetJoinableOus2",
+                                  test_NetrGetJoinableOus2);
 
        torture_rpc_tcase_add_test(tcase, "NetrWorkstationStatisticsGet",
                                   test_NetrWorkstationStatisticsGet);

Reply via email to