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.
24 static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
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_ServerAlive(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
51 status = dcerpc_ServerAlive(p, mem_ctx, &r);
52 if(NT_STATUS_IS_ERR(status)) {
53 fprintf(stderr, "ServerAlive: %s\n", nt_errstr(status));
57 if(!W_ERROR_IS_OK(r.out.result)) {
58 fprintf(stderr, "ServerAlive: %s\n", win_errstr(r.out.result));
66 static int test_ServerAlive2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
68 struct ServerAlive2 r;
71 status = dcerpc_ServerAlive2(p, mem_ctx, &r);
72 if(NT_STATUS_IS_ERR(status)) {
73 fprintf(stderr, "ServerAlive2: %s\n", nt_errstr(status));
77 if(!W_ERROR_IS_OK(r.out.result)) {
78 fprintf(stderr, "ServerAlive2: %s\n", win_errstr(r.out.result));
85 BOOL torture_rpc_oxidresolve(int dummy)
88 struct dcerpc_pipe *p;
92 mem_ctx = talloc_init("torture_rpc_oxidresolve");
94 status = torture_rpc_connection(&p,
95 DCERPC_IOXIDRESOLVER_NAME,
96 DCERPC_IOXIDRESOLVER_UUID,
97 DCERPC_IOXIDRESOLVER_VERSION);
99 if (!NT_STATUS_IS_OK(status)) {
103 if(!test_SimplePing(p, mem_ctx))
106 if(!test_ServerAlive(p, mem_ctx))
109 if(!test_ServerAlive2(p, mem_ctx))
112 talloc_destroy(mem_ctx);
114 torture_rpc_close(p);