Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_ftp_control_test.h
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #if !defined(GLOBUS_FTP_CONTROL_TEST_H)
18 #define GLOBUS_FTP_CONTROL_TEST_H
19 
20 #include "globus_ftp_control.h"
21 #include "test_common.h"
22 /**********************************************************************
23 * TESTS
24 *
25 * for ascii and binary
26 *
27 * a call to globus_module_activate should precede each test
28 * and they should be followed by a corresponding call to _deactivate
29 *
30 * control_connect_test
31 * test connecting the control channel
32 *
33 * control_disconnect_test
34 * disconnect the control channel
35 *
36 * async_control_test
37 * send commands via the callbacks of other commands
38 *
39 * simple_control_test
40 * send several non data requesting commands and wait for
41 * appropriate responses
42 *
43 * simple_data_test
44 * put bytes / get bytes / compare bytes
45 * only 1 read or write request is outstanding a time
46 *
47 * simple_dir_test
48 * requests a list from the server. Tests the data channel.
49 *
50 * outstanding_io_test
51 * same as simple_data_test only several read/write can be registered
52 * at one time
53 *
54 * simple_fail_test
55 * a variety of functions called that due to the current state
56 * should fail with useful error codes
57 *
58 * abort_restart_test
59 * same as the abort_test only restart the transfer after the
60 * abort is successful
61 *
62 * data_commands_connect_test
63 * Test if a control handle hasn't been established prior to calling
64 * globus_ftp_data commands.
65 *
66 * data_commands_pasvorport_test
67 * Test if globus_ftp_data_local_pasv()/port() has been called prior to
68 * calling globus_ftp_data commands.
69 *
70 * pending_test
71 * Test for pending commands that have been sent but the reply is not yet
72 * been received. In this case a call to send_command() returns FAILURE.
73 *
74 **********************************************************************/
75 
76 typedef struct login_s
77 {
78  char login[512];
79  char password[512];
80  char dir[512];
81  char hostname[512];
82  int port;
83 } login_t;
84 
85 typedef struct globus_ftp_control_test_monitor_s
86 {
87  globus_mutex_t mutex;
88  globus_cond_t cond;
89  globus_bool_t done;
90  globus_bool_t rc;
91  int count;
92 
93  void * user_arg;
94 } globus_ftp_control_test_monitor_t;
95 
96 void
97 fake_file_init(
98  globus_ftp_control_fake_file_t * fake_file,
99  int file_size,
100  int chunk_size);
101 
103 fake_file_get_chunk(
104  globus_ftp_control_fake_file_t * fake_file,
105  int * chunk_size);
106 
108 fake_file_seek(
109  globus_ftp_control_fake_file_t * fake_file,
110  int offset);
111 
113 fake_file_is_eof(
114  globus_ftp_control_fake_file_t * fake_file);
115 
117 fake_file_cmp(
118  globus_ftp_control_fake_file_t * fake_file,
119  globus_byte_t * buffer,
120  int offset,
121  int length);
122 
123 void
124 fake_file_destroy(
125  globus_ftp_control_fake_file_t * fake_file);
126 
127 void
128 verbose_printf(
129  int level,
130  char * s,
131  ...);
132 
133 void
134 help_print();
135 
137 connect_control_handle(
138  globus_ftp_control_handle_t * control_handle,
139  char * user_name,
140  char * password,
141  char * base_dir,
142  char * hostname,
143  unsigned short port);
144 
146 disconnect_control_handle(
147  globus_ftp_control_handle_t * control_handle);
148 
150 simple_control_test(
151  globus_ftp_control_handle_t * handle);
152 
154 simple_data_test(
155  globus_ftp_control_handle_t * handle);
156 
158 eb_data_test(
159  globus_ftp_control_handle_t * handle);
160 
162 eb_simple_data_test(
163  globus_ftp_control_handle_t * handle);
164 
166 outstanding_io_test(
167  globus_ftp_control_handle_t * handle);
168 
170 async_control_test(
171  globus_ftp_control_handle_t * handle);
172 
174 simple_dir_test(
175  globus_ftp_control_handle_t * handle);
176 
178 pending_response_test(
179  globus_ftp_control_handle_t * handle);
180 
181 
183 data_commands_connect_test(
184  globus_ftp_control_handle_t * handle);
185 
187 data_commands_pasvorport_test(
188  globus_ftp_control_handle_t * handle);
189 
191 abort_test(
192  globus_ftp_control_handle_t * handle);
193 
195 pasv_to_host_port(
196  char * parse_str,
197  globus_ftp_control_host_port_t * addr);
198 
199 extern int verbose_print_level;
200 
201 void
202 verbose_printf(
203  int level,
204  char * s,
205  ...);
206 
207 void
208 help_print();
209 
211 simple_control_test(
212  globus_ftp_control_handle_t * handle);
213 
215 simple_data_test(
216  globus_ftp_control_handle_t * handle);
217 
219 pasv_to_host_port(
220  char * parse_str,
221  globus_ftp_control_host_port_t * addr);
222 
223 extern int verbose_print_level;
224 extern login_t login_info;
225 #endif
GridFTP Control Connection API.
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Mutex.
Definition: globus_thread.h:107
Condition variable.
Definition: globus_thread.h:124
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:85