VMS: Add installation verification procedure
authorRichard Levitte <levitte@openssl.org>
Sat, 2 Jul 2016 08:28:39 +0000 (10:28 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 2 Jul 2016 13:50:44 +0000 (15:50 +0200)
On VMS, it's customary to have a procedure to check that the software
was installed correctly and can run as advertised.

The procedure added here is fairly simple, it checks that all
libraries are in place, that the header crypto.h is in place, and that
the command 'openssl version -a' runs without trouble.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/descrip.mms.tmpl
VMS/openssl_ivp.com.in [new file with mode: 0644]

index f33801e..225f385 100644 (file)
@@ -302,6 +302,9 @@ install : install_sw install_ssldirs install_docs
                     WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils to define commands" ; -
                     WRITE SYS$OUTPUT "" )
 
+check_install :
+        spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp.com
+
 uninstall : uninstall_docs uninstall_sw
 
 # Because VMS wants the generation number (or *) to delete files, we can't
@@ -345,9 +348,9 @@ descrip.mms : FORCE
 
 # Install helper targets #############################################
 
-install_sw : all install_dev install_engines install_runtime install_startup
+install_sw : all install_dev install_engines install_runtime install_startup install_ivp
 
-uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime uninstall_startup
+uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime uninstall_startup uninstall_ivp
 
 install_docs : install_html_docs
 
@@ -411,6 +414,10 @@ install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
         COPY/PROT=W:RE [.VMS]openssl_shutdown.com ossl_installroot:[SYS$STARTUP]
         COPY/PROT=W:RE [.VMS]openssl_utils.com ossl_installroot:[SYS$STARTUP]
 
+install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
+        - CREATE/DIR ossl_installroot:[SYSTEST]
+        COPY/PROT=W:RE [.VMS]openssl_ivp.com ossl_installroot:[SYSTEST]
+
 [.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
         - CREATE/DIR [.VMS]
         $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
@@ -429,6 +436,12 @@ install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
                 {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
                 > [.VMS]openssl_shutdown.com
 
+[.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
+        - CREATE/DIR [.VMS]
+        $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
+                {- sourcefile("VMS", "openssl_ivp.com.in") -} -
+                > [.VMS]openssl_ivp.com
+
 vmsconfig.pm : configdata.pm
         OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
         WRITE CONFIG "package vmsconfig;"
diff --git a/VMS/openssl_ivp.com.in b/VMS/openssl_ivp.com.in
new file mode 100644 (file)
index 0000000..950542b
--- /dev/null
@@ -0,0 +1,40 @@
+$      ! OpenSSL Internal Verification Procedure
+$      !
+$      ! This script checks the consistency of a OpenSSL installation
+$      ! It had better be spawned, as it creates process logicals
+$
+$      ! Generated information
+$      INSTALLTOP := {- $config{INSTALLTOP} -}
+$      OPENSSLDIR := {- $config{OPENSSLDIR} -}
+$
+$      ! Make sure that INSTALLTOP and OPENSSLDIR become something one
+$      ! can use to call the startup procedure
+$      INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") -
+                    - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$      OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") -
+                    - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$
+$      @'INSTALLTOP_'SYS$STARTUP]openssl_startup
+$      @'INSTALLTOP_'SYS$STARTUP]openssl_utils
+$
+$      v    := {- sprintf "%02d%02d", split(/\./, $config{version}) -}
+$      pz   := {- $config{pointer_size} -}
+$      
+$      IF F$SEARCH("OSSL$LIBCRYPTO''pz'") .EQS. "" -
+           .OR. F$SEARCH("OSSL$LIBSSL''pz'") .EQS. "" -
+           .OR. F$SEARCH("OSSL$LIBCRYPTO_SHR''pz'") .EQS. "" -
+           .OR. F$SEARCH("OSSL$LIBSSL_SHR''pz'") .EQS. "" -
+           .OR. F$SEARCH("OSSL$INCLUDE:[OPENSSL]crypto.h") .EQS. "" -
+           .OR. F$SEARCH("OPENSSL:crypto.h") .EQS. "" -
+           .OR. F$SEARCH("OSSL$EXE:OPENSSL''v'.EXE") .EQS. ""
+$      THEN
+$          WRITE SYS$ERROR "Installation inconsistent"
+$          EXIT %x00018292 ! RMS$_FNF, file not found
+$      ENDIF
+$
+$      ! If something else is wrong with the installation, we're likely
+$      ! to get an image activation error here
+$      openssl version -a
+$
+$      WRITE SYS$ERROR "OpenSSL IVP passed"
+$      EXIT %x10000001