s4: torture: Pass the new talloc context into torture_init().
[garming/samba-autobuild/.git] / source4 / torture / smbtorture.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB torture tester
4    Copyright (C) Andrew Tridgell 1997-2003
5    Copyright (C) Jelmer Vernooij 2006
6    
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.
11    
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.
16    
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/>.
19 */
20
21 #ifndef __SMBTORTURE_H__
22 #define __SMBTORTURE_H__
23
24 #include "../lib/torture/torture.h"
25
26 struct smbcli_state;
27
28 extern struct torture_suite *torture_root;
29
30 extern int torture_entries;
31 extern int torture_seed;
32 extern int torture_numops;
33 extern int torture_failures;
34 extern int torture_numasync;
35
36 struct torture_test;
37 int torture_init(TALLOC_CTX *);
38 bool torture_register_suite(struct torture_suite *suite);
39 void torture_shell(struct torture_context *tctx);
40 void torture_print_testsuites(bool structured);
41 bool torture_run_named_tests(struct torture_context *torture, const char *name,
42                             const char **restricted);
43 bool torture_parse_target(TALLOC_CTX *ctx,
44                         struct loadparm_context *lp_ctx,
45                         const char *target);
46
47 /* Server Functionality Support */
48
49 /* Not all SMB server implementations support every aspect of the protocol.
50  * To allow smbtorture to provide useful data when run against these servers we
51  * define support parameters here, that will cause some tests to be skipped or
52  * the correctness checking of some tests to be conditional.
53  *
54  * The idea is that different server implementations can be specified on the
55  * command line such as "--target=win7" which will define the list of server
56  * parameters that are not supported.  This is mostly a black list of
57  * unsupported features with the default expectation being that all features are
58  * supported.
59  *
60  * Because we use parametric options we do not need to define these parameters
61  * anywhere, we just define the meaning of each here.*/
62
63 /* torture:cn_max_buffer_size
64  *
65  * This parameter specifies the maximum buffer size given in a change notify
66  * request.  If an overly large buffer is requested by a client, the server
67  * will return a STATUS_INVALID_PARAMETER.  The max buffer size on Windows
68  * server pre-Win7 was 0x00080000.  In Win7 this was reduced to 0x00010000.
69  */
70
71 /* torture:invalid_lock_range_support
72  *
73  * This parameter specifies whether the server will return
74  * STATUS_INVALID_LOCK_RANGE in response to a LockingAndX request where the
75  * combined offset and range overflow the 63-bit boundary.  On Windows servers
76  * before Win7, this request would return STATUS_OK, but the actual lock
77  * behavior was undefined. */
78
79 /* torture:openx_deny_dos_support
80  *
81  * This parameter specifies whether the server supports the DENY_DOS open mode
82  * of the SMBOpenX PDU. */
83
84 /* torture:range_not_locked_on_file_close
85  *
86  * When a byte range lock is pending, and the file which is being locked is
87  * closed, Windows servers return the error NT_STATUS_RANGE_NOT_LOCKED. This
88  * is strange, as this error is meant to be returned only for unlock requests.
89  * When true, torture will expect the Windows behavior, otherwise it will
90  * expect the more logical NT_STATUS_LOCK_NOT_GRANTED.
91  */
92
93 /* torture:sacl_support
94  *
95  * This parameter specifies whether the server supports the setting and
96  * retrieval of System Access Control Lists.  This includes whether the server
97  * supports the use of the SEC_FLAG_SYSTEM_SECURITY bit in the open access
98  * mask.*/
99
100 /* torture:smbexit_pdu_support
101  *
102  * This parameter specifies whether the server supports the SMBExit (0x11) PDU. */
103
104 /* torture:smblock_pdu_support
105  *
106  * This parameter specifies whether the server supports the SMBLock (0x0C) PDU. */
107
108 /* torture:2_step_break_to_none
109  *
110  * If true this parameter tests servers that break from level 1 to none in two
111  * steps rather than 1.
112  */
113
114 /* torture:resume_key_support
115  *
116  * Server supports resuming search via key.
117  */
118
119 /* torture:rewind_support
120  *
121  * Server supports rewinding during search.
122  */
123
124 /* torture:ea_support
125  *
126  * Server supports OS/2 style EAs.
127  */
128
129 /* torture:search_ea_support
130  *
131  * Server supports RAW_SEARCH_DATA_EA_LIST - Torture currently
132  * does not interact correctly with win7, this flag disables
133  * the appropriate test.
134  */
135
136 /* torture:hide_on_acess_denied
137  *
138  * Some servers (win7) choose to hide files when certain access has been
139  * denied.  When true, torture will expect NT_STATUS_OBJECT_NAME_NOT_FOUND
140  * rather than NT_STATUS_ACCESS_DENIED when trying to open one of these files.
141  */
142
143 /* torture:raw_search_search
144  *
145  * Server supports RAW_SEARCH_SEARCH level.
146  */
147
148 /* torture:search_ea_size
149  *
150  * Server supports RAW_SEARCH_DATA_EA_SIZE - This flag disables
151  * the appropriate test.
152  */
153
154 #endif /* __SMBTORTURE_H__ */