tests.com 6.7 KB

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