]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/sslScripts/runProtClient
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / sslScripts / runProtClient
1 #! /bin/csh -f
2 #
3 # wrapper for running sslViewer from protClient script.
4 #
5 # usage: runProtClient [q] [e errMsg] viewerArgs ...
6 #
7 set OUR_QUIET=0
8 set VIEW_QUIET=
9 set VIEWER_ARGS=
10 set ERR_MSG=
11 set EXPECT_ERR=0
12
13 #
14 # q and e used here; q used both here and in sslViewer
15 #
16 while ( $#argv > 0 )
17 switch ( "$argv[1]" )
18 case q:
19 set OUR_QUIET = 1
20 set VIEW_QUIET = q
21 shift
22 breaksw
23 case e:
24 shift
25 if($#argv == 0) then
26 echo specify errMsg with e option
27 exit(1)
28 endif
29 set ERR_MSG = "$argv[1]"
30 set EXPECT_ERR=1
31 shift
32 breaksw
33 default:
34 set thisArg = "$argv[1]"
35 set VIEWER_ARGS = "$VIEWER_ARGS $thisArg"
36 shift
37 breaksw
38 endsw
39 end
40 if($OUR_QUIET == 0) then
41 if($EXPECT_ERR == 1) then
42 echo === $ERR_MSG
43 endif
44 endif
45 set cmd="sslViewer $VIEWER_ARGS $VIEW_QUIET"
46 if($OUR_QUIET == 0) then
47 echo $cmd
48 endif
49 $cmd
50 if($status != $EXPECT_ERR) then
51 if($EXPECT_ERR == 0) then
52 echo @@@@ UNEXPECTED ERROR FROM sslViewer. Aborting.
53 else
54 echo @@@ FAILED TO GET EXPECTED ERROR FROM sslViewer. Aborting.
55 endif
56 exit(1)
57 endif
58
59
60