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