source: branches/samba-3.3.x/source/lib/netapi/tests/common.h

Last change on this file was 206, checked in by Herwig Bauernfeind, 16 years ago

Import Samba 3.3 branch at 3.0.0 level (psmedley's port)

File size: 2.2 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 * NetApi testsuite
4 * Copyright (C) Guenther Deschner 2008
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#include <popt.h>
21
22void popt_common_callback(poptContext con,
23 enum poptCallbackReason reason,
24 const struct poptOption *opt,
25 const char *arg, const void *data);
26
27extern struct poptOption popt_common_netapi_examples[];
28
29#define POPT_COMMON_LIBNETAPI_EXAMPLES { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netapi_examples, 0, "Common samba netapi example options:", NULL },
30
31NET_API_STATUS test_netuseradd(const char *hostname,
32 const char *username);
33
34NET_API_STATUS netapitest_localgroup(struct libnetapi_ctx *ctx,
35 const char *hostname);
36NET_API_STATUS netapitest_user(struct libnetapi_ctx *ctx,
37 const char *hostname);
38NET_API_STATUS netapitest_group(struct libnetapi_ctx *ctx,
39 const char *hostname);
40NET_API_STATUS netapitest_display(struct libnetapi_ctx *ctx,
41 const char *hostname);
42NET_API_STATUS netapitest_share(struct libnetapi_ctx *ctx,
43 const char *hostname);
44NET_API_STATUS netapitest_file(struct libnetapi_ctx *ctx,
45 const char *hostname);
46
47#ifndef ARRAY_SIZE
48#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
49#endif
50
51#define NETAPI_STATUS(x,y,fn) \
52 printf("FAILURE: line %d: %s failed with status: %s (%d)\n", \
53 __LINE__, fn, libnetapi_get_error_string(x,y), y);
54
55#define NETAPI_STATUS_MSG(x,y,fn,z) \
56 printf("FAILURE: line %d: %s failed with status: %s (%d), %s\n", \
57 __LINE__, fn, libnetapi_get_error_string(x,y), y, z);
58
59#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
Note: See TracBrowser for help on using the repository browser.