first public release of samba4 code
[samba.git] / source / torture / genbit.c
1 /* 
2    Unix SMB/CIFS implementation.
3    Gentest test definitions
4
5    Copyright (C) James Myers 2003
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 2 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, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 get_field_function test_field_get_file_attr;    
23 get_field_function test_field_get_fid;  
24 get_field_function test_field_get_filename;     
25 get_field_function test_field_get_mtime;        
26 get_field_function test_field_get_trans2;       
27 get_field_function test_field_get_fsinfo_level;         
28
29 static struct unlink_test_parms_t gen_unlink_test_parms;
30 static struct close_test_parms_t gen_close_test_parms;
31 static struct qfsi_test_parms_t gen_qfsi_test_parms;
32
33 static struct trans2_parms trans2_qfsi_parms = {
34         testFieldTypeTrans2, 1, 2, 0, 0, TRANSACT2_QFSINFO
35 };
36
37 static struct field_test_spec gen_unlink_test_spec[] = {
38         {"FATTR", testFieldTypeFileAttr, NULL,
39                  1, test_field_get_file_attr},
40         {"FNAME", testFieldTypeFilename, NULL,
41                  -1, test_field_get_filename},
42         {"", -1, NULL, -1, NULL}
43 };
44
45 static struct field_test_spec gen_close_test_spec[] = {
46         {"FID", testFieldTypeFid, NULL, 1,
47                 test_field_get_fid},
48         {"MTIME", testFieldTypeMtime, NULL, 2,
49                 test_field_get_mtime},
50         {"", -1, NULL, -1, NULL}
51 };
52
53 static struct field_test_spec gen_qfsi_test_spec[] = {
54         {"TRANS2", testFieldTypeTrans2,
55                 (void*)&trans2_qfsi_parms, 15,
56                 test_field_get_trans2},
57         {"INFO_LEVEL", 0, NULL, 1, test_field_get_fsinfo_level},        
58         {"", -1, NULL, -1, NULL}
59 };                                              
60
61 static struct enum_test gen_enum_tests[] = {
62         {SMBunlink, "UNLINK", TEST_COND_TCON,
63                 testTypeFilename,
64                 TEST_OPTION_FILE_EXISTS | 
65                         TEST_OPTION_FILE_SYSTEM |
66                         TEST_OPTION_FILE_HIDDEN |
67                         TEST_OPTION_FILE_INVISIBLE |
68                         TEST_OPTION_FILE_WILDCARD |
69                         TEST_OPTION_FILE_NOT_EXIST,
70                 1, gen_unlink_test_spec, (void*)&gen_unlink_test_parms,
71                 gen_execute_unlink, gen_verify_unlink},
72         {SMBclose, "CLOSE", TEST_COND_TCON,
73                 testTypeFid,
74                 TEST_OPTION_FID_VALID | TEST_OPTION_FID_INVALID,
75                 3, gen_close_test_spec, (void*)&gen_close_test_parms, 
76                 gen_execute_close, gen_verify_close},
77         {SMBtrans2, "QUERY_FS_INFO", TEST_COND_TCON,
78                 testTypeConnected,
79                 1,
80                 16, gen_qfsi_test_spec, (void*)&gen_qfsi_test_parms,
81                 gen_execute_qfsi, gen_verify_qfsi},
82         {-1, NULL, 0, 0, 0, -1, NULL, NULL, NULL}
83 };