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