source: branches/samba-3.5.x/source4/torture/rpc/drsuapi.h

Last change on this file was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 2.0 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3
4 DRSUapi tests
5
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) Stefan (metze) Metzmacher 2004
8 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#include "librpc/gen_ndr/drsuapi.h"
25
26/**
27 * Data structure common for most of DRSUAPI tests
28 */
29struct DsPrivate {
30 struct dcerpc_pipe *pipe;
31 struct policy_handle bind_handle;
32 struct GUID bind_guid;
33 const char *domain_obj_dn;
34 const char *domain_guid_str;
35 const char *domain_dns_name;
36 struct GUID domain_guid;
37 struct drsuapi_DsGetDCInfo2 dcinfo;
38 struct test_join *join;
39};
40
41
42/**
43 * Custom torture macro to check dcerpc_drsuapi_ call
44 * return values printing more friendly messages
45 * \param _tctx torture context
46 * \param _p DCERPC pipe handle
47 * \param _ntstatus NTSTATUS for dcerpc_drsuapi_ call
48 * \param _pr in/out DCEPRC request structure
49 * \param _msg error message prefix
50 */
51#define torture_drsuapi_assert_call(_tctx, _p, _ntstat, _pr, _msg) \
52 do { \
53 NTSTATUS __nt = _ntstat; \
54 if (!NT_STATUS_IS_OK(__nt)) { \
55 const char *errstr = nt_errstr(__nt); \
56 if (NT_STATUS_EQUAL(__nt, NT_STATUS_NET_WRITE_FAULT)) { \
57 errstr = dcerpc_errstr(_tctx, _p->last_fault_code); \
58 } \
59 torture_fail(tctx, talloc_asprintf(_tctx, "%s failed - %s", _msg, errstr)); \
60 } \
61 torture_assert_werr_ok(_tctx, (_pr)->out.result, _msg); \
62 } while(0)
63
Note: See TracBrowser for help on using the repository browser.