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 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/>.
22 #include "system/time.h"
23 #include "torture/torture.h"
25 #include "lib/util/dlinklist.h"
26 #include "auth/credentials/credentials.h"
27 #include "lib/cmdline/popt_common.h"
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;
35 struct torture_suite *torture_root = NULL;
37 bool torture_register_suite(struct torture_suite *suite)
42 return torture_suite_add_suite(torture_root, suite);
45 struct torture_context *torture_context_init(TALLOC_CTX *mem_ctx,
46 const struct torture_ui_ops *ui_ops)
48 struct torture_context *torture = talloc_zero(mem_ctx,
49 struct torture_context);
50 torture->ui_ops = ui_ops;
51 torture->returncode = true;
52 torture->ev = cli_credentials_get_event_context(cmdline_credentials);
55 ui_ops->init(torture);
61 int torture_init(void)
63 init_module_fn static_init[] = STATIC_torture_MODULES;
64 init_module_fn *shared_init = load_samba_modules(NULL, "torture");
66 torture_root = talloc_zero(talloc_autofree_context(),
67 struct torture_suite);
69 run_init_functions(static_init);
70 run_init_functions(shared_init);
72 talloc_free(shared_init);