2003-08-13 01:53:07 +00:00
/*
Unix SMB / CIFS implementation .
SMB torture tester
Copyright ( C ) Andrew Tridgell 1997 - 2003
2006-03-14 15:02:05 +00:00
Copyright ( C ) Jelmer Vernooij 2006
2003-08-13 01:53:07 +00:00
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 0213 9 , USA .
*/
# include "includes.h"
2004-11-02 00:24:21 +00:00
# include "system/time.h"
2006-03-25 16:01:28 +00:00
# include "torture/torture.h"
2006-03-13 21:21:44 +00:00
# include "build.h"
2006-08-30 11:29:34 +00:00
# include "lib/util/dlinklist.h"
2006-02-04 14:08:24 +00:00
2006-03-17 16:11:02 +00:00
_PUBLIC_ int torture_numops = 10 ;
_PUBLIC_ int torture_entries = 1000 ;
_PUBLIC_ int torture_failures = 1 ;
_PUBLIC_ int torture_seed = 0 ;
2006-05-05 09:52:12 +00:00
_PUBLIC_ int torture_numasync = 100 ;
2003-08-13 01:53:07 +00:00
2006-10-16 23:09:15 +00:00
struct torture_suite * torture_root = NULL ;
2006-03-13 21:21:44 +00:00
2006-10-16 23:09:15 +00:00
bool torture_register_suite ( struct torture_suite * suite )
2006-03-13 21:21:44 +00:00
{
2006-10-16 23:09:15 +00:00
if ( ! suite )
return true ;
2006-03-13 21:21:44 +00:00
2006-10-16 23:09:15 +00:00
return torture_suite_add_suite ( torture_root , suite ) ;
2006-03-13 21:21:44 +00:00
}
2003-08-13 01:53:07 +00:00
2006-10-17 22:06:43 +00:00
struct torture_context * torture_context_init ( TALLOC_CTX * mem_ctx ,
const struct torture_ui_ops * ui_ops )
{
struct torture_context * torture = talloc_zero ( mem_ctx ,
struct torture_context ) ;
torture - > ui_ops = ui_ops ;
2007-01-31 00:30:52 +00:00
torture - > returncode = true ;
2006-10-17 22:06:43 +00:00
return torture ;
}
2006-03-17 16:27:22 +00:00
int torture_init ( void )
2003-08-13 01:53:07 +00:00
{
2006-03-17 16:27:22 +00:00
init_module_fn static_init [ ] = STATIC_torture_MODULES ;
2006-03-13 21:21:44 +00:00
init_module_fn * shared_init = load_samba_modules ( NULL , " torture " ) ;
2006-10-16 23:09:15 +00:00
torture_root = talloc_zero ( talloc_autofree_context ( ) ,
struct torture_suite ) ;
2006-03-13 21:21:44 +00:00
run_init_functions ( static_init ) ;
run_init_functions ( shared_init ) ;
talloc_free ( shared_init ) ;
2006-03-17 16:27:22 +00:00
return 0 ;
2003-08-13 01:53:07 +00:00
}