LCOV - code coverage report
Current view: top level - source4/torture/rpc - dssetup.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 20 20 100.0 %
Date: 2024-04-21 15:09:00 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /* 
       2             :    Unix SMB/CIFS implementation.
       3             : 
       4             :    test suite for dssetup rpc operations
       5             : 
       6             :    Copyright (C) Andrew Tridgell 2004
       7             :    
       8             :    This program is free software; you can redistribute it and/or modify
       9             :    it under the terms of the GNU General Public License as published by
      10             :    the Free Software Foundation; either version 3 of the License, or
      11             :    (at your option) any later version.
      12             :    
      13             :    This program is distributed in the hope that it will be useful,
      14             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      15             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16             :    GNU General Public License for more details.
      17             :    
      18             :    You should have received a copy of the GNU General Public License
      19             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      20             : */
      21             : 
      22             : #include "includes.h"
      23             : #include "librpc/gen_ndr/ndr_dssetup_c.h"
      24             : #include "torture/rpc/torture_rpc.h"
      25             : 
      26             : 
      27          30 : bool test_DsRoleGetPrimaryDomainInformation_ext(struct torture_context *tctx, 
      28             :                                                 struct dcerpc_pipe *p,
      29             :                                                 NTSTATUS ext_status)
      30             : {
      31           3 :         struct dssetup_DsRoleGetPrimaryDomainInformation r;
      32           3 :         NTSTATUS status;
      33           3 :         int i;
      34          30 :         struct dcerpc_binding_handle *b = p->binding_handle;
      35             : 
      36         120 :         for (i=DS_ROLE_BASIC_INFORMATION; i <= DS_ROLE_OP_STATUS; i++) {
      37          90 :                 r.in.level = i;
      38          90 :                 torture_comment(tctx, "dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level %d\n", i);
      39             : 
      40          90 :                 status = dcerpc_dssetup_DsRoleGetPrimaryDomainInformation_r(b, tctx, &r);
      41          90 :                 torture_assert_ntstatus_equal(tctx, ext_status, status, "DsRoleGetPrimaryDomainInformation failed");
      42          90 :                 if (NT_STATUS_IS_OK(ext_status)) {
      43          90 :                         torture_assert_werr_ok(tctx, r.out.result, "DsRoleGetPrimaryDomainInformation failed");
      44             :                 }
      45             :         }
      46             : 
      47          27 :         return true;
      48             : }
      49             : 
      50          30 : bool test_DsRoleGetPrimaryDomainInformation(struct torture_context *tctx, 
      51             :                                             struct dcerpc_pipe *p)
      52             : {
      53          30 :         return test_DsRoleGetPrimaryDomainInformation_ext(tctx, p, NT_STATUS_OK);
      54             : }
      55             : 
      56        2354 : struct torture_suite *torture_rpc_dssetup(TALLOC_CTX *mem_ctx)
      57             : {
      58        2354 :         struct torture_suite *suite = torture_suite_create(mem_ctx, "dssetup");
      59        2354 :         struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, "dssetup", &ndr_table_dssetup);
      60             : 
      61        2354 :         torture_rpc_tcase_add_test(tcase, "DsRoleGetPrimaryDomainInformation", test_DsRoleGetPrimaryDomainInformation);
      62             : 
      63        2354 :         return suite;
      64             : }

Generated by: LCOV version 1.14