ctdb-server: Clean up connection tracking functions
[samba4-gss.git] / source3 / lib / netapi / tests / netwksta.c
blob2c3f57f8ed94b22d32c872e0dade4d11462cfea9
1 /*
2 * Unix SMB/CIFS implementation.
3 * NetWorkstation testsuite
4 * Copyright (C) Guenther Deschner 2008
5 * Copyright (C) Hans Leidekker 2013
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/>.
21 #include <sys/types.h>
22 #include <inttypes.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
27 #include <netapi.h>
29 #include "common.h"
31 NET_API_STATUS netapitest_wksta(struct libnetapi_ctx *ctx,
32 const char *hostname)
34 NET_API_STATUS status = 0;
35 uint32_t levels[] = { 100, 101, 102 };
36 int i;
38 printf("NetWorkstation tests\n");
40 /* basic queries */
41 for (i=0; i<ARRAY_SIZE(levels); i++) {
42 uint8_t *buffer = NULL;
43 printf("testing NetWkstaGetInfo level %d\n", levels[i]);
45 status = NetWkstaGetInfo(hostname, levels[i], &buffer);
46 if (status && status != 124) {
47 NETAPI_STATUS(ctx, status, "NetWkstaGetInfo");
48 goto out;
52 status = 0;
54 printf("NetWorkstation tests succeeded\n");
55 out:
56 if (status != 0) {
57 printf("NetWorkstation testsuite failed with: %s\n",
58 libnetapi_get_error_string(ctx, status));
61 return status;