Move root check out of smb1_file_se_access_check() in preparation for deleting this...
[Samba/gebeck_regimport.git] / source4 / torture / torture.c
blobdc35073eba826c3033dff552cf1376c4da1cf169
1 /*
2 Unix SMB/CIFS implementation.
3 SMB torture tester
4 Copyright (C) Andrew Tridgell 1997-2003
5 Copyright (C) Jelmer Vernooij 2006
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 "includes.h"
22 #include "system/time.h"
23 #include "param/param.h"
24 #include "lib/cmdline/popt_common.h"
25 #include "torture/smbtorture.h"
26 #include "lib/util/samba_module.h"
28 _PUBLIC_ int torture_numops=10;
29 _PUBLIC_ int torture_entries=1000;
30 _PUBLIC_ int torture_failures=1;
31 _PUBLIC_ int torture_seed=0;
32 _PUBLIC_ int torture_numasync=100;
34 struct torture_suite *torture_root = NULL;
36 bool torture_register_suite(struct torture_suite *suite)
38 if (!suite)
39 return true;
41 if (torture_root == NULL)
42 torture_root = talloc_zero(talloc_autofree_context(), struct torture_suite);
44 return torture_suite_add_suite(torture_root, suite);
47 _PUBLIC_ int torture_init(void)
49 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
50 STATIC_smbtorture_MODULES_PROTO;
51 samba_module_init_fn static_init[] = { STATIC_smbtorture_MODULES };
52 samba_module_init_fn *shared_init = samba_module_init_fns_for_subsystem(NULL, "smbtorture");
54 samba_module_init_fns_run(static_init);
55 samba_module_init_fns_run(shared_init);
57 talloc_free(shared_init);
59 return 0;