diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-03-17 16:45:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:57:36 -0500 |
commit | c67fd3f0e834841d4e7d13b5517f45eec8d1085c (patch) | |
tree | ae64621bdd578db8b253bdaa71c91a7656abd4ca /source4 | |
parent | d7254a36158b4355d711fa64c1f804b86aacbba1 (diff) | |
download | samba-c67fd3f0e834841d4e7d13b5517f45eec8d1085c.tar.gz samba-c67fd3f0e834841d4e7d13b5517f45eec8d1085c.tar.xz samba-c67fd3f0e834841d4e7d13b5517f45eec8d1085c.zip |
r14524: Make TORTURE_NET a separate module
Add new header for torture utility functions, so torture.h doesn't
need to depend on the SMB libraries
(This used to be commit ab162bcafc666f226332d4678b0875139a0d65c2)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/config.mk | 16 | ||||
-rw-r--r-- | source4/torture/libnet/libnet.c | 41 | ||||
-rw-r--r-- | source4/torture/torture.c | 22 | ||||
-rw-r--r-- | source4/torture/torture.h | 1 | ||||
-rw-r--r-- | source4/torture/torture_util.c | 2 |
5 files changed, 60 insertions, 22 deletions
diff --git a/source4/torture/config.mk b/source4/torture/config.mk index af80699093..5de3692f05 100644 --- a/source4/torture/config.mk +++ b/source4/torture/config.mk @@ -3,9 +3,9 @@ PUBLIC_HEADERS = torture.h PUBLIC_PROTO_HEADER = proto.h OBJ_FILES = \ - torture.o \ - torture_util.o + torture.o REQUIRED_SUBSYSTEMS = \ + TORTURE_UTIL \ TORTURE_RAW \ TORTURE_SMB2 \ TORTURE_RAP \ @@ -14,10 +14,13 @@ REQUIRED_SUBSYSTEMS = \ TORTURE_NBENCH \ TORTURE_LDAP \ TORTURE_NBT \ - TORTURE_NET \ CONFIG \ LIBBASIC +[SUBSYSTEM::TORTURE_UTIL] +OBJ_FILES = torture_util.o +PUBLIC_PROTO_HEADER = util.h + ################################# # Start SUBSYSTEM TORTURE_BASIC [MODULE::TORTURE_BASIC] @@ -146,7 +149,7 @@ REQUIRED_SUBSYSTEMS = \ RPC_NDR_MGMT RPC_NDR_NETLOGON RPC_NDR_ATSVC RPC_NDR_DRSUAPI \ RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_SPOOLSS \ RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \ - RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER WB_HELPER + RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER WB_HELPER LIBNET ################################# # Start SUBSYSTEM TORTURE_RAP @@ -221,10 +224,13 @@ REQUIRED_SUBSYSTEMS = \ ################################# # Start SUBSYSTEM TORTURE_NET -[SUBSYSTEM::TORTURE_NET] +[MODULE::TORTURE_NET] +SUBSYSTEM = torture +INIT_FUNCTION = torture_net_init PRIVATE_PROTO_HEADER = \ libnet/proto.h OBJ_FILES = \ + libnet/libnet.o \ libnet/userinfo.o \ libnet/userman.o \ libnet/domain.o \ diff --git a/source4/torture/libnet/libnet.c b/source4/torture/libnet/libnet.c new file mode 100644 index 0000000000..11084a382a --- /dev/null +++ b/source4/torture/libnet/libnet.c @@ -0,0 +1,41 @@ +/* + Unix SMB/CIFS implementation. + SMB torture tester + Copyright (C) Jelmer Vernooij 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "torture/torture.h" +#include "torture/libnet/proto.h" + +NTSTATUS torture_net_init(void) +{ + register_torture_op("NET-USERINFO", torture_userinfo, 0); + register_torture_op("NET-USERADD", torture_useradd, 0); + register_torture_op("NET-USERDEL", torture_userdel, 0); + register_torture_op("NET-USERMOD", torture_usermod, 0); + register_torture_op("NET-DOMOPEN", torture_domainopen, 0); + register_torture_op("NET-API-LOOKUP", torture_lookup, 0); + register_torture_op("NET-API-LOOKUPHOST", torture_lookup_host, 0); + register_torture_op("NET-API-LOOKUPPDC", torture_lookup_pdc, 0); + register_torture_op("NET-API-CREATEUSER", torture_createuser, 0); + register_torture_op("NET-API-RPCCONNECT", torture_rpc_connect, 0); + register_torture_op("NET-API-LISTSHARES", torture_listshares, 0); + register_torture_op("NET-API-DELSHARE", torture_delshare, 0); + + return NT_STATUS_OK; +} diff --git a/source4/torture/torture.c b/source4/torture/torture.c index a54c760dc8..4627164bef 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -45,6 +45,7 @@ #include "torture/nbt/proto.h" #include "torture/libnet/proto.h" #include "torture/torture.h" +#include "torture/util.h" #include "build.h" #include "dlinklist.h" @@ -56,10 +57,10 @@ _PUBLIC_ int torture_seed=0; _PUBLIC_ BOOL use_oplocks; static int procnum; /* records process count number when forking */ static struct smbcli_state *current_cli; -static BOOL use_level_II_oplocks; - +_PUBLIC_ BOOL use_level_II_oplocks; _PUBLIC_ BOOL torture_showall = False; + BOOL torture_open_connection_share(TALLOC_CTX *mem_ctx, struct smbcli_state **c, const char *hostname, @@ -135,6 +136,7 @@ _PUBLIC_ BOOL check_error(const char *location, struct smbcli_state *c, } + static BOOL wait_lock(struct smbcli_state *c, int fnum, uint32_t offset, uint32_t len) { while (NT_STATUS_IS_ERR(smbcli_lock(c->tree, fnum, offset, len, -1, WRITE_LOCK))) { @@ -438,7 +440,7 @@ static BOOL run_maxfidtest(struct smbcli_state *cli, int dummy) /* sees what IOCTLs are supported */ -BOOL torture_ioctl_test(void) +static BOOL torture_ioctl_test(void) { struct smbcli_state *cli; uint16_t device, function; @@ -733,20 +735,6 @@ static struct { {"NBT-WINSREPLICATION-REPLICA", torture_nbt_winsreplication_replica, 0}, {"NBT-WINSREPLICATION-OWNED", torture_nbt_winsreplication_owned, 0}, - /* libnet tests */ - {"NET-USERINFO", torture_userinfo, 0}, - {"NET-USERADD", torture_useradd, 0}, - {"NET-USERDEL", torture_userdel, 0}, - {"NET-USERMOD", torture_usermod, 0}, - {"NET-DOMOPEN", torture_domainopen, 0}, - {"NET-API-LOOKUP", torture_lookup, 0}, - {"NET-API-LOOKUPHOST", torture_lookup_host, 0}, - {"NET-API-LOOKUPPDC", torture_lookup_pdc, 0}, - {"NET-API-CREATEUSER", torture_createuser, 0}, - {"NET-API-RPCCONNECT", torture_rpc_connect, 0}, - {"NET-API-LISTSHARES", torture_listshares, 0}, - {"NET-API-DELSHARE", torture_delshare, 0}, - {NULL, NULL, 0}}; static void register_builtin_ops(void) diff --git a/source4/torture/torture.h b/source4/torture/torture.h index 6218700ac6..ff7ee09d23 100644 --- a/source4/torture/torture.h +++ b/source4/torture/torture.h @@ -38,6 +38,7 @@ extern int torture_nprocs; extern int torture_seed; extern int torture_numops; extern int torture_failures; +extern BOOL use_level_II_oplocks; #include "libcli/libcli.h" #include "torture/proto.h" diff --git a/source4/torture/torture_util.c b/source4/torture/torture_util.c index dde50f6522..ba96731b20 100644 --- a/source4/torture/torture_util.c +++ b/source4/torture/torture_util.c @@ -24,6 +24,8 @@ #include "libcli/libcli.h" #include "system/shmem.h" #include "system/time.h" +#include "lib/cmdline/popt_common.h" +#include "torture/torture.h" /** |