Merge "Remove unit test Java version dependency"
authorPamela Dragosh <pdragosh@research.att.com>
Thu, 26 Apr 2018 11:20:50 +0000 (11:20 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 26 Apr 2018 11:20:50 +0000 (11:20 +0000)
packages/base/src/files/etc/ssl/policy-keystore [new file with mode: 0644]
packages/docker/src/main/docker/do-start.sh
packages/docker/src/main/docker/docker-install.sh

diff --git a/packages/base/src/files/etc/ssl/policy-keystore b/packages/base/src/files/etc/ssl/policy-keystore
new file mode 100644 (file)
index 0000000..c389096
Binary files /dev/null and b/packages/base/src/files/etc/ssl/policy-keystore differ
index 47b835a..0179fad 100644 (file)
@@ -64,9 +64,10 @@ else
 
        . /opt/app/policy/etc/profile.d/env.sh
 
-       # install policy keystore
-       mkdir -p $POLICY_HOME/etc/ssl
-       cp config/policy-keystore $POLICY_HOME/etc/ssl
+       if [[ -f config/policy-keystore ]]; then
+           # install policy keystore
+           cp config/policy-keystore $POLICY_HOME/etc/ssl
+       fi
 
        if [[ -f config/$container-tweaks.sh ]] ; then
                # file may not be executable; running it as an
index a4dd0ce..62289c5 100644 (file)
@@ -356,7 +356,6 @@ function install_base() {
                exit 1
        fi
 
-       /bin/mkdir -p ${POLICY_HOME}/etc/ssl > /dev/null 2>&1
        /bin/mkdir -p ${POLICY_HOME}/etc/init.d > /dev/null 2>&1
        /bin/mkdir -p ${POLICY_HOME}/tmp > /dev/null 2>&1
        /bin/mkdir -p ${POLICY_HOME}/var > /dev/null 2>&1
@@ -394,6 +393,21 @@ function configure_base() {
        fi
 }
 
+function configure_keystore() {
+       if [[ $DEBUG == y ]]; then
+               echo "-- ${FUNCNAME[0]} --"
+               set -x
+       fi
+
+    local DEFAULT_KEYSTORE_PASSWORD="Pol1cy_0nap"
+
+       if [[ -n ${KEYSTORE_PASSWD} ]]; then
+           keytool -storepasswd -storepass ${DEFAULT_KEYSTORE_PASSWORD} -keystore ${POLICY_HOME}/etc/ssl/policy-keystore -new ${KEYSTORE_PASSWD}
+           keytool -list -keystore ${POLICY_HOME}/etc/ssl/policy-keystore -storepass ${KEYSTORE_PASSWD}
+       fi
+}
+
+
 function install_tomcat_component() {
        if [[ $DEBUG == y ]]; then
                echo "-- ${FUNCNAME[0]} $@ --"
@@ -731,6 +745,7 @@ if [[ ${OPERATION} == configure ]]; then
                base)   
                        configure_base
                        component_preconfigure
+                       configure_keystore
                        ;;
                pdp)    
                        configure_component "${COMPONENT_TYPE}.conf" "${POLICY_HOME}/servers/${COMPONENT_TYPE}/"