svn commit: samba r14524 - in branches/SAMBA_4_0/source/torture: . libnet

jelmer at samba.org jelmer at samba.org
Fri Mar 17 16:45:24 GMT 2006


Author: jelmer
Date: 2006-03-17 16:45:24 +0000 (Fri, 17 Mar 2006)
New Revision: 14524

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14524

Log:
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

Added:
   branches/SAMBA_4_0/source/torture/libnet/libnet.c
Modified:
   branches/SAMBA_4_0/source/torture/
   branches/SAMBA_4_0/source/torture/config.mk
   branches/SAMBA_4_0/source/torture/torture.c
   branches/SAMBA_4_0/source/torture/torture.h
   branches/SAMBA_4_0/source/torture/torture_util.c


Changeset:

Property changes on: branches/SAMBA_4_0/source/torture
___________________________________________________________________
Name: svn:ignore
   - proto.h
torturebad.c
*.d

   + util.h
proto.h
torturebad.c
*.d


Modified: branches/SAMBA_4_0/source/torture/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/config.mk	2006-03-17 16:42:39 UTC (rev 14523)
+++ branches/SAMBA_4_0/source/torture/config.mk	2006-03-17 16:45:24 UTC (rev 14524)
@@ -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 @@
 		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 @@
 		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 @@
 
 #################################
 # 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 \

Added: branches/SAMBA_4_0/source/torture/libnet/libnet.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/libnet.c	2006-03-17 16:42:39 UTC (rev 14523)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet.c	2006-03-17 16:45:24 UTC (rev 14524)
@@ -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;
+}


Property changes on: branches/SAMBA_4_0/source/torture/libnet/libnet.c
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c	2006-03-17 16:42:39 UTC (rev 14523)
+++ branches/SAMBA_4_0/source/torture/torture.c	2006-03-17 16:45:24 UTC (rev 14524)
@@ -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_ 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 @@
 }
 
 
+
 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 @@
 /*
   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 @@
 	{"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)

Modified: branches/SAMBA_4_0/source/torture/torture.h
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.h	2006-03-17 16:42:39 UTC (rev 14523)
+++ branches/SAMBA_4_0/source/torture/torture.h	2006-03-17 16:45:24 UTC (rev 14524)
@@ -38,6 +38,7 @@
 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"

Modified: branches/SAMBA_4_0/source/torture/torture_util.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture_util.c	2006-03-17 16:42:39 UTC (rev 14523)
+++ branches/SAMBA_4_0/source/torture/torture_util.c	2006-03-17 16:45:24 UTC (rev 14524)
@@ -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"
 
 
 /**



More information about the samba-cvs mailing list