PR: 1411
[oweals/openssl.git] / test / tests.com
1 $! TESTS.COM  --  Performs the necessary tests
2 $!
3 $! P1   tests to be performed.  Empty means all.
4 $
5 $       __proc = f$element(0,";",f$environment("procedure"))
6 $       __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
7 $       __save_default = f$environment("default")
8 $       __arch := VAX
9 $       if f$getsyi("cpu") .ge. 128 then -
10            __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
11 $       if __arch .eqs. "" then __arch := UNK
12 $       texe_dir := sys$disk:[-.'__arch'.exe.test]
13 $       exe_dir := sys$disk:[-.'__arch'.exe.apps]
14 $
15 $       set default '__here'
16 $
17 $       on control_y then goto exit
18 $       on error then goto exit
19 $
20 $       if p1 .nes. ""
21 $       then
22 $           tests = p1
23 $       else
24 $! NOTE: This list reflects the list of dependencies following the
25 $! "alltests" target in Makefile.  This should make it easy to see
26 $! if there's a difference that needs to be taken care of.
27 $           tests := -
28         test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,-
29         test_md2,test_mdc2,-
30         test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,-
31         test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,-
32         test_enc,test_x509,test_rsa,test_crl,test_sid,-
33         test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
34         test_ss,test_ca,test_engine,test_evp,test_ssl,test_ige,test_jpake
35 $       endif
36 $       tests = f$edit(tests,"COLLAPSE")
37 $
38 $       BNTEST :=       bntest
39 $       ECTEST :=       ectest
40 $       ECDSATEST :=    ecdsatest
41 $       ECDHTEST :=     ecdhtest
42 $       EXPTEST :=      exptest
43 $       IDEATEST :=     ideatest
44 $       SHATEST :=      shatest
45 $       SHA1TEST :=     sha1test
46 $       MDC2TEST :=     mdc2test
47 $       RMDTEST :=      rmdtest
48 $       MD2TEST :=      md2test
49 $       MD4TEST :=      md4test
50 $       MD5TEST :=      md5test
51 $       HMACTEST :=     hmactest
52 $       RC2TEST :=      rc2test
53 $       RC4TEST :=      rc4test
54 $       RC5TEST :=      rc5test
55 $       BFTEST :=       bftest
56 $       CASTTEST :=     casttest
57 $       DESTEST :=      destest
58 $       RANDTEST :=     randtest
59 $       DHTEST :=       dhtest
60 $       DSATEST :=      dsatest
61 $       METHTEST :=     methtest
62 $       SSLTEST :=      ssltest
63 $       RSATEST :=      rsa_test
64 $       ENGINETEST :=   enginetest
65 $       EVPTEST :=      evp_test
66 $       IGETEST :=      igetest
67 $       JPAKETEST :=    jpaketest
68 $
69 $       tests_i = 0
70 $ loop_tests:
71 $       tests_e = f$element(tests_i,",",tests)
72 $       tests_i = tests_i + 1
73 $       if tests_e .eqs. "," then goto exit
74 $       gosub 'tests_e'
75 $       goto loop_tests
76 $
77 $ test_evp:
78 $       mcr 'texe_dir''evptest' evptests.txt
79 $       return
80 $ test_des:
81 $       mcr 'texe_dir''destest'
82 $       return
83 $ test_idea:
84 $       mcr 'texe_dir''ideatest'
85 $       return
86 $ test_sha:
87 $       mcr 'texe_dir''shatest'
88 $       mcr 'texe_dir''sha1test'
89 $       return
90 $ test_mdc2:
91 $       mcr 'texe_dir''mdc2test'
92 $       return
93 $ test_md5:
94 $       mcr 'texe_dir''md5test'
95 $       return
96 $ test_md4:
97 $       mcr 'texe_dir''md4test'
98 $       return
99 $ test_hmac:
100 $       mcr 'texe_dir''hmactest'
101 $       return
102 $ test_md2:
103 $       mcr 'texe_dir''md2test'
104 $       return
105 $ test_rmd:
106 $       mcr 'texe_dir''rmdtest'
107 $       return
108 $ test_bf:
109 $       mcr 'texe_dir''bftest'
110 $       return
111 $ test_cast:
112 $       mcr 'texe_dir''casttest'
113 $       return
114 $ test_rc2:
115 $       mcr 'texe_dir''rc2test'
116 $       return
117 $ test_rc4:
118 $       mcr 'texe_dir''rc4test'
119 $       return
120 $ test_rc5:
121 $       mcr 'texe_dir''rc5test'
122 $       return
123 $ test_rand:
124 $       mcr 'texe_dir''randtest'
125 $       return
126 $ test_enc:
127 $       @testenc.com
128 $       return
129 $ test_x509:
130 $       define sys$error nla0:
131 $       write sys$output "test normal x509v1 certificate"
132 $       @tx509.com
133 $       write sys$output "test first x509v3 certificate"
134 $       @tx509.com v3-cert1.pem
135 $       write sys$output "test second x509v3 certificate"
136 $       @tx509.com v3-cert2.pem
137 $       deassign sys$error
138 $       return
139 $ test_rsa:
140 $       define sys$error nla0:
141 $       @trsa.com
142 $       deassign sys$error
143 $       mcr 'texe_dir''rsatest'
144 $       return
145 $ test_crl:
146 $       define sys$error nla0:
147 $       @tcrl.com
148 $       deassign sys$error
149 $       return
150 $ test_sid:
151 $       define sys$error nla0:
152 $       @tsid.com
153 $       deassign sys$error
154 $       return
155 $ test_req:
156 $       define sys$error nla0:
157 $       @treq.com
158 $       @treq.com testreq2.pem
159 $       deassign sys$error
160 $       return
161 $ test_pkcs7:
162 $       define sys$error nla0:
163 $       @tpkcs7.com
164 $       @tpkcs7d.com
165 $       deassign sys$error
166 $       return
167 $ test_bn:
168 $       write sys$output "starting big number library test, could take a while..."
169 $       create bntest-vms.fdl
170 FILE
171         ORGANIZATION    sequential
172 RECORD
173         FORMAT          stream_lf
174 $       create/fdl=bntest-vms.fdl bntest-vms.sh
175 $       open/append foo bntest-vms.sh
176 $       type/output=foo: sys$input:
177 << __FOO__ sh -c "`sh ./bctest`" | perl -e '$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} else {print STDERR "."; $i++;}} print STDERR "\n$i tests passed\n"'
178 $       define/user sys$output bntest-vms.tmp
179 $       mcr 'texe_dir''bntest'
180 $       copy bntest-vms.tmp foo:
181 $       delete bntest-vms.tmp;*
182 $       type/output=foo: sys$input:
183 __FOO__
184 $       close foo
185 $       write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
186 $       write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
187 $       write sys$output "-- went well."
188 $       write sys$output ""
189 $       write sys$output "test a^b%c implementations"
190 $       mcr 'texe_dir''exptest'
191 $       return
192 $ test_ec:
193 $       write sys$output "test elliptic curves"
194 $       mcr 'texe_dir''ectest'
195 $       return
196 $ test_ecdsa:
197 $       write sys$output "test ecdsa"
198 $       mcr 'texe_dir''ecdsatest'
199 $       return
200 $ test_ecdh:
201 $       write sys$output "test ecdh"
202 $       mcr 'texe_dir''ecdhtest'
203 $       return
204 $ test_verify:
205 $       write sys$output "The following command should have some OK's and some failures"
206 $       write sys$output "There are definitly a few expired certificates"
207 $       @tverify.com
208 $       return
209 $ test_dh:
210 $       write sys$output "Generate a set of DH parameters"
211 $       mcr 'texe_dir''dhtest'
212 $       return
213 $ test_dsa:
214 $       write sys$output "Generate a set of DSA parameters"
215 $       mcr 'texe_dir''dsatest'
216 $       return
217 $ test_gen:
218 $       write sys$output "Generate and verify a certificate request"
219 $       @testgen.com
220 $       return
221 $ maybe_test_ss:
222 $       testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
223 $       if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
224                 goto test_ss
225 $       if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
226                 goto test_ss
227 $       if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
228                 goto test_ss
229 $       return
230 $ test_ss:
231 $       write sys$output "Generate and certify a test certificate"
232 $       @testss.com
233 $       return
234 $ test_engine: 
235 $       write sys$output "Manipulate the ENGINE structures"
236 $       mcr 'texe_dir''enginetest'
237 $       return
238 $ test_ssl:
239 $       write sys$output "test SSL protocol"
240 $       gosub maybe_test_ss
241 $       @testssl.com keyU.ss certU.ss certCA.ss
242 $       return
243 $ test_ca:
244 $       set noon
245 $       define/user sys$output nla0:
246 $       mcr 'exe_dir'openssl no-rsa
247 $       save_severity=$SEVERITY
248 $       set on
249 $       if save_severity
250 $       then
251 $           write sys$output "skipping CA.com test -- requires RSA"
252 $       else
253 $           write sys$output "Generate and certify a test certificate via the 'ca' program"
254 $           @testca.com
255 $       endif
256 $       return
257 $ test_rd: 
258 $       write sys$output "test Rijndael"
259 $       !mcr 'texe_dir''rdtest'
260 $       return
261 $ test_ige: 
262 $       write sys$output "Test IGE mode"
263 $       mcr 'texe_dir''igetest'
264 $       return
265 $ test_jpake: 
266 $       write sys$output "Test JPAKE"
267 $       mcr 'texe_dir''jpaketest'
268 $       return
269 $
270 $
271 $ exit:
272 $       set default '__save_default'
273 $       exit