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