From fcd2589ede3060c1bbb1826da3753bcaa6236ee8 Mon Sep 17 00:00:00 2001 From: Chenfei Gao Date: Wed, 31 Jul 2019 13:46:40 -0400 Subject: 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 --- .../main/resources/papsetup/config/pap/bin/policy-pap.sh | 2 +- .../stability/src/main/resources/papsetup/setup_pap.sh | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'testsuites') 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 -- cgit 1.2.3-korg