summaryrefslogtreecommitdiffstats
path: root/testsuites/stability/src
diff options
context:
space:
mode:
authorChenfei Gao <cgao@research.att.com>2019-07-31 13:46:40 -0400
committerChenfei Gao <cgao@research.att.com>2019-07-31 16:14:16 -0400
commitfcd2589ede3060c1bbb1826da3753bcaa6236ee8 (patch)
tree0561116c605ad95ea1c87ed526ca49cd45e61e44 /testsuites/stability/src
parentbccd3a9b4d86c582f2065907a51ac2cade366691 (diff)
Remove hardcoded ip in PAP testsuites
Removed and parametrized hardcoded ip in stability test scripts Issue-ID: POLICY-1958 Change-Id: I8f8f6efdf481179ecbc308284b041287b3fbf861 Signed-off-by: Chenfei Gao <cgao@research.att.com>
Diffstat (limited to 'testsuites/stability/src')
-rw-r--r--testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh2
-rw-r--r--testsuites/stability/src/main/resources/papsetup/setup_pap.sh13
2 files changed, 13 insertions, 2 deletions
diff --git a/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh b/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh
index 66f7cc01..d20944a9 100644
--- a/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh
+++ b/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh
@@ -41,5 +41,5 @@ fi
echo "Policy pap config file: $CONFIG_FILE"
-$JAVA_HOME/bin/java -cp "$POLICY_PAP_HOME/etc:$POLICY_PAP_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=10.2.0.43 org.onap.policy.pap.main.startstop.Main -c $CONFIG_FILE
+$JAVA_HOME/bin/java -cp "$POLICY_PAP_HOME/etc:$POLICY_PAP_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=$PAP_HOST org.onap.policy.pap.main.startstop.Main -c $CONFIG_FILE
diff --git a/testsuites/stability/src/main/resources/papsetup/setup_pap.sh b/testsuites/stability/src/main/resources/papsetup/setup_pap.sh
index 07713707..dc5e69e7 100644
--- a/testsuites/stability/src/main/resources/papsetup/setup_pap.sh
+++ b/testsuites/stability/src/main/resources/papsetup/setup_pap.sh
@@ -20,4 +20,15 @@
# the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo ${DIR}
-docker run -p 9090:9090 -p 6969:6969 -v ${DIR}/config/pap/bin/policy-pap.sh:/opt/app/policy/pap/bin/policy-pap.sh -v ${DIR}/config/pap/etc/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json --add-host mariadb:10.2.0.41 --name policy-pap -d --rm nexus3.onap.org:10001/onap/policy-pap:2.0.0-SNAPSHOT-latest
+
+if ["$#" -lt 2]; then
+ echo "PAP and MariaDB IPs should be passed as two parameters. PAP IP goes first."
+ exit 1
+else
+ PAP=$1
+ echo "PAP IP: ${PAP}"
+ MARIADB=$2
+ echo "MariaDB IP: ${MARIADB}"
+fi
+
+docker run -p 9090:9090 -p 6969:6969 -e "PAP_HOST=${PAP}" -v ${DIR}/config/pap/bin/policy-pap.sh:/opt/app/policy/pap/bin/policy-pap.sh -v ${DIR}/config/pap/etc/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json --add-host mariadb:${MARIADB} --name policy-pap -d --rm nexus3.onap.org:10001/onap/policy-pap:2.0.0-SNAPSHOT-latest