2 Unix SMB/CIFS implementation.
4 SMB2 dir list test suite
6 Copyright (C) Andrew Tridgell 2005
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"
26 #include "torture/torture.h"
27 #include "torture/smb2/proto.h"
32 static BOOL torture_smb2_find_dir(struct smb2_tree *tree)
34 struct smb2_handle handle;
39 union smb_search_data *d;
42 status = smb2_util_roothandle(tree, &handle);
43 if (!NT_STATUS_IS_OK(status)) {
48 f.in.file.handle = handle;
50 f.in.continue_flags = SMB2_CONTINUE_FLAG_SINGLE;
51 f.in.max_response_size = 0x100;
52 f.in.level = SMB2_FIND_BOTH_DIRECTORY_INFO;
55 status = smb2_find_level(tree, tree, &f, &count, &d);
56 if (!NT_STATUS_IS_OK(status)) {
57 printf("SMB2_FIND_ID_BOTH_DIRECTORY_INFO failed - %s\n", nt_errstr(status));
61 printf("Got %d files\n", count);
62 for (i=0;i<count;i++) {
64 d[i].both_directory_info.name.s);
66 f.in.continue_flags = 0;
67 f.in.max_response_size = 4096;
76 basic testing of directory listing with continue
78 BOOL torture_smb2_dir(struct torture_context *torture)
80 TALLOC_CTX *mem_ctx = talloc_new(NULL);
81 struct smb2_tree *tree;
84 if (!torture_smb2_connection(mem_ctx, &tree)) {
88 ret &= torture_smb2_find_dir(tree);