2 Unix SMB/CIFS implementation.
3 test suite for oxidresolve operations
5 Copyright (C) Jelmer Vernooij 2004
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "librpc/gen_ndr/ndr_oxidresolver.h"
25 static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid)
32 status = dcerpc_SimplePing(p, mem_ctx, &r);
33 if(NT_STATUS_IS_ERR(status)) {
34 fprintf(stderr, "SimplePing: %s\n", nt_errstr(status));
38 if(!W_ERROR_IS_OK(r.out.result)) {
39 fprintf(stderr, "SimplePing: %s\n", win_errstr(r.out.result));
46 static int test_ComplexPing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T *setid)
58 status = dcerpc_ComplexPing(p, mem_ctx, &r);
59 if(NT_STATUS_IS_ERR(status)) {
60 fprintf(stderr, "ComplexPing: %s\n", nt_errstr(status));
64 if(!W_ERROR_IS_OK(r.out.result)) {
65 fprintf(stderr, "ComplexPing: %s\n", win_errstr(r.out.result));
74 static int test_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
79 status = dcerpc_ServerAlive(p, mem_ctx, &r);
80 if(NT_STATUS_IS_ERR(status)) {
81 fprintf(stderr, "ServerAlive: %s\n", nt_errstr(status));
85 if(!W_ERROR_IS_OK(r.out.result)) {
86 fprintf(stderr, "ServerAlive: %s\n", win_errstr(r.out.result));
94 static int test_ServerAlive2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
96 struct ServerAlive2 r;
99 status = dcerpc_ServerAlive2(p, mem_ctx, &r);
100 if(NT_STATUS_IS_ERR(status)) {
101 fprintf(stderr, "ServerAlive2: %s\n", nt_errstr(status));
105 if(!W_ERROR_IS_OK(r.out.result)) {
106 fprintf(stderr, "ServerAlive2: %s\n", win_errstr(r.out.result));
113 BOOL torture_rpc_oxidresolve(void)
116 struct dcerpc_pipe *p;
121 mem_ctx = talloc_init("torture_rpc_oxidresolve");
123 status = torture_rpc_connection(&p,
124 DCERPC_IOXIDRESOLVER_NAME,
125 DCERPC_IOXIDRESOLVER_UUID,
126 DCERPC_IOXIDRESOLVER_VERSION);
128 if (!NT_STATUS_IS_OK(status)) {
132 if(!test_ServerAlive(p, mem_ctx))
135 if(!test_ComplexPing(p, mem_ctx, &setid))
138 if(!test_SimplePing(p, mem_ctx, setid))
141 if(!test_ServerAlive2(p, mem_ctx))
144 talloc_destroy(mem_ctx);
146 torture_rpc_close(p);