NPN 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 $
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 $       gosub 'tests_e'
80 $       goto loop_tests
81 $
82 $ test_evp:
83 $       mcr 'texe_dir''evptest' evptests.txt
84 $       return
85 $ test_des:
86 $       mcr 'texe_dir''destest'
87 $       return
88 $ test_idea:
89 $       mcr 'texe_dir''ideatest'
90 $       return
91 $ test_sha:
92 $       mcr 'texe_dir''shatest'
93 $       mcr 'texe_dir''sha1test'
94 $       return
95 $ test_mdc2:
96 $       mcr 'texe_dir''mdc2test'
97 $       return
98 $ test_md5:
99 $       mcr 'texe_dir''md5test'
100 $       return
101 $ test_md4:
102 $       mcr 'texe_dir''md4test'
103 $       return
104 $ test_hmac:
105 $       mcr 'texe_dir''hmactest'
106 $       return
107 $ test_wp:
108 $       mcr 'texe_dir''wptest'
109 $       return
110 $ test_md2:
111 $       mcr 'texe_dir''md2test'
112 $       return
113 $ test_rmd:
114 $       mcr 'texe_dir''rmdtest'
115 $       return
116 $ test_bf:
117 $       mcr 'texe_dir''bftest'
118 $       return
119 $ test_cast:
120 $       mcr 'texe_dir''casttest'
121 $       return
122 $ test_rc2:
123 $       mcr 'texe_dir''rc2test'
124 $       return
125 $ test_rc4:
126 $       mcr 'texe_dir''rc4test'
127 $       return
128 $ test_rc5:
129 $       mcr 'texe_dir''rc5test'
130 $       return
131 $ test_rand:
132 $       mcr 'texe_dir''randtest'
133 $       return
134 $ test_enc:
135 $       @testenc.com
136 $       return
137 $ test_x509:
138 $       define sys$error nla0:
139 $       write sys$output "test normal x509v1 certificate"
140 $       @tx509.com
141 $       write sys$output "test first x509v3 certificate"
142 $       @tx509.com v3-cert1.pem
143 $       write sys$output "test second x509v3 certificate"
144 $       @tx509.com v3-cert2.pem
145 $       deassign sys$error
146 $       return
147 $ test_rsa:
148 $       define sys$error nla0:
149 $       @trsa.com
150 $       deassign sys$error
151 $       mcr 'texe_dir''rsatest'
152 $       return
153 $ test_crl:
154 $       define sys$error nla0:
155 $       @tcrl.com
156 $       deassign sys$error
157 $       return
158 $ test_sid:
159 $       define sys$error nla0:
160 $       @tsid.com
161 $       deassign sys$error
162 $       return
163 $ test_req:
164 $       define sys$error nla0:
165 $       @treq.com
166 $       @treq.com testreq2.pem
167 $       deassign sys$error
168 $       return
169 $ test_pkcs7:
170 $       define sys$error nla0:
171 $       @tpkcs7.com
172 $       @tpkcs7d.com
173 $       deassign sys$error
174 $       return
175 $ test_bn:
176 $       write sys$output "starting big number library test, could take a while..."
177 $       create bntest-vms.fdl
178 FILE
179         ORGANIZATION    sequential
180 RECORD
181         FORMAT          stream_lf
182 $       create/fdl=bntest-vms.fdl bntest-vms.sh
183 $       open/append foo bntest-vms.sh
184 $       type/output=foo: sys$input:
185 << __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"'
186 $       define/user sys$output bntest-vms.tmp
187 $       mcr 'texe_dir''bntest'
188 $       copy bntest-vms.tmp foo:
189 $       delete bntest-vms.tmp;*
190 $       type/output=foo: sys$input:
191 __FOO__
192 $       close foo
193 $       write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
194 $       write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
195 $       write sys$output "-- went well."
196 $       write sys$output ""
197 $       write sys$output "test a^b%c implementations"
198 $       mcr 'texe_dir''exptest'
199 $       return
200 $ test_ec:
201 $       write sys$output "test elliptic curves"
202 $       mcr 'texe_dir''ectest'
203 $       return
204 $ test_ecdsa:
205 $       write sys$output "test ecdsa"
206 $       mcr 'texe_dir''ecdsatest'
207 $       return
208 $ test_ecdh:
209 $       write sys$output "test ecdh"
210 $       mcr 'texe_dir''ecdhtest'
211 $       return
212 $ test_verify:
213 $       write sys$output "The following command should have some OK's and some failures"
214 $       write sys$output "There are definitly a few expired certificates"
215 $       @tverify.com
216 $       return
217 $ test_dh:
218 $       write sys$output "Generate a set of DH parameters"
219 $       mcr 'texe_dir''dhtest'
220 $       return
221 $ test_dsa:
222 $       write sys$output "Generate a set of DSA parameters"
223 $       mcr 'texe_dir''dsatest'
224 $       return
225 $ test_gen:
226 $       write sys$output "Generate and verify a certificate request"
227 $       @testgen.com
228 $       return
229 $ maybe_test_ss:
230 $       testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
231 $       if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then -
232                 goto test_ss
233 $       if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then -
234                 goto test_ss
235 $       if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
236                 goto test_ss
237 $       return
238 $ test_ss:
239 $       write sys$output "Generate and certify a test certificate"
240 $       @testss.com
241 $       return
242 $ test_engine: 
243 $       write sys$output "Manipulate the ENGINE structures"
244 $       mcr 'texe_dir''enginetest'
245 $       return
246 $ test_ssl:
247 $       write sys$output "test SSL protocol"
248 $       gosub maybe_test_ss
249 $       @testssl.com keyU.ss certU.ss certCA.ss
250 $       return
251 $ test_ca:
252 $       set noon
253 $       define/user sys$output nla0:
254 $       mcr 'exe_dir'openssl no-rsa
255 $       save_severity=$SEVERITY
256 $       set on
257 $       if save_severity
258 $       then
259 $           write sys$output "skipping CA.com test -- requires RSA"
260 $       else
261 $           write sys$output "Generate and certify a test certificate via the 'ca' program"
262 $           @testca.com
263 $       endif
264 $       return
265 $ test_aes: 
266 $!      write sys$output "test AES"
267 $!      !mcr 'texe_dir''aestest'
268 $       return
269 $ test_tsa:
270 $       set noon
271 $       define/user sys$output nla0:
272 $       mcr 'exe_dir'openssl no-rsa
273 $       save_severity=$SEVERITY
274 $       set on
275 $       if save_severity
276 $       then
277 $           write sys$output "skipping testtsa.com test -- requires RSA"
278 $       else
279 $           @testtsa.com
280 $       endif
281 $       return
282 $ test_ige: 
283 $       write sys$output "Test IGE mode"
284 $       mcr 'texe_dir''igetest'
285 $       return
286 $ test_jpake: 
287 $       write sys$output "Test JPAKE"
288 $       mcr 'texe_dir''jpaketest'
289 $       return
290 $ test_cms:
291 $       write sys$output "CMS consistency test"
292 $       perl CMS-TEST.PL
293 $       return
294 $
295 $
296 $ exit:
297 $       set default '__save_default'
298 $       deassign sslroot
299 $       exit