r24885: Convert to new torture API.
[jelmer/samba4-debian.git] / source / torture / rpc / dssetup.c
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 "torture/torture.h"
24 #include "librpc/gen_ndr/ndr_dssetup_c.h"
25 #include "torture/rpc/rpc.h"
26
27
28 bool test_DsRoleGetPrimaryDomainInformation(struct torture_context *tctx, 
29                                             struct dcerpc_pipe *p)
30 {
31         struct dssetup_DsRoleGetPrimaryDomainInformation r;
32         NTSTATUS status;
33         int i;
34
35         for (i=DS_ROLE_BASIC_INFORMATION; i <= DS_ROLE_OP_STATUS; i++) {
36                 r.in.level = i;
37                 torture_comment(tctx, "dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level %d\n", i);
38
39                 status = dcerpc_dssetup_DsRoleGetPrimaryDomainInformation(p, tctx, &r);
40                 torture_assert_ntstatus_ok(tctx, status, "DsRoleGetPrimaryDomainInformation failed");
41                 torture_assert_werr_ok(tctx, r.out.result, "DsRoleGetPrimaryDomainInformation failed");
42         }
43
44         return true;
45 }
46
47 struct torture_suite *torture_rpc_dssetup(TALLOC_CTX *mem_ctx)
48 {
49         struct torture_suite *suite = torture_suite_create(mem_ctx, "DSSETUP");
50         struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, "dssetup", &ndr_table_dssetup);
51
52         torture_rpc_tcase_add_test(tcase, "DsRoleGetPrimaryDomainInformation", test_DsRoleGetPrimaryDomainInformation);
53
54         return suite;
55 }