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