2 Unix SMB/CIFS implementation.
4 test suite for SMB2 compounded requests
6 Copyright (C) Stefan Metzmacher 2009
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "libcli/smb2/smb2.h"
24 #include "libcli/smb2/smb2_calls.h"
25 #include "torture/torture.h"
26 #include "torture/smb2/proto.h"
28 #define CHECK_STATUS(status, correct) do { \
29 if (!NT_STATUS_EQUAL(status, correct)) { \
30 torture_result(tctx, TORTURE_FAIL, __location__": Incorrect status %s - should be %s", \
31 nt_errstr(status), nt_errstr(correct)); \
36 #define TARGET_IS_W2K8(_tctx) (torture_setting_bool(_tctx, "w2k8", false))
37 #define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false))
39 static bool test_compound_related1(struct torture_context
*tctx
,
40 struct smb2_tree
*tree
)
42 struct smb2_handle hd
;
43 struct smb2_create cr
;
45 const char *fname
= "compound_related1.dat";
48 struct smb2_request
*req
[2];
49 uint32_t saved_tid
= tree
->tid
;
50 uint64_t saved_uid
= tree
->session
->uid
;
52 smb2_transport_credits_ask_num(tree
->session
->transport
, 2);
54 smb2_util_unlink(tree
, fname
);
56 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
59 cr
.in
.security_flags
= 0x00;
60 cr
.in
.oplock_level
= 0;
61 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
62 cr
.in
.create_flags
= 0x00000000;
63 cr
.in
.reserved
= 0x00000000;
64 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
65 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
66 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
67 NTCREATEX_SHARE_ACCESS_WRITE
|
68 NTCREATEX_SHARE_ACCESS_DELETE
;
69 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
70 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
71 NTCREATEX_OPTIONS_ASYNC_ALERT
|
72 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
76 smb2_transport_compound_start(tree
->session
->transport
, 2);
78 req
[0] = smb2_create_send(tree
, &cr
);
80 smb2_transport_compound_set_related(tree
->session
->transport
, true);
82 hd
.data
[0] = UINT64_MAX
;
83 hd
.data
[1] = UINT64_MAX
;
86 cl
.in
.file
.handle
= hd
;
88 tree
->tid
= 0xFFFFFFFF;
89 tree
->session
->uid
= UINT64_MAX
;
91 req
[1] = smb2_close_send(tree
, &cl
);
93 status
= smb2_create_recv(req
[0], tree
, &cr
);
94 CHECK_STATUS(status
, NT_STATUS_OK
);
95 status
= smb2_close_recv(req
[1], &cl
);
96 CHECK_STATUS(status
, NT_STATUS_OK
);
98 tree
->tid
= saved_tid
;
99 tree
->session
->uid
= saved_uid
;
101 smb2_util_unlink(tree
, fname
);
106 static bool test_compound_related2(struct torture_context
*tctx
,
107 struct smb2_tree
*tree
)
109 struct smb2_handle hd
;
110 struct smb2_create cr
;
112 const char *fname
= "compound_related2.dat";
113 struct smb2_close cl
;
115 struct smb2_request
*req
[5];
116 uint32_t saved_tid
= tree
->tid
;
117 uint64_t saved_uid
= tree
->session
->uid
;
119 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
121 smb2_util_unlink(tree
, fname
);
123 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
126 cr
.in
.security_flags
= 0x00;
127 cr
.in
.oplock_level
= 0;
128 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
129 cr
.in
.create_flags
= 0x00000000;
130 cr
.in
.reserved
= 0x00000000;
131 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
132 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
133 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
134 NTCREATEX_SHARE_ACCESS_WRITE
|
135 NTCREATEX_SHARE_ACCESS_DELETE
;
136 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
137 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
138 NTCREATEX_OPTIONS_ASYNC_ALERT
|
139 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
143 smb2_transport_compound_start(tree
->session
->transport
, 5);
145 req
[0] = smb2_create_send(tree
, &cr
);
147 hd
.data
[0] = UINT64_MAX
;
148 hd
.data
[1] = UINT64_MAX
;
150 smb2_transport_compound_set_related(tree
->session
->transport
, true);
153 cl
.in
.file
.handle
= hd
;
154 tree
->tid
= 0xFFFFFFFF;
155 tree
->session
->uid
= UINT64_MAX
;
157 req
[1] = smb2_close_send(tree
, &cl
);
158 req
[2] = smb2_close_send(tree
, &cl
);
159 req
[3] = smb2_close_send(tree
, &cl
);
160 req
[4] = smb2_close_send(tree
, &cl
);
162 status
= smb2_create_recv(req
[0], tree
, &cr
);
163 CHECK_STATUS(status
, NT_STATUS_OK
);
164 status
= smb2_close_recv(req
[1], &cl
);
165 CHECK_STATUS(status
, NT_STATUS_OK
);
166 status
= smb2_close_recv(req
[2], &cl
);
167 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
168 status
= smb2_close_recv(req
[3], &cl
);
169 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
170 status
= smb2_close_recv(req
[4], &cl
);
171 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
173 tree
->tid
= saved_tid
;
174 tree
->session
->uid
= saved_uid
;
176 smb2_util_unlink(tree
, fname
);
181 static bool test_compound_unrelated1(struct torture_context
*tctx
,
182 struct smb2_tree
*tree
)
184 struct smb2_handle hd
;
185 struct smb2_create cr
;
187 const char *fname
= "compound_unrelated1.dat";
188 struct smb2_close cl
;
190 struct smb2_request
*req
[5];
192 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
194 smb2_util_unlink(tree
, fname
);
196 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
199 cr
.in
.security_flags
= 0x00;
200 cr
.in
.oplock_level
= 0;
201 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
202 cr
.in
.create_flags
= 0x00000000;
203 cr
.in
.reserved
= 0x00000000;
204 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
205 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
206 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
207 NTCREATEX_SHARE_ACCESS_WRITE
|
208 NTCREATEX_SHARE_ACCESS_DELETE
;
209 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
210 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
211 NTCREATEX_OPTIONS_ASYNC_ALERT
|
212 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
216 smb2_transport_compound_start(tree
->session
->transport
, 5);
218 req
[0] = smb2_create_send(tree
, &cr
);
220 hd
.data
[0] = UINT64_MAX
;
221 hd
.data
[1] = UINT64_MAX
;
224 cl
.in
.file
.handle
= hd
;
225 req
[1] = smb2_close_send(tree
, &cl
);
226 req
[2] = smb2_close_send(tree
, &cl
);
227 req
[3] = smb2_close_send(tree
, &cl
);
228 req
[4] = smb2_close_send(tree
, &cl
);
230 status
= smb2_create_recv(req
[0], tree
, &cr
);
231 CHECK_STATUS(status
, NT_STATUS_OK
);
232 status
= smb2_close_recv(req
[1], &cl
);
233 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
234 status
= smb2_close_recv(req
[2], &cl
);
235 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
236 status
= smb2_close_recv(req
[3], &cl
);
237 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
238 status
= smb2_close_recv(req
[4], &cl
);
239 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
241 smb2_util_unlink(tree
, fname
);
246 static bool test_compound_invalid1(struct torture_context
*tctx
,
247 struct smb2_tree
*tree
)
249 struct smb2_handle hd
;
250 struct smb2_create cr
;
252 const char *fname
= "compound_invalid1.dat";
253 struct smb2_close cl
;
255 struct smb2_request
*req
[3];
257 smb2_transport_credits_ask_num(tree
->session
->transport
, 3);
259 smb2_util_unlink(tree
, fname
);
261 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
264 cr
.in
.security_flags
= 0x00;
265 cr
.in
.oplock_level
= 0;
266 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
267 cr
.in
.create_flags
= 0x00000000;
268 cr
.in
.reserved
= 0x00000000;
269 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
270 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
271 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
272 NTCREATEX_SHARE_ACCESS_WRITE
|
273 NTCREATEX_SHARE_ACCESS_DELETE
;
274 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
275 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
276 NTCREATEX_OPTIONS_ASYNC_ALERT
|
277 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
281 smb2_transport_compound_start(tree
->session
->transport
, 3);
283 /* passing the first request with the related flag is invalid */
284 smb2_transport_compound_set_related(tree
->session
->transport
, true);
286 req
[0] = smb2_create_send(tree
, &cr
);
288 hd
.data
[0] = UINT64_MAX
;
289 hd
.data
[1] = UINT64_MAX
;
292 cl
.in
.file
.handle
= hd
;
293 req
[1] = smb2_close_send(tree
, &cl
);
295 smb2_transport_compound_set_related(tree
->session
->transport
, false);
296 req
[2] = smb2_close_send(tree
, &cl
);
298 status
= smb2_create_recv(req
[0], tree
, &cr
);
299 /* TODO: check why this fails with --signing=required */
300 CHECK_STATUS(status
, NT_STATUS_INVALID_PARAMETER
);
301 status
= smb2_close_recv(req
[1], &cl
);
302 CHECK_STATUS(status
, NT_STATUS_INVALID_PARAMETER
);
303 status
= smb2_close_recv(req
[2], &cl
);
304 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
306 smb2_util_unlink(tree
, fname
);
311 static bool test_compound_invalid2(struct torture_context
*tctx
,
312 struct smb2_tree
*tree
)
314 struct smb2_handle hd
;
315 struct smb2_create cr
;
317 const char *fname
= "compound_invalid2.dat";
318 struct smb2_close cl
;
320 struct smb2_request
*req
[5];
321 uint32_t saved_tid
= tree
->tid
;
322 uint64_t saved_uid
= tree
->session
->uid
;
324 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
326 smb2_util_unlink(tree
, fname
);
328 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
331 cr
.in
.security_flags
= 0x00;
332 cr
.in
.oplock_level
= 0;
333 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
334 cr
.in
.create_flags
= 0x00000000;
335 cr
.in
.reserved
= 0x00000000;
336 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
337 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
338 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
339 NTCREATEX_SHARE_ACCESS_WRITE
|
340 NTCREATEX_SHARE_ACCESS_DELETE
;
341 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
342 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
343 NTCREATEX_OPTIONS_ASYNC_ALERT
|
344 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
348 smb2_transport_compound_start(tree
->session
->transport
, 5);
350 req
[0] = smb2_create_send(tree
, &cr
);
352 hd
.data
[0] = UINT64_MAX
;
353 hd
.data
[1] = UINT64_MAX
;
355 smb2_transport_compound_set_related(tree
->session
->transport
, true);
358 cl
.in
.file
.handle
= hd
;
359 tree
->tid
= 0xFFFFFFFF;
360 tree
->session
->uid
= UINT64_MAX
;
362 req
[1] = smb2_close_send(tree
, &cl
);
363 /* strange that this is not generating invalid parameter */
364 smb2_transport_compound_set_related(tree
->session
->transport
, false);
365 req
[2] = smb2_close_send(tree
, &cl
);
366 req
[3] = smb2_close_send(tree
, &cl
);
367 smb2_transport_compound_set_related(tree
->session
->transport
, true);
368 req
[4] = smb2_close_send(tree
, &cl
);
370 status
= smb2_create_recv(req
[0], tree
, &cr
);
371 CHECK_STATUS(status
, NT_STATUS_OK
);
372 status
= smb2_close_recv(req
[1], &cl
);
373 CHECK_STATUS(status
, NT_STATUS_OK
);
374 status
= smb2_close_recv(req
[2], &cl
);
375 CHECK_STATUS(status
, NT_STATUS_USER_SESSION_DELETED
);
376 status
= smb2_close_recv(req
[3], &cl
);
377 CHECK_STATUS(status
, NT_STATUS_USER_SESSION_DELETED
);
378 status
= smb2_close_recv(req
[4], &cl
);
379 CHECK_STATUS(status
, NT_STATUS_INVALID_PARAMETER
);
381 tree
->tid
= saved_tid
;
382 tree
->session
->uid
= saved_uid
;
384 smb2_util_unlink(tree
, fname
);
389 static bool test_compound_invalid3(struct torture_context
*tctx
,
390 struct smb2_tree
*tree
)
392 struct smb2_handle hd
;
393 struct smb2_create cr
;
395 const char *fname
= "compound_invalid3.dat";
396 struct smb2_close cl
;
398 struct smb2_request
*req
[5];
400 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
402 smb2_util_unlink(tree
, fname
);
404 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
407 cr
.in
.security_flags
= 0x00;
408 cr
.in
.oplock_level
= 0;
409 cr
.in
.impersonation_level
= NTCREATEX_IMPERSONATION_IMPERSONATION
;
410 cr
.in
.create_flags
= 0x00000000;
411 cr
.in
.reserved
= 0x00000000;
412 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
413 cr
.in
.file_attributes
= FILE_ATTRIBUTE_NORMAL
;
414 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
415 NTCREATEX_SHARE_ACCESS_WRITE
|
416 NTCREATEX_SHARE_ACCESS_DELETE
;
417 cr
.in
.create_disposition
= NTCREATEX_DISP_OPEN_IF
;
418 cr
.in
.create_options
= NTCREATEX_OPTIONS_SEQUENTIAL_ONLY
|
419 NTCREATEX_OPTIONS_ASYNC_ALERT
|
420 NTCREATEX_OPTIONS_NON_DIRECTORY_FILE
|
424 smb2_transport_compound_start(tree
->session
->transport
, 5);
426 req
[0] = smb2_create_send(tree
, &cr
);
428 hd
.data
[0] = UINT64_MAX
;
429 hd
.data
[1] = UINT64_MAX
;
432 cl
.in
.file
.handle
= hd
;
433 req
[1] = smb2_close_send(tree
, &cl
);
434 req
[2] = smb2_close_send(tree
, &cl
);
435 /* flipping the related flag is invalid */
436 smb2_transport_compound_set_related(tree
->session
->transport
, true);
437 req
[3] = smb2_close_send(tree
, &cl
);
438 req
[4] = smb2_close_send(tree
, &cl
);
440 status
= smb2_create_recv(req
[0], tree
, &cr
);
441 CHECK_STATUS(status
, NT_STATUS_OK
);
442 status
= smb2_close_recv(req
[1], &cl
);
443 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
444 status
= smb2_close_recv(req
[2], &cl
);
445 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
446 status
= smb2_close_recv(req
[3], &cl
);
447 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
448 status
= smb2_close_recv(req
[4], &cl
);
449 CHECK_STATUS(status
, NT_STATUS_FILE_CLOSED
);
451 smb2_util_unlink(tree
, fname
);
456 /* Send a compound request where we expect the last request (Create, Notify)
457 * to go asynchronous. This works against a Win7 server and the reply is
458 * sent in two different packets. */
459 static bool test_compound_interim1(struct torture_context
*tctx
,
460 struct smb2_tree
*tree
)
462 struct smb2_handle hd
;
463 struct smb2_create cr
;
464 NTSTATUS status
= NT_STATUS_OK
;
465 const char *dname
= "compound_interim_dir";
466 struct smb2_notify nt
;
468 struct smb2_request
*req
[2];
470 /* Win7 compound request implementation deviates substantially from the
471 * SMB2 spec as noted in MS-SMB2 <159>, <162>. This, test currently
472 * verifies the Windows behavior, not the general spec behavior. */
474 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
476 smb2_deltree(tree
, dname
);
478 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
481 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
482 cr
.in
.create_options
= NTCREATEX_OPTIONS_DIRECTORY
;
483 cr
.in
.file_attributes
= FILE_ATTRIBUTE_DIRECTORY
;
484 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
485 NTCREATEX_SHARE_ACCESS_WRITE
|
486 NTCREATEX_SHARE_ACCESS_DELETE
;
487 cr
.in
.create_disposition
= NTCREATEX_DISP_CREATE
;
490 smb2_transport_compound_start(tree
->session
->transport
, 2);
492 req
[0] = smb2_create_send(tree
, &cr
);
494 smb2_transport_compound_set_related(tree
->session
->transport
, true);
496 hd
.data
[0] = UINT64_MAX
;
497 hd
.data
[1] = UINT64_MAX
;
500 nt
.in
.recursive
= true;
501 nt
.in
.buffer_size
= 0x1000;
502 nt
.in
.file
.handle
= hd
;
503 nt
.in
.completion_filter
= FILE_NOTIFY_CHANGE_NAME
;
504 nt
.in
.unknown
= 0x00000000;
506 req
[1] = smb2_notify_send(tree
, &nt
);
508 status
= smb2_create_recv(req
[0], tree
, &cr
);
509 CHECK_STATUS(status
, NT_STATUS_OK
);
512 status
= smb2_notify_recv(req
[1], tree
, &nt
);
513 CHECK_STATUS(status
, NT_STATUS_CANCELLED
);
515 smb2_util_close(tree
, cr
.out
.file
.handle
);
517 smb2_deltree(tree
, dname
);
522 /* Send a compound request where we expect the middle request (Create, Notify,
523 * GetInfo) to go asynchronous. Against Win7 the sync request succeed while
524 * the async fails. All are returned in the same compound response. */
525 static bool test_compound_interim2(struct torture_context
*tctx
,
526 struct smb2_tree
*tree
)
528 struct smb2_handle hd
;
529 struct smb2_create cr
;
530 NTSTATUS status
= NT_STATUS_OK
;
531 const char *dname
= "compound_interim_dir";
532 struct smb2_getinfo gf
;
533 struct smb2_notify nt
;
535 struct smb2_request
*req
[3];
537 /* Win7 compound request implementation deviates substantially from the
538 * SMB2 spec as noted in MS-SMB2 <159>, <162>. This, test currently
539 * verifies the Windows behavior, not the general spec behavior. */
541 smb2_transport_credits_ask_num(tree
->session
->transport
, 5);
543 smb2_deltree(tree
, dname
);
545 smb2_transport_credits_ask_num(tree
->session
->transport
, 1);
548 cr
.in
.desired_access
= SEC_RIGHTS_FILE_ALL
;
549 cr
.in
.create_options
= NTCREATEX_OPTIONS_DIRECTORY
;
550 cr
.in
.file_attributes
= FILE_ATTRIBUTE_DIRECTORY
;
551 cr
.in
.share_access
= NTCREATEX_SHARE_ACCESS_READ
|
552 NTCREATEX_SHARE_ACCESS_WRITE
|
553 NTCREATEX_SHARE_ACCESS_DELETE
;
554 cr
.in
.create_disposition
= NTCREATEX_DISP_CREATE
;
557 smb2_transport_compound_start(tree
->session
->transport
, 3);
559 req
[0] = smb2_create_send(tree
, &cr
);
561 smb2_transport_compound_set_related(tree
->session
->transport
, true);
563 hd
.data
[0] = UINT64_MAX
;
564 hd
.data
[1] = UINT64_MAX
;
567 nt
.in
.recursive
= true;
568 nt
.in
.buffer_size
= 0x1000;
569 nt
.in
.file
.handle
= hd
;
570 nt
.in
.completion_filter
= FILE_NOTIFY_CHANGE_NAME
;
571 nt
.in
.unknown
= 0x00000000;
573 req
[1] = smb2_notify_send(tree
, &nt
);
576 gf
.in
.file
.handle
= hd
;
577 gf
.in
.info_type
= SMB2_GETINFO_FILE
;
578 gf
.in
.info_class
= 0x04; // FILE_BASIC_INFORMATION
579 gf
.in
.output_buffer_length
= 0x1000;
580 gf
.in
.input_buffer_length
= 0;
582 req
[2] = smb2_getinfo_send(tree
, &gf
);
584 status
= smb2_create_recv(req
[0], tree
, &cr
);
585 CHECK_STATUS(status
, NT_STATUS_OK
);
587 status
= smb2_notify_recv(req
[1], tree
, &nt
);
588 CHECK_STATUS(status
, NT_STATUS_INTERNAL_ERROR
);
590 status
= smb2_getinfo_recv(req
[2], tree
, &gf
);
591 CHECK_STATUS(status
, NT_STATUS_OK
);
593 smb2_util_close(tree
, cr
.out
.file
.handle
);
595 smb2_deltree(tree
, dname
);
600 struct torture_suite
*torture_smb2_compound_init(void)
602 struct torture_suite
*suite
= torture_suite_create(talloc_autofree_context(), "compound");
604 torture_suite_add_1smb2_test(suite
, "related1", test_compound_related1
);
605 torture_suite_add_1smb2_test(suite
, "related2", test_compound_related2
);
606 torture_suite_add_1smb2_test(suite
, "unrelated1", test_compound_unrelated1
);
607 torture_suite_add_1smb2_test(suite
, "invalid1", test_compound_invalid1
);
608 torture_suite_add_1smb2_test(suite
, "invalid2", test_compound_invalid2
);
609 torture_suite_add_1smb2_test(suite
, "invalid3", test_compound_invalid3
);
610 torture_suite_add_1smb2_test(suite
, "interim1", test_compound_interim1
);
611 torture_suite_add_1smb2_test(suite
, "interim2", test_compound_interim2
);
613 suite
->description
= talloc_strdup(suite
, "SMB2-COMPOUND tests");