2 Unix SMB/CIFS implementation.
3 test suite for wkssvc rpc operations
5 Copyright (C) Andrew Tridgell 2003
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 3 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, see <http://www.gnu.org/licenses/>.
22 #include "torture/torture.h"
23 #include "librpc/gen_ndr/ndr_wkssvc_c.h"
24 #include "torture/rpc/rpc.h"
26 static bool test_NetWkstaGetInfo(struct torture_context *tctx,
27 struct dcerpc_pipe *p)
30 struct wkssvc_NetWkstaGetInfo r;
31 union wkssvc_NetWkstaInfo info;
32 uint16_t levels[] = {100, 101, 102, 502};
35 r.in.server_name = dcerpc_server_name(p);
38 for (i=0;i<ARRAY_SIZE(levels);i++) {
39 r.in.level = levels[i];
40 torture_comment(tctx, "testing NetWkstaGetInfo level %u\n", r.in.level);
41 status = dcerpc_wkssvc_NetWkstaGetInfo(p, tctx, &r);
42 torture_assert_ntstatus_ok(tctx, status,
43 talloc_asprintf(tctx, "NetWkstaGetInfo level %u failed", r.in.level));
44 torture_assert_werr_ok(tctx, r.out.result,
45 talloc_asprintf(tctx, "NetWkstaGetInfo level %u failed", r.in.level));
52 static bool test_NetWkstaTransportEnum(struct torture_context *tctx,
53 struct dcerpc_pipe *p)
56 struct wkssvc_NetWkstaTransportEnum r;
57 uint32_t resume_handle = 0;
58 union wkssvc_NetWkstaTransportCtr ctr;
59 struct wkssvc_NetWkstaTransportCtr0 ctr0;
64 r.in.server_name = dcerpc_server_name(p);
67 r.in.max_buffer = (uint32_t)-1;
68 r.in.resume_handle = &resume_handle;
70 r.out.resume_handle = &resume_handle;
72 status = dcerpc_wkssvc_NetWkstaTransportEnum(p, tctx, &r);
73 torture_assert_ntstatus_ok(tctx, status, "NetWkstaTransportEnum failed");
74 torture_assert_werr_ok(tctx, r.out.result, talloc_asprintf(tctx,
75 "NetWkstaTransportEnum level %u failed", r.in.level));
80 struct torture_suite *torture_rpc_wkssvc(void)
82 struct torture_suite *suite;
83 struct torture_tcase *tcase;
85 suite = torture_suite_create(talloc_autofree_context(), "WKSSVC");
86 tcase = torture_suite_add_rpc_iface_tcase(suite, "wkssvc",
89 torture_rpc_tcase_add_test(tcase, "NetWkstaGetInfo", test_NetWkstaGetInfo);
90 torture_rpc_tcase_add_test(tcase, "NetWkstaTransportEnum",
91 test_NetWkstaTransportEnum);