2 Unix SMB/CIFS implementation.
4 Copyright (C) Guenther Deschner 2009
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "torture/smbtorture.h"
22 #include "auth/credentials/credentials.h"
23 #include "lib/cmdline/popt_common.h"
25 #include "torture/libnetapi/proto.h"
27 bool torture_libnetapi_init_context(struct torture_context *tctx,
28 struct libnetapi_ctx **ctx_p)
30 NET_API_STATUS status;
31 struct libnetapi_ctx *ctx;
33 status = libnetapi_init(&ctx);
38 libnetapi_set_debuglevel(ctx,
39 talloc_asprintf(ctx, "%d", DEBUGLEVEL));
40 libnetapi_set_username(ctx,
41 cli_credentials_get_username(cmdline_credentials));
42 libnetapi_set_password(ctx,
43 cli_credentials_get_password(cmdline_credentials));
50 static bool torture_libnetapi_initialize(struct torture_context *tctx)
52 NET_API_STATUS status;
53 struct libnetapi_ctx *ctx;
55 status = libnetapi_init(&ctx);
65 NTSTATUS torture_libnetapi_init(void)
67 struct torture_suite *suite;
69 suite = torture_suite_create(talloc_autofree_context(), "NETAPI");
71 torture_suite_add_simple_test(suite, "SERVER", torture_libnetapi_server);
72 torture_suite_add_simple_test(suite, "GROUP", torture_libnetapi_group);
73 torture_suite_add_simple_test(suite, "USER", torture_libnetapi_user);
74 torture_suite_add_simple_test(suite, "INITIALIZE", torture_libnetapi_initialize);
76 suite->description = talloc_strdup(suite, "libnetapi convenience interface tests");
78 torture_register_suite(suite);