Fix the xacml-pdp CSIT failures 41/85041/1
authorMichael Mokry <michael.mokry@att.com>
Thu, 11 Apr 2019 11:07:17 +0000 (06:07 -0500)
committerMichael Mokry <michael.mokry@att.com>
Thu, 11 Apr 2019 11:07:17 +0000 (06:07 -0500)
Looks like CSIT uses docker to install xacml-pdp so a change in OOM is
not necessary to fix this problem.  I took a look at the PAP script and
found some small differenences and made those changes in xacml-pdp.  I
have not been able to successfully test this as I spent all night trying
to figure out how to execute it in my VM with and without arguments. I
added some debugger code in as well to get more information in the logs
and see if the property file is actually being found.

Change-Id: Ib6ca95edab4483aa4e65efca73a9f58342cc1ec0
Issue-ID: POLICY-1449
Signed-off-by: Michael Mokry <michael.mokry@att.com>
packages/policy-xacmlpdp-docker/src/main/docker/policy-pdpx.sh

index 7e0eb11..45ba314 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -xv
 #
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
@@ -18,7 +18,6 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 #
-
 JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/
 POLICY_PDPX_HOME=/opt/app/policy/pdpx
 KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore"
@@ -27,12 +26,17 @@ TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore"
 TRUSTSTORE_PASSWD="Pol1cy_0nap"
 
 
-if [ "$#" -eq 1 ]; then
+if [ "$#" -ge 1 ]; then
     CONFIG_FILE=$1
 else
     CONFIG_FILE=${CONFIG_FILE}
 fi
 
+if [ "$#" -ge 2 ]; then
+       PROP_FILE=$2
+else
+       PROP_FILE=${PROP_FILE}
+
 if [ -z "$CONFIG_FILE" ]
   then
     CONFIG_FILE="$POLICY_PDPX_HOME/etc/defaultConfig.json"
@@ -44,5 +48,6 @@ if [ -z "$PROP_FILE" ]
 fi
 
 echo "Policy Xacml PDP config file: $CONFIG_FILE"
+echo "Policy Xacml PDP topic properties file: $PROP_FILE"
 
 $JAVA_HOME/bin/java -cp "$POLICY_PDPX_HOME/etc:$POLICY_PDPX_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" org.onap.policy.pdpx.main.startstop.Main -c $CONFIG_FILE -p $PROP_FILE