Annotation of embedaddon/lrzsz/check.lrzsz, revision 1.1.1.1
1.1 misho 1: #! /bin/sh
2:
3: testdir="testdir.lrzsz"
4: srcdir="$1"
5: if test $srcdir = . ; then
6: srcdir=`pwd`
7: fi
8: if test $srcdir = .. ; then
9: srcdir=`pwd`/..
10: fi
11: objdir="$2"
12: if test $objdir = . ; then
13: objdir=`pwd`
14: fi
15:
16: if test "x$3" = x ; then
17: mode=all
18: else
19: mode=$3
20: fi
21:
22: #SZBUFSIZE="-B 524288"
23: RZBUFSIZE="-B 524288"
24:
25: SZ="$objdir/src/lsz"
26: RZ="$objdir/src/lrz"
27:
28: echo checking with srcdir = $1 and objdir = $2
29:
30: # z_test_files: files to test zmodem with.
31: # z8_test_files: files to test zmodem-8k with. Optional.
32: # y_test_files: files to test ymodem with.
33: # x_test_files: files to test xmodem with. Must be ascii, as we need the
34: # ascii mode to remove the padding ^Zs.
35:
36: # generate list of testfiles
37: z_test_files=""
38: for i in $srcdir/src/l?z.c ; do
39: z_test_files="$z_test_files $i"
40: x_test_files="$x_test_files $i"
41: done
42: for i in $objdir/src/l?z ; do
43: z_test_files="$z_test_files $i"
44: y_test_files="$y_test_files $i"
45: done
46: for i in /pub/gnu/emacs-1*.tar.gz ; do
47: if test -f "$i" ; then
48: z8_test_files="$z8_test_files $i"
49: z_test_files="$z_test_files $i"
50: fi
51: done
52:
53: # change to tmp dir
54: if test "x$TMPDIR" = x ; then
55: cd /tmp
56: else
57: cd $TMPDIR || cd /tmp
58: fi
59:
60: rm -rf $testdir
61: mkdir $testdir
62: exec 5>$testdir/error.log
63: (mkfifo $testdir/pipe || mknod $testdir/pipe p) 2>&5
64:
65: # test zmodem
66: if test "$mode" = all -o "$mode" = z ; then
67: echo "testing ZMODEM"
68: mkdir $testdir/zmodem
69: failed=0
70: ($SZ -q $SZBUFSIZE $z_test_files ) <$testdir/pipe | \
71: (cd $testdir/zmodem ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
72: for i in $z_test_files ; do
73: bn=`basename $i`
74: cmp $i $testdir/zmodem/$bn
75: if test $? -eq 0 ; then
76: rm -f $testdir/zmodem/$bn
77: else
78: failed=1
79: fi
80: done
81: rmdir $testdir/zmodem 2>&5
82: if test $failed = 1 ; then
83: echo "ZMODEM test failed"
84: any_failure="$any_failure ZMODEM"
85: fi
86: fi
87: # test zmodem framlen
88: if test "$mode" = f ; then
89: echo "testing ZMODEMframlen"
90: mkdir $testdir/zmodem
91: failed=0
92: ($SZ -q $SZBUFSIZE -l 128 $z_test_files ) <$testdir/pipe | \
93: (cd $testdir/zmodem ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
94: for i in $z_test_files ; do
95: bn=`basename $i`
96: cmp $i $testdir/zmodem/$bn
97: if test $? -eq 0 ; then
98: rm -f $testdir/zmodem/$bn
99: else
100: failed=1
101: fi
102: done
103: rmdir $testdir/zmodem 2>&5
104: if test $failed = 1 ; then
105: echo "ZMODEM test failed"
106: any_failure="$any_failure ZMODEM"
107: fi
108: fi
109:
110: # test zmodem-4k
111: if test "$mode" = all -o "$mode" = z4 ; then
112: echo "testing ZMODEM4K"
113: mkdir $testdir/zmodem4k
114: failed=0
115: ($SZ -q4 $SZBUFSIZE $z_test_files ) <$testdir/pipe | \
116: (cd $testdir/zmodem4k ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
117: for i in $z_test_files ; do
118: bn=`basename $i`
119: cmp $i $testdir/zmodem4k/$bn
120: if test $? -eq 0 ; then
121: rm -f $testdir/zmodem4k/$bn
122: else
123: failed=1
124: fi
125: done
126: rmdir $testdir/zmodem4k 2>&5
127: if test $failed = 1 ; then
128: echo "ZMODEM4k test failed"
129: any_failure="$any_failure ZMODEM4k"
130: fi
131: fi
132:
133: # test zmodem8k
134: if test "$mode" = all -o "$mode" = z8 ; then
135: # we test this only if we have something really large, because this is
136: # we only case we can expect any differences
137: if test "x$z8_test_files" = x ; then
138: :
139: else
140: echo "testing ZMODEM8K"
141: mkdir $testdir/zmodem8k
142: failed=0
143: $SZ -q8OT $SZBUFSIZE $z8_test_files <$testdir/pipe | \
144: (cd $testdir/zmodem8k ; $RZ -O $RZBUFSIZE $QUIET >>../pipe )
145: for i in $z8_test_files ; do
146: bn=`basename $i`
147: cmp $i $testdir/zmodem8k/$bn
148: if test $? -eq 0 ; then
149: rm -f $testdir/zmodem8k/$bn
150: else
151: failed=1
152: fi
153: done
154: if test $failed = 1 ; then
155: echo "ZMODEM8k test failed"
156: any_failure="$any_failure ZMODEM8k"
157: fi
158: rmdir $testdir/zmodem8k 2>&5
159: fi
160: fi
161:
162: if test "$mode" = all -o "$mode" = z8N ; then
163: # we test this only if we have something really large, because this is
164: # we only case we can expect any differences
165: if test "x$z8_test_files" = x ; then
166: :
167: else
168: echo "testing ZMODEM8K-NULL"
169: mkdir $testdir/zmodem8k-NULL
170: $SZ -q8OT $SZBUFSIZE $z8_test_files <$testdir/pipe | \
171: (cd $testdir/zmodem8k-NULL ; $RZ -DO $RZBUFSIZE $QUIET >>../pipe )
172: rmdir $testdir/zmodem8k-NULL 2>&5
173: fi
174: fi
175:
176: # test zmodem-tcp
177: # inband tcp: stdin/out connection needed.
178: if test "$mode" = all -o "$mode" = tcp ; then
179: echo "testing ZMODEMtcp"
180: mkdir $testdir/zmodemtcp
181: failed=0
182: ($SZ --tcp -q $SZBUFSIZE $z_test_files ) <$testdir/pipe | \
183: (cd $testdir/zmodemtcp ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
184: for i in $z_test_files ; do
185: bn=`basename $i`
186: cmp $i $testdir/zmodemtcp/$bn
187: if test $? -eq 0 ; then
188: rm -f $testdir/zmodemtcp/$bn
189: else
190: failed=1
191: fi
192: done
193: rmdir $testdir/zmodemtcp 2>&5
194: if test $failed = 1 ; then
195: echo "ZMODEMtcp test failed"
196: any_failure="$any_failure ZMODEMtcp"
197: fi
198: fi
199: if test "$mode" = all -o "$mode" = tcp4 ; then
200: echo "testing ZMODEMtcp4k"
201: mkdir $testdir/zmodemtcp4k
202: failed=0
203: ($SZ --tcp -q4 $SZBUFSIZE $z_test_files ) <$testdir/pipe | \
204: (cd $testdir/zmodemtcp4k ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
205: for i in $z_test_files ; do
206: bn=`basename $i`
207: cmp $i $testdir/zmodemtcp4k/$bn
208: if test $? -eq 0 ; then
209: rm -f $testdir/zmodemtcp4k/$bn
210: else
211: failed=1
212: fi
213: done
214: rmdir $testdir/zmodemtcp4k 2>&5
215: if test $failed = 1 ; then
216: echo "ZMODEMtcp4k test failed"
217: any_failure="$any_failure ZMODEMtcp4k"
218: fi
219: fi
220: if test "$mode" = all -o "$mode" = tcp8 ; then
221: echo "testing ZMODEMtcp8k"
222: mkdir $testdir/zmodemtcp8k
223: failed=0
224: ($SZ --tcp -q8OT $SZBUFSIZE $z_test_files ) <$testdir/pipe | \
225: (cd $testdir/zmodemtcp8k ; exec $RZ $RZBUFSIZE $QUIET >>../pipe )
226: for i in $z_test_files ; do
227: bn=`basename $i`
228: cmp $i $testdir/zmodemtcp8k/$bn
229: if test $? -eq 0 ; then
230: rm -f $testdir/zmodemtcp8k/$bn
231: else
232: failed=1
233: fi
234: done
235: rmdir $testdir/zmodemtcp8k 2>&5
236: if test $failed = 1 ; then
237: echo "ZMODEMtcp8k test failed"
238: any_failure="$any_failure ZMODEMtcp8k"
239: fi
240: fi
241: # out-of-band tcp
242: if test "$mode" = tcpo ; then
243: echo "testing ZMODEMtcpo"
244: mkdir $testdir/zmodemtcpo
245: failed=0
246: $SZ --tcp-server -q $SZBUFSIZE $z_test_files | \
247: perl -e '$|=1; while(<>) {if (/^connect with .* "(.*)"/) {print $1 . "\n";}}' |
248: ( cd $testdir/zmodemtcpo ; xargs -l1 $RZ $RZBUFSIZE -vv --tcp-client )
249: for i in $z_test_files ; do
250: bn=`basename $i`
251: cmp $i $testdir/zmodemtcpo/$bn
252: if test $? -eq 0 ; then
253: rm -f $testdir/zmodemtcpo/$bn
254: else
255: failed=1
256: fi
257: done
258: rmdir $testdir/zmodemtcpo 2>&5
259: if test $failed = 1 ; then
260: echo "ZMODEMtcpo test failed"
261: any_failure="$any_failure ZMODEMtcpo"
262: fi
263: fi
264:
265: if test "$mode" = error ; then
266: # we test this only if we have something really large, because this is
267: # we only case we can expect any differences
268: if test "x$y_test_files" = x ; then
269: :
270: else
271: echo "testing error, lsz"
272: mkdir $testdir/error.lsz
273: failed=0
274: # strace -vs 128 -o out $SZ -8 -vvvvvvvv $SZBUFSIZE $y_test_files <$testdir/pipe | \
275: $SZ -8q $SZBUFSIZE $y_test_files <$testdir/pipe | \
276: (cd $testdir/error.lsz ; $RZ --errors 32768 $RZBUFSIZE $QUIET >>../pipe 2>/dev/null)
277: for i in $y_test_files ; do
278: bn=`basename $i`
279: cmp $i $testdir/error.lsz/$bn
280: if test $? -eq 0 ; then
281: rm -f $testdir/error.lsz/$bn
282: else
283: failed=1
284: fi
285: done
286: if test $failed = 1 ; then
287: echo "error test failed"
288: any_failure="$any_failure error.lsz"
289: fi
290: rmdir $testdir/error.lsz 2>&5
291:
292: # omen zmodem has a really bad error behaviour. it gets so slow
293: # that you wouldn't believe it ...
294: echo "testing error, omen.sz"
295: mkdir $testdir/error.omen
296: failed=0
297: omen.sz $y_test_files <$testdir/pipe | \
298: (cd $testdir/error.omen ; $RZ -vvv --errors 32768 $RZBUFSIZE $QUIET >>../pipe 2>/tmp/out2)
299: for i in $y_test_files ; do
300: bn=`basename $i`
301: cmp $i $testdir/error.omen/$bn
302: if test $? -eq 0 ; then
303: rm -f $testdir/error.omen/$bn
304: else
305: failed=1
306: fi
307: done
308: if test $failed = 1 ; then
309: echo "error.omen test failed"
310: any_failure="$any_failure error.omen"
311: fi
312: rmdir $testdir/error.omen 2>&5
313:
314: echo "testing error, zm.sz"
315: mkdir $testdir/error.zm
316: failed=0
317: zmtx $y_test_files <$testdir/pipe | \
318: (cd $testdir/error.zm ; $RZ -vvv --errors 32768 $RZBUFSIZE $QUIET >>../pipe 2>/tmp/out2)
319: for i in $y_test_files ; do
320: bn=`basename $i`
321: cmp $i $testdir/error.zm/$bn
322: if test $? -eq 0 ; then
323: rm -f $testdir/error.zm/$bn
324: else
325: failed=1
326: fi
327: done
328: if test $failed = 1 ; then
329: echo "error.zm test failed"
330: any_failure="$any_failure error.zm"
331: fi
332: rmdir $testdir/error.zm 2>&5
333: fi
334: fi
335:
336:
337: # test ymodem
338: if test "$mode" = all -o "$mode" = y ; then
339: echo "testing YMODEM"
340: mkdir $testdir/ymodem
341: failed=0
342: $SZ --ymodem -q $y_test_files <$testdir/pipe | \
343: (cd $testdir/ymodem ; $RZ $QUIET --ymodem >>../pipe)
344: for i in $y_test_files ; do
345: bn=`basename $i`
346: cmp $i $testdir/ymodem/$bn
347: if test $? -eq 0 ; then
348: rm -f $testdir/ymodem/$bn
349: else
350: failed=1
351: fi
352: done
353: rmdir $testdir/ymodem 2>&5
354: if test $failed = 1 ; then
355: echo "YMODEM test failed"
356: any_failure="$any_failure YMODEM"
357: fi
358: fi
359:
360: if test "$mode" = all -o "$mode" = x ; then
361: echo "testing XMODEM"
362: mkdir $testdir/xmodem
363: failed=0
364: for i in $x_test_files; do
365: bn=`basename $i`
366: $SZ --xmodem -qa $i <$testdir/pipe | \
367: (cd $testdir/xmodem ; $RZ $QUIET -a --xmodem $bn >>../pipe)
368: cmp $i $testdir/xmodem/$bn
369: if test $? -eq 0 ; then
370: rm -f $testdir/xmodem/$bn
371: else
372: failed=1
373: fi
374: done
375: rmdir $testdir/xmodem 2>&5
376: if test $failed = 1 ; then
377: echo "XMODEM test failed"
378: any_failure="$any_failure XMODEM"
379: fi
380: fi
381:
382: if test "$mode" = all -o "$mode" = manage ; then
383: echo "testing file management, appending"
384: mkdir $testdir/manag.append
385: failed=0
386: $SZ -q --append $srcdir/src/lsz.c $srcdir/src/lsz.c <$testdir/pipe | \
387: (cd $testdir/manag.append ; $RZ $QUIET >>../pipe)
388: rm -f $testdir/manag.append/compare
389: cp $srcdir/src/lsz.c $testdir/manag.append/compare
390: cat $srcdir/src/lsz.c >>$testdir/manag.append/compare
391: cmp $testdir/manag.append/compare $testdir/manag.append/lsz.c
392: if test $? -eq 0 ; then
393: rm -f $testdir/manag.append/lsz.c
394: rm -f $testdir/manag.append/compare
395: else
396: failed=1
397: fi
398: rmdir $testdir/manag.append 2>&5
399: if test $failed = 1 ; then
400: echo "management/append test failed"
401: any_failure="$any_failure manag.append"
402: fi
403:
404: echo "testing file management, renaming"
405: mkdir $testdir/manag.rename
406: failed=0
407: rm -f $testdir/manag.rename/lsz.c
408: cp $srcdir/src/lsz.c $testdir/manag.rename/
409: $SZ -q --rename $srcdir/src/lsz.c $srcdir/src/lsz.c <$testdir/pipe | \
410: (cd $testdir/manag.rename ; $RZ $QUIET >>../pipe)
411: cmp $testdir/manag.rename/lsz.c $srcdir/src/lsz.c
412: if test $? -ne 0 ; then
413: failed=1
414: else
415: cmp $testdir/manag.rename/lsz.c.0 $srcdir/src/lsz.c
416: if test $? -ne 0 ; then
417: failed=1
418: else
419: cmp $testdir/manag.rename/lsz.c.1 $srcdir/src/lsz.c
420: if test $? -ne 0 ; then
421: failed=1
422: fi
423: fi
424: fi
425: if test $failed -eq 0 ; then
426: rm -f $testdir/manag.rename/lsz.c
427: rm -f $testdir/manag.rename/lsz.c.0
428: rm -f $testdir/manag.rename/lsz.c.1
429: fi
430: rmdir $testdir/manag.rename 2>&5
431: if test $failed = 1 ; then
432: echo "management/rename test failed"
433: any_failure="$any_failure manag.rename"
434: fi
435: fi
436:
437:
438: # resume -r
439: if test "$mode" = all -o "$mode" = sz-r ; then
440: mkdir $testdir/resume-s
441: echo "testing ZMODEM resume (sz -r)"
442: dd if=$srcdir/src/Makefile.in of=$testdir/resume-s/lsz.c bs=256 count=5 2>&5
443: ($SZ -rq $srcdir/src/lsz.c) <$testdir/pipe | \
444: (cd $testdir/resume-s ; $RZ $QUIET >>../pipe )
445: echo "differences are normal:" >&5
446: if cmp $srcdir/src/lsz.c $testdir/resume-s/lsz.c >&5 ; then
447: echo "receiver did not resume, but file is ok"
448: any_failure="$any_failure ZMODEM-resume/sz"
449: else
450: dd if=$srcdir/src/lsz.c of=$testdir/resume-s/lsz.c1 bs=256 count=5 2>&5
451: dd if=$testdir/resume-s/lsz.c bs=256 skip=5 >>$testdir/resume-s/lsz.c1 2>&5
452: if cmp $srcdir/src/lsz.c $testdir/resume-s/lsz.c1 ; then
453: :
454: rm -f $testdir/resume-s/lsz.c
455: rm -f $testdir/resume-s/lsz.c1
456: rmdir $testdir/resume-s 2>&5
457: else
458: echo "sender resumed, but files differ. This is really bad"
459: any_failure="$any_failure ZMODEM-resume/sz"
460: fi
461: fi
462: fi
463:
464: if test "$mode" = all -o "$mode" = rz-r ; then
465: echo "testing ZMODEM resume (rz -r)"
466: mkdir $testdir/resume-r 2>&5
467: dd if=$srcdir/src/Makefile.in of=$testdir/resume-r/lsz.c bs=256 count=5 2>&5
468: ($SZ -q $srcdir/src/lsz.c) <$testdir/pipe | \
469: (cd $testdir/resume-r ; $RZ -r $QUIET >>../pipe )
470: echo "differences are normal:" >&5
471: if cmp $srcdir/src/lsz.c $testdir/resume-r/lsz.c >&5 ; then
472: echo "receiver did not resume, but file is ok"
473: any_failure="$any_failure ZMODEM-resume/rz"
474: else
475: dd if=$srcdir/src/lsz.c of=$testdir/resume-r/lsz.c1 bs=256 count=5 2>&5
476: dd if=$testdir/resume-r/lsz.c bs=256 skip=5 >>$testdir/resume-r/lsz.c1 2>&5
477: if cmp $srcdir/src/lsz.c $testdir/resume-r/lsz.c1 ; then
478: :
479: rm -f $testdir/resume-r/lsz.c
480: rm -f $testdir/resume-r/lsz.c1
481: rmdir $testdir/resume-r 2>&5
482: else
483: echo "sender resumed, but files differ. This is really bad"
484: any_failure="$any_failure ZMODEM-resume/rz"
485: fi
486: fi
487: fi
488:
489: # test lsz -> original rz
490: if test "$mode" = orig-rz ; then
491: echo "testing ZMODEM"
492: mkdir $testdir/zmodem
493: failed=0
494: ($SZ -q $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
495: (cd $testdir/zmodem ; exec omen.rz $QUIET >>../pipe)
496: for i in $z_test_files ; do
497: bn=`basename $i`
498: cmp $i $testdir/zmodem/$bn
499: if test $? -eq 0 ; then
500: rm -f $testdir/zmodem/$bn
501: else
502: failed=1
503: fi
504: done
505: rmdir $testdir/zmodem 2>&5
506: if test $failed = 1 ; then
507: echo "orig-rz test failed"
508: any_failure="$any_failure orig-rz"
509: fi
510: fi
511:
512:
513: # test original sz -> lrz
514: if test "$mode" = orig-sz ; then
515: echo "testing ZMODEM"
516: mkdir $testdir/zmodem
517: failed=0
518: (omen.sz $z_test_files ) 2>/dev/null <$testdir/pipe | \
519: (cd $testdir/zmodem ; exec $RZ >>../pipe)
520: for i in $z_test_files ; do
521: bn=`basename $i`
522: cmp $i $testdir/zmodem/$bn
523: if test $? -eq 0 ; then
524: rm -f $testdir/zmodem/$bn
525: else
526: failed=1
527: fi
528: done
529: rmdir $testdir/zmodem 2>&5
530: if test $failed = 1 ; then
531: echo "orig-sz test failed"
532: any_failure="$any_failure orig-sz"
533: fi
534: fi
535:
536: # test original sz -> lrz
537: if test "$mode" = orig-kombi ; then
538: echo "testing ZMODEM"
539: mkdir $testdir/zmodem
540: failed=0
541: (omen.sz $y_test_files ;
542: sleep 1;
543: cd $testdir/zmodem;
544: echo
545: exec omen.rz ) 2>/dev/null <$testdir/pipe | \
546: (cd $testdir/zmodem ;
547: $RZ ;
548: rm -f * ;
549: sleep 3 ;
550: $SZ $y_test_files ) >>$testdir/pipe
551: for i in $y_test_files ; do
552: bn=`basename $i`
553: cmp $i $testdir/zmodem/$bn
554: if test $? -eq 0 ; then
555: rm -f $testdir/zmodem/$bn
556: else
557: failed=1
558: fi
559: done
560: rmdir $testdir/zmodem 2>&5
561: if test $failed = 1 ; then
562: echo "orig-kombi test failed"
563: any_failure="$any_failure orig-kombi"
564: fi
565: fi
566:
567: # test lsz -> zm rz (zxrx)
568: if test "$mode" = zm-rz ; then
569: echo "testing ZMODEM"
570: mkdir $testdir/zmodem
571: failed=0
572: ($SZ -q $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
573: (cd $testdir/zmodem ; exec zmrx $QUIET >>../pipe)
574: for i in $z_test_files ; do
575: bn=`basename $i`
576: cmp $i $testdir/zmodem/$bn
577: if test $? -eq 0 ; then
578: rm -f $testdir/zmodem/$bn
579: else
580: failed=1
581: fi
582: done
583: rmdir $testdir/zmodem 2>&5
584: if test $failed = 1 ; then
585: echo "orig-rz test failed"
586: any_failure="$any_failure zm-rz"
587: fi
588: fi
589:
590: # test zm sz (zmtx) -> lrz
591: if test "$mode" = zm-sz ; then
592: echo "testing ZMODEM"
593: mkdir $testdir/zmodem
594: failed=0
595: (zmtx $z_test_files ) 2>/dev/null <$testdir/pipe | \
596: (cd $testdir/zmodem ; exec $RZ >>../pipe)
597: for i in $z_test_files ; do
598: bn=`basename $i`
599: cmp $i $testdir/zmodem/$bn
600: if test $? -eq 0 ; then
601: rm -f $testdir/zmodem/$bn
602: else
603: failed=1
604: fi
605: done
606: rmdir $testdir/zmodem 2>&5
607: if test $failed = 1 ; then
608: echo "orig-sz test failed"
609: any_failure="$any_failure zm-sz"
610: fi
611: fi
612:
613: # test turbo mode lsz -> zmrx, omen.rz, lrz
614: if test "$mode" = turbo ; then
615: echo "testing turbo -> zmrx"
616: mkdir $testdir/turbo.zmrx
617: failed=0
618: ($SZ -qT $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
619: (cd $testdir/turbo.zmrx ; exec zmrx >>../pipe)
620: for i in $z_test_files ; do
621: bn=`basename $i`
622: cmp $i $testdir/turbo.zmrx/$bn
623: if test $? -eq 0 ; then
624: rm -f $testdir/turbo.zmrx/$bn
625: else
626: failed=1
627: fi
628: done
629: rmdir $testdir/turbo.zmrx 2>&5
630: if test $failed = 1 ; then
631: echo "turbo-zmrx test failed"
632: any_failure="$any_failure turbo-zmrx"
633: fi
634:
635: echo "testing turbo -> omen.rz"
636: mkdir $testdir/turbo.omen.rz
637: failed=0
638: ($SZ -qT $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
639: (cd $testdir/turbo.omen.rz ; exec omen.rz >>../pipe)
640: for i in $z_test_files ; do
641: bn=`basename $i`
642: cmp $i $testdir/turbo.omen.rz/$bn
643: if test $? -eq 0 ; then
644: rm -f $testdir/turbo.omen.rz/$bn
645: else
646: failed=1
647: fi
648: done
649: rmdir $testdir/turbo.omen.rz 2>&5
650: if test $failed = 1 ; then
651: echo "turbo-omen.rz test failed"
652: any_failure="$any_failure turbo-omen.rz"
653: fi
654:
655: echo "testing turbo -> lrz"
656: mkdir $testdir/turbo.lrz
657: failed=0
658: ($SZ -qT $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
659: (cd $testdir/turbo.lrz ; exec lrz >>../pipe)
660: for i in $z_test_files ; do
661: bn=`basename $i`
662: cmp $i $testdir/turbo.lrz/$bn
663: if test $? -eq 0 ; then
664: rm -f $testdir/turbo.lrz/$bn
665: else
666: failed=1
667: fi
668: done
669: rmdir $testdir/turbo.omen.rz 2>&5
670: if test $failed = 1 ; then
671: echo "turbo-lrz test failed"
672: any_failure="$any_failure turbo-lrz"
673: fi
674: fi
675:
676: #
677: # startup timing checks
678: #
679: # test lsz -> zm rz (zxrx)
680: if test "$mode" = startup ; then
681:
682: echo "testing lsz -> zm rz. lsz sleeps 10 seconds"
683: mkdir $testdir/startup.1
684: failed=0
685: ($SZ --delay-startup 10 -q $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
686: (cd $testdir/startup.1 ; exec zmrx $QUIET >>../pipe)
687: for i in $z_test_files ; do
688: bn=`basename $i`
689: cmp $i $testdir/startup.1/$bn
690: if test $? -eq 0 ; then
691: rm -f $testdir/startup.1/$bn
692: else
693: failed=1
694: fi
695: done
696: rmdir $testdir/startup.1 2>&5
697: if test $failed = 1 ; then
698: echo "zm-rz startup-timing test failed"
699: any_failure="$any_failure zm-rz-startup-timing"
700: fi
701:
702: echo "testing lsz -> omen.rz. lsz sleeps 10 seconds"
703: mkdir $testdir/startup.2
704: failed=0
705: ($SZ --delay-startup 10 -q $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
706: (cd $testdir/startup.2 ; exec omen.rz $QUIET >>../pipe)
707: for i in $z_test_files ; do
708: bn=`basename $i`
709: cmp $i $testdir/startup.2/$bn
710: if test $? -eq 0 ; then
711: rm -f $testdir/startup.2/$bn
712: else
713: failed=1
714: fi
715: done
716: rmdir $testdir/startup.2 2>&5
717: if test $failed = 1 ; then
718: echo "omen.rz startup-timing test failed"
719: any_failure="$any_failure omen-rz-startup-timing"
720: fi
721:
722: echo "testing lsz -> lrz. lsz sleeps 10 seconds"
723: mkdir $testdir/startup.3
724: failed=0
725: ($SZ --delay-startup 10 -q $SZBUFSIZE $z_test_files ) 2>/dev/null <$testdir/pipe | \
726: (cd $testdir/startup.3 ; exec $RZ $QUIET >>../pipe)
727: for i in $z_test_files ; do
728: bn=`basename $i`
729: cmp $i $testdir/startup.3/$bn
730: if test $? -eq 0 ; then
731: rm -f $testdir/startup.3/$bn
732: else
733: failed=1
734: fi
735: done
736: rmdir $testdir/startup.3 2>&5
737: if test $failed = 1 ; then
738: echo "lrz startup-timing test failed"
739: any_failure="$any_failure lrz-startup-timing"
740: fi
741:
742: echo "testing zmtx -> lrz. lrz sleeps 10 seconds"
743: mkdir $testdir/startup.4
744: failed=0
745: (zmtx $z_test_files ) 2>/dev/null <$testdir/pipe | \
746: (cd $testdir/startup.4 ; exec $RZ --delay-startup 10 $QUIET >>../pipe)
747: for i in $z_test_files ; do
748: bn=`basename $i`
749: cmp $i $testdir/startup.4/$bn
750: if test $? -eq 0 ; then
751: rm -f $testdir/startup.4/$bn
752: else
753: failed=1
754: fi
755: done
756: rmdir $testdir/startup.4 2>&5
757: if test $failed = 1 ; then
758: echo "zmtx startup-timing test failed"
759: any_failure="$any_failure zmtx-startup-timing"
760: fi
761:
762: echo "testing omen.sz -> lrz. lrz sleeps 10 seconds"
763: mkdir $testdir/startup.5
764: failed=0
765: (omen.sz $z_test_files ) 2>/dev/null <$testdir/pipe | \
766: (cd $testdir/startup.5 ; exec $RZ --delay-startup 10 $QUIET >>../pipe)
767: for i in $z_test_files ; do
768: bn=`basename $i`
769: cmp $i $testdir/startup.5/$bn
770: if test $? -eq 0 ; then
771: rm -f $testdir/startup.5/$bn
772: else
773: failed=1
774: fi
775: done
776: rmdir $testdir/startup.5 2>&5
777: if test $failed = 1 ; then
778: echo "omen.sz startup-timing test failed"
779: any_failure="$any_failure omen.sz-startup-timing"
780: fi
781:
782: echo "testing lsz -> lrz. lrz sleeps 10 seconds"
783: mkdir $testdir/startup.6
784: failed=0
785: ($SZ -q $z_test_files ) 2>/dev/null <$testdir/pipe | \
786: (cd $testdir/startup.6 ; exec $RZ --delay-startup 10 $QUIET >>../pipe)
787: for i in $z_test_files ; do
788: bn=`basename $i`
789: cmp $i $testdir/startup.6/$bn
790: if test $? -eq 0 ; then
791: rm -f $testdir/startup.6/$bn
792: else
793: failed=1
794: fi
795: done
796: rmdir $testdir/startup.6 2>&5
797: if test $failed = 1 ; then
798: echo "lsz startup-timing test failed"
799: any_failure="$any_failure lsz-startup-timing"
800: fi
801: fi
802:
803: if test "$mode" = stop-at ; then
804: echo "testing lsz -> lrz. lsz stops after 10 seconds"
805: mkdir $testdir/stop-at
806: failed=0
807: ($SZ --stop-at +10 $z8_test_files ) 2>/dev/null <$testdir/pipe | \
808: (cd $testdir/stop-at ; exec $RZ $QUIET >>../pipe)
809: for i in $z8_test_files ; do
810: bn=`basename $i`
811: cmp $i $testdir/stop-at/$bn
812: if test $? -eq 0 ; then
813: rm -f $testdir/stop-at/$bn
814: else
815: failed=1
816: fi
817: done
818: rmdir $testdir/stop-at 2>&5
819: if test $failed = 1 ; then
820: echo "stop-at test failed"
821: any_failure="$any_failure stop-at"
822: fi
823: fi
824:
825: if test "x$any_failure" = x ; then
826: :
827: else
828: echo "the following tests failed:"
829: echo $any_failure
830: echo "have a look into `pwd`/$testdir"
831: exit 1
832: fi
833:
834: echo "All tests OK."
835: if test "$mode" = all -o "$mode" = abuse ; then
836: echo
837: echo "going to tests misuse. Errors are ok, hangs are not!"
838:
839: echo
840: echo "both sides sending:"
841: $SZ -q $z_test_files <$testdir/pipe | \
842: ($SZ $z_test_files >>$testdir/pipe )
843:
844: echo
845: echo "both sides receiving:"
846: $RZ -q <$testdir/pipe | \
847: ( $RZ >>$testdir/pipe )
848: fi
849:
850: #rm -rf $testdir
851: exit 0
852:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>