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