2 Unix SMB/CIFS implementation.
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 2 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, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "system/time.h"
24 #include "torture/torture.h"
26 #include "lib/util/dlinklist.h"
28 _PUBLIC_ int torture_nprocs=4;
29 _PUBLIC_ int torture_numops=10;
30 _PUBLIC_ int torture_entries=1000;
31 _PUBLIC_ int torture_failures=1;
32 _PUBLIC_ int torture_seed=0;
33 _PUBLIC_ int torture_numasync=100;
34 _PUBLIC_ bool torture_showall = false;
36 struct torture_suite_list *torture_suites = NULL;
38 NTSTATUS torture_register_suite(struct torture_suite *suite)
40 struct torture_suite_list *p, *n;
46 n = talloc(talloc_autofree_context(), struct torture_suite_list);
49 for (p = torture_suites; p; p = p->next) {
50 if (strcmp(p->suite->name, suite->name) == 0) {
51 /* Check for duplicates */
52 DEBUG(0,("There already is a suite registered with the name %s!\n", suite->name));
53 return NT_STATUS_OBJECT_NAME_COLLISION;
56 if (strcmp(p->suite->name, suite->name) < 0 &&
57 (!p->next || strcmp(p->next->suite->name, suite->name) > 0)) {
58 DLIST_ADD_AFTER(torture_suites, n, p);
63 DLIST_ADD_END(torture_suites, n, struct torture_suite_list *);
68 int torture_init(void)
70 init_module_fn static_init[] = STATIC_torture_MODULES;
71 init_module_fn *shared_init = load_samba_modules(NULL, "torture");
73 run_init_functions(static_init);
74 run_init_functions(shared_init);
76 talloc_free(shared_init);