Merge remote-tracking branch 'trevp/pemfix' into trev-pem-fix
[openssl.git] / test / tests.com
index 7fd99937d871184b1aa6912d595921c39d3db0e8..62be1e7a46e62fb85be316400704664065f2a91a 100644 (file)
@@ -1,21 +1,43 @@
 $! TESTS.COM  --  Performs the necessary tests
 $!
 $! P1  tests to be performed.  Empty means all.
-$
+$! P2  Pointer size: "", "32", or "64".
+$!
+$! Announce/identify.
+$!
+$      proc = f$environment( "procedure")
+$      write sys$output "@@@ "+ -
+        f$parse( proc, , , "name")+ f$parse( proc, , , "type")
+$!
 $      __proc = f$element(0,";",f$environment("procedure"))
 $      __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;"
 $      __save_default = f$environment("default")
-$      __arch := VAX
+$      __arch = "VAX"
 $      if f$getsyi("cpu") .ge. 128 then -
-          __arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
-$      if __arch .eqs. "" then __arch := UNK
-$      texe_dir := sys$disk:[-.'__arch'.exe.test]
-$      exe_dir := sys$disk:[-.'__arch'.exe.apps]
-$
-$      sslroot = f$parse("sys$disk:[-.apps];",,,,"syntax_only") - "].;"+ ".]"
-$      define /translation_attributes = concealed sslroot 'sslroot'
+          __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
+$      if __arch .eqs. "" then __arch = "UNK"
+$!
+$      __archd = __arch
+$       pointer_size = ""
+$      if (p2 .eq. "64")
+$      then
+$        pointer_size = "64"
+$        __archd = __arch+ "_64"
+$      endif
+$!
+$      texe_dir := sys$disk:[-.'__archd'.exe.test]
+$      exe_dir := sys$disk:[-.'__archd'.exe.apps]
 $
 $      set default '__here'
+$
+$       ROOT = F$PARSE("sys$disk:[-]A.;0",,,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
+$       ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
+$       ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
+                   - ".][000000" - "[000000." - "][" - "[" - "]"
+$       ROOT = ROOT_DEV + "[" + ROOT_DIR
+$       DEFINE/NOLOG SSLROOT 'ROOT'.APPS.] /TRANS=CONC
+$      openssl_conf := sslroot:[000000]openssl-vms.cnf
+$
 $      on control_y then goto exit
 $      on error then goto exit
 $
@@ -34,7 +56,7 @@ $         tests := -
        test_enc,test_x509,test_rsa,test_crl,test_sid,-
        test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,-
        test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,-
-       test_jpake
+       test_jpake,test_srp,test_cms
 $      endif
 $      tests = f$edit(tests,"COLLAPSE")
 $
@@ -69,17 +91,19 @@ $   ENGINETEST :=   enginetest
 $      EVPTEST :=      evp_test
 $      IGETEST :=      igetest
 $      JPAKETEST :=    jpaketest
-$
+$      SRPTEST :=      srptest
+$!
 $      tests_i = 0
 $ loop_tests:
 $      tests_e = f$element(tests_i,",",tests)
 $      tests_i = tests_i + 1
 $      if tests_e .eqs. "," then goto exit
+$      write sys$output "---> ''tests_e'"
 $      gosub 'tests_e'
 $      goto loop_tests
 $
 $ test_evp:
-$      mcr 'texe_dir''evptest' evptests.txt
+$      mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt
 $      return
 $ test_des:
 $      mcr 'texe_dir''destest'
@@ -131,68 +155,109 @@ $ test_rand:
 $      mcr 'texe_dir''randtest'
 $      return
 $ test_enc:
-$      @testenc.com
+$      @testenc.com 'pointer_size'
 $      return
 $ test_x509:
-$      define sys$error nla0:
+$      set noon
+$      define sys$error test_x509.err
 $      write sys$output "test normal x509v1 certificate"
-$      @tx509.com
+$      @tx509.com "" 'pointer_size'
 $      write sys$output "test first x509v3 certificate"
-$      @tx509.com v3-cert1.pem
+$      @tx509.com v3-cert1.pem 'pointer_size'
 $      write sys$output "test second x509v3 certificate"
-$      @tx509.com v3-cert2.pem
+$      @tx509.com v3-cert2.pem 'pointer_size'
 $      deassign sys$error
+$      set on
 $      return
 $ test_rsa:
-$      define sys$error nla0:
-$      @trsa.com
+$      set noon
+$      define sys$error test_rsa.err
+$      @trsa.com "" 'pointer_size'
 $      deassign sys$error
 $      mcr 'texe_dir''rsatest'
+$      set on
 $      return
 $ test_crl:
-$      define sys$error nla0:
-$      @tcrl.com
+$      set noon
+$      define sys$error test_crl.err
+$      @tcrl.com "" 'pointer_size'
 $      deassign sys$error
+$      set on
 $      return
 $ test_sid:
-$      define sys$error nla0:
-$      @tsid.com
+$      set noon
+$      define sys$error test_sid.err
+$      @tsid.com "" 'pointer_size'
 $      deassign sys$error
+$      set on
 $      return
 $ test_req:
-$      define sys$error nla0:
-$      @treq.com
-$      @treq.com testreq2.pem
+$      set noon
+$      define sys$error test_req.err
+$      @treq.com "" 'pointer_size'
+$      @treq.com testreq2.pem 'pointer_size'
 $      deassign sys$error
+$      set on
 $      return
 $ test_pkcs7:
-$      define sys$error nla0:
-$      @tpkcs7.com
-$      @tpkcs7d.com
+$      set noon
+$      define sys$error test_pkcs7.err
+$      @tpkcs7.com "" 'pointer_size'
+$      @tpkcs7d.com "" 'pointer_size'
 $      deassign sys$error
+$      set on
 $      return
 $ test_bn:
-$      write sys$output "starting big number library test, could take a while..."
-$      create bntest-vms.fdl
+$      write sys$output -
+             "starting big number library test, could take a while..."
+$      set noon
+$      define sys$error test_bn.err
+$      define sys$output test_bn.out
+$      @ bctest.com
+$      status = $status
+$      deassign sys$error
+$      deassign sys$output
+$      set on
+$      if (status)
+$      then
+$          create /fdl = sys$input bntest-vms.tmp
 FILE
        ORGANIZATION    sequential
 RECORD
        FORMAT          stream_lf
-$      create/fdl=bntest-vms.fdl bntest-vms.sh
-$      open/append foo bntest-vms.sh
-$      type/output=foo: sys$input:
+$          define /user_mode sys$output bntest-vms.tmp
+$          mcr 'texe_dir''bntest'
+$          define /user_mode sys$input bntest-vms.tmp
+$          define /user_mode sys$output bntest-vms.out
+$          bc
+$          @ bntest.com bntest-vms.out
+$          status = $status
+$          if (status)
+$          then
+$              delete bntest-vms.out;*
+$              delete bntest-vms.tmp;*
+$          endif
+$      else
+$          create /fdl = sys$input bntest-vms.sh
+FILE
+       ORGANIZATION    sequential
+RECORD
+       FORMAT          stream_lf
+$          open /append bntest_file bntest-vms.sh
+$          type /output = bntest_file sys$input:
 << __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"'
-$      define/user sys$output bntest-vms.tmp
-$      mcr 'texe_dir''bntest'
-$      copy bntest-vms.tmp foo:
-$      delete bntest-vms.tmp;*
-$      type/output=foo: sys$input:
+$          define /user_mode sys$output bntest-vms.tmp
+$          mcr 'texe_dir''bntest'
+$          copy bntest-vms.tmp bntest_file
+$          delete bntest-vms.tmp;*
+$          type /output = bntest_file sys$input:
 __FOO__
-$      close foo
-$      write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
-$      write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
-$      write sys$output "-- went well."
-$      write sys$output ""
+$          close bntest_file
+$          write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and"
+$          write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations"
+$          write sys$output "-- went well."
+$          write sys$output ""
+$      endif
 $      write sys$output "test a^b%c implementations"
 $      mcr 'texe_dir''exptest'
 $      return
@@ -211,7 +276,7 @@ $   return
 $ test_verify:
 $      write sys$output "The following command should have some OK's and some failures"
 $      write sys$output "There are definitly a few expired certificates"
-$      @tverify.com
+$      @tverify.com 'pointer_size'
 $      return
 $ test_dh:
 $      write sys$output "Generate a set of DH parameters"
@@ -223,7 +288,7 @@ $   mcr 'texe_dir''dsatest'
 $      return
 $ test_gen:
 $      write sys$output "Generate and verify a certificate request"
-$      @testgen.com
+$      @testgen.com 'pointer_size'
 $      return
 $ maybe_test_ss:
 $      testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT"))
@@ -236,7 +301,7 @@ $   if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then -
 $      return
 $ test_ss:
 $      write sys$output "Generate and certify a test certificate"
-$      @testss.com
+$      @testss.com 'pointer_size'
 $      return
 $ test_engine: 
 $      write sys$output "Manipulate the ENGINE structures"
@@ -245,11 +310,11 @@ $ return
 $ test_ssl:
 $      write sys$output "test SSL protocol"
 $      gosub maybe_test_ss
-$      @testssl.com keyU.ss certU.ss certCA.ss
+$      @testssl.com keyU.ss certU.ss certCA.ss 'pointer_size'
 $      return
 $ test_ca:
 $      set noon
-$      define/user sys$output nla0:
+$      define /user_mode sys$output test_ca.out
 $      mcr 'exe_dir'openssl no-rsa
 $      save_severity=$SEVERITY
 $      set on
@@ -258,7 +323,7 @@ $   then
 $          write sys$output "skipping CA.com test -- requires RSA"
 $      else
 $          write sys$output "Generate and certify a test certificate via the 'ca' program"
-$          @testca.com
+$          @testca.com 'pointer_size'
 $      endif
 $      return
 $ test_aes: 
@@ -267,7 +332,7 @@ $!  !mcr 'texe_dir''aestest'
 $      return
 $ test_tsa:
 $      set noon
-$      define/user sys$output nla0:
+$      define /user_mode sys$output nla0:
 $      mcr 'exe_dir'openssl no-rsa
 $      save_severity=$SEVERITY
 $      set on
@@ -275,7 +340,7 @@ $   if save_severity
 $      then
 $          write sys$output "skipping testtsa.com test -- requires RSA"
 $      else
-$          @testtsa.com
+$          @testtsa.com "" "" "" 'pointer_size'
 $      endif
 $      return
 $ test_ige: 
@@ -286,9 +351,20 @@ $ test_jpake:
 $      write sys$output "Test JPAKE"
 $      mcr 'texe_dir''jpaketest'
 $      return
+$ test_cms:
+$      write sys$output "CMS consistency test"
+$      ! Define the logical name used to find openssl.exe in the perl script.
+$      define /user_mode osslx 'exe_dir'
+$      perl CMS-TEST.PL
+$      return
+$ test_srp: 
+$      write sys$output "Test SRP"
+$      mcr 'texe_dir''srptest'
+$      return
 $
 $
 $ exit:
+$      mcr 'exe_dir'openssl version -a
 $      set default '__save_default'
 $      deassign sslroot
 $      exit