summaryrefslogtreecommitdiffstats
path: root/basic/scripts/cthon01.mst
blob: 3883183c6bd027b3d513a1ed47e0db34627db480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
'******************************* CTHON01.MST *********************************
' @(#)cthon01.mst	1.1	98/10/26 Connectathon Testsuite
'
'Description: This test suite contains a set of test cases and scenarios that
'             are used to test Directory Caching.
'
'
'
'******************************************************************************

'********************************* HISTORY ************************************
' Date           DVE                     Comments
' 3/01/94        Jack Morrison           Initial version
'******************************************************************************

'Test cases:
'
'******************************************************************************
'* Include Files
'******************************************************************************

'$INCLUDE 'DECLARES.INC'

Const APPL_ABBR$   = "CTHON"

'$INCLUDE 'NFSCOMM.INC'
'$INCLUDE 'NFSSUBS.INC'

'******************************************************************************
' Subroutines and Functions Declarations
'******************************************************************************

Declare Sub CthonTest12a ()
Declare Sub CthonTest12b ()
Declare Sub CthonTest12c ()

Declare Sub CthonTest03 ()
Declare Sub CthonTest04 ()
Declare Sub CthonTest05 ()
Declare Sub CthonTest06 ()
Declare Sub CthonTest07 ()
Declare Sub CthonTest09 ()

'******************************************************************************
'* Initialize Variables
'******************************************************************************
Global NumDrives AS INTEGER
'******************************************************************************
'* Main prorgram code
'******************************************************************************
On Error Goto ErrorTrap

QueSetSpeed 75

Setup

ret = Connect (NetHost(1), NetDrive(1), NetPath(1), "") 'user$ passwd$
ret = Connect (NetHost(2), NetDrive(2), NetPath(2), "") 'user$ passwd$
ret = Connect (NetHost(3), NetDrive(3), NetPath(3), "") 'user$ passwd$

' At some point set NumDrives% = MaxDrive% because the
' way it is now it will run thru the same drive every time
NumDrives% = MaxDrive%

FOR I = 1 TO MaxDrive%
   If EXISTS (NetDrive(I)+":\testlog.*") Then
      KILL    NetDrive(I)+":\testlog.*"
   End If

'*** Execute the tests

CthonTest12a
CthonTest12b
CthonTest12c

CthonTest03
CthonTest04
CthonTest05
CthonTest06
CthonTest07
CthonTest09


ret = Disconnect (NetDrive(1))
ret = Disconnect (NetDrive(2))
ret = Disconnect (NetDrive(3))

NEXT I

Cleanup

End

'******************************************************************************
' Subroutines and Functions
'******************************************************************************
'******************************************************************************
'Subroutines
'******************************************************************************

'******************************************************************************
'SUB CthonTest12a
'******************************************************************************
Sub CthonTest12a() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

FOR L = 1 To 7

levels$ = STR$(L)
files$  = "1"
dirs$   = "1"

CHDRIVE NetDrive(I)

If NOT EXISTS ("testdir.12") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test12.dir not deleted"
End If

NEXT L
NEXT I

EndSubTest ""

End Sub

'******************************************************************************
'SUB CthonTest12b
'******************************************************************************
Sub CthonTest12b() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

levels$ = "1"
files$  = "999"
dirs$   = "1"

CHDRIVE NetDrive(I)

If NOT EXISTS ("testdir.12") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test12.dir not deleted"
End If

NEXT I

EndSubTest ""

End Sub


'******************************************************************************
'SUB CthonTest12c
'******************************************************************************
Sub CthonTest12c() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

levels$ = "4"
files$  = "10"
dirs$   = "5"

CHDRIVE NetDrive(I)

If NOT EXISTS ("testdir.12") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test1 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test2 testdir.12 testlog.12 "+levels$+" "+files$+" "+dirs$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test12.dir not deleted"
End If


NEXT I

EndSubTest ""

End Sub

'******************************************************************************
'SUB CthonTest03
'******************************************************************************
Sub CthonTest03() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)

FOR C = 1 TO 1000 STEP 10

count$ = STR$(C)

If NOT EXISTS ("testdir.3") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test3 testdir.3 testlog.3 "+count$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test3.dir not deleted"
End If

NEXT C
NEXT I

EndSubTest ""

End Sub

'******************************************************************************
'SUB CthonTest04
'******************************************************************************
Sub CthonTest04() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)

FOR F = 1 TO 500 STEP 100

files$ = STR$(F)
count$ = "10"

If NOT EXISTS ("testdir.4") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test4 testdir.4 testlog.4 "+files$+" "+count$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test4.dir not deleted"
End If

NEXT F
NEXT I

EndSubTest ""

End Sub


'******************************************************************************
'SUB CthonTest06
'******************************************************************************
Sub CthonTest06() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)

FOR F = 1 TO 512 STEP 256

files$ = STR$(F)
count$ = "1"

If NOT EXISTS ("testdir.6") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test6 testdir.6 testlog.6 "+files$+" "+count$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test6.dir not deleted"
End If

NEXT F
NEXT I

EndSubTest ""

End Sub


'******************************************************************************
'SUB CthonTest09
'******************************************************************************
Sub CthonTest09() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)

FOR C = 1 TO 1000 STEP 10

count$ = STR$(C)

If NOT EXISTS ("testdir.9") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test9 testdir.9 testlog.9 "+count$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test9.dir not deleted"
End If

NEXT C
NEXT I

EndSubTest ""

End Sub


'******************************************************************************
'SUB CthonTest05
'******************************************************************************
Sub CthonTest05() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)
fname$ = ""

FOR N = 1 TO 8 STEP 1
fname$ = fname$+"x"

FOR C = 1 TO 10 STEP 1
count$ = STR$(C)

FOR S = 512 TO 8192 STEP 512
size$  = STR$(s)

If NOT EXISTS ("testdir.5") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test5 testdir.5 testlog.5 "+size$+" "+count$+" "+fname$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test5.dir not deleted"
End If

NEXT S
NEXT C
NEXT N
NEXT I

EndSubTest ""

End Sub


'******************************************************************************
'SUB CthonTest07
'******************************************************************************
Sub CthonTest07() Static

'  initialize - open logs and start Cthon

StartSubTest ""

FOR I = 1 TO NumDrives%

CHDRIVE NetDrive(I)
sfname$ = ""

FOR S = 1 TO 8
sfname$ = sfname$ + "a"
efname$ = ""

FOR E = 1 TO 8
efname$ = efname$ + "z"

If NOT EXISTS ("testdir.7") Then

Execute$ = ProgramPath$+"cthon.bat "+ProgramPath$+" test7 testdir.7 testlog.7 1 1 "+sfname$+" "+efname$
Run Execute$, ,SW_HIDE

Else
failure_Occurred = True
WriteLogFile "Previous test directory test7.dir not deleted"
End If

NEXT E
NEXT S
NEXT I

EndSubTest ""

End Sub