X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=tests%2Fhoneynode%2F2.2.1%2Fminimal-distribution-core%2Fsrc%2Fmain%2Fresources%2Fhoneycomb-minimal-resources%2Fhoneycomb-tpce;h=331ca69d01dde567632df3169b7a716c142d17a0;hb=f7c30c15a03bfc9250476e225c615dad928b5129;hp=ec622d7f3427af41d834cfeacd26bb5627630fe7;hpb=7474055983b078ca899ccd3f1c56e5627bf77e52;p=transportpce.git diff --git a/tests/honeynode/2.2.1/minimal-distribution-core/src/main/resources/honeycomb-minimal-resources/honeycomb-tpce b/tests/honeynode/2.2.1/minimal-distribution-core/src/main/resources/honeycomb-minimal-resources/honeycomb-tpce index ec622d7f3..331ca69d0 100755 --- a/tests/honeynode/2.2.1/minimal-distribution-core/src/main/resources/honeycomb-minimal-resources/honeycomb-tpce +++ b/tests/honeynode/2.2.1/minimal-distribution-core/src/main/resources/honeycomb-minimal-resources/honeycomb-tpce @@ -1,5 +1,22 @@ #!/bin/sh - STATUS=100 +JAVA_CMD="java" +[ -n "$JAVA_HOME" ] && JAVA_CMD="$JAVA_HOME/bin/java" +JAVA_VER=$("$JAVA_CMD" -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*".*$/\1\2/p;') +echo $JAVA_VER +[ "$JAVA_VER" -ge 110 ] && echo "ok, java is 11 or newer" || { echo "it's too old..."; exit 1; } +if [ -d $(dirname $0)/config/yang/common ]; then + mv $(dirname $0)/config/yang/common/* $(dirname $0)/config/yang/. + rm -rf $(dirname $0)/config/yang/common +fi +if [ -d $(dirname $0)/config/yang/devices ]; then + mv $(dirname $0)/config/yang/devices/* $(dirname $0)/config/yang/. + rm -rf $(dirname $0)/config/yang/devices +fi +if [ -d $(dirname $0)/config/yang/openconfig ]; then + mv $(dirname $0)/config/yang/openconfig/* $(dirname $0)/config/yang/. + rm -rf $(dirname $0)/config/yang/openconfig +fi if [ "$#" -ge 2 ] then @@ -7,18 +24,31 @@ then CONFIG=$2 if [ -e $CONFIG ] then + mkdir -p $(dirname $0)/persist + mkdir -p $(dirname $0)/logs + REST_HTTP=$(echo 81`echo $PORT | tail -c 3`) + REST_WEBSOCKET=$(echo 77`echo $PORT | tail -c 3`) cp $CONFIG $(dirname $0)/config/device/ filename=$(basename -- "$CONFIG") + device=$(basename "$CONFIG" .xml) echo "changing netconf port with $PORT in netconf.json file ..." - sed -i "/netconf-ssh-binding-port/c\ \"netconf-ssh-binding-port\" : "$PORT"," $(dirname $0)/config/netconf.json + sed -i' ' "s/\"netconf-ssh-binding-port\".*,/\"netconf-ssh-binding-port\" : "$PORT",/g" $(dirname $0)/config/netconf.json + echo "changing restconf http port with $REST_HTTP in restconf.json file ..." + sed -i' ' "s/\"restconf-port\".*,/\"restconf-port\" : "$REST_HTTP",/g" $(dirname $0)/config/restconf.json + echo "changing restconf websocket with $REST_WEBSOCKET in restconf.json file ..." + sed -i' ' "s/\"restconf-websocket-port\".*,/\"restconf-websocket-port\" : "$REST_WEBSOCKET",/g" $(dirname $0)/config/restconf.json + echo "changing restconf-https-enabled to false in restconf.json file ..." + sed -i' ' "s/\"restconf-https-enabled\".*,/\"restconf-https-enabled\" : \"false\",/g" $(dirname $0)/config/restconf.json echo "changing persist-context and persist-config to false in honeycomb.json file ..." - sed -i "/persist-context/c\ \"persist-context\" : \"false\"," $(dirname $0)/config/honeycomb.json - sed -i "/persist-config/c\ \"persist-config\" : \"false\"," $(dirname $0)/config/honeycomb.json + sed -i' ' "s/\"persist-context\".*,/\"persist-context\" : \"false\",/g" $(dirname $0)/config/honeycomb.json + sed -i' ' "s/\"persist-config\".*,/\"persist-config\" : \"false\",/g" $(dirname $0)/config/honeycomb.json echo "changing netconf-initial-config-xml location with $CONFIG in honeycomb.json file ..." - sed -i "/netconf-initial-config-xml/c\ \"netconf-initial-config-xml\" : \"device/$filename\"," $(dirname $0)/config/honeycomb.json + sed -i' ' "s@\"netconf-initial-config-xml\".*,@\"netconf-initial-config-xml\" : \"device/$filename\",@g" $(dirname $0)/config/honeycomb.json while [ $STATUS -eq 100 ] do - java -Xms512m -Xmn512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar $(dirname $0)/honeynode-distribution-1.18.01.jar + . $(dirname $0)/../../../../../../reflectwarn.sh + # needed to remove JDK11 reflective access warning + "$JAVA_CMD" -DDEVICE=${device} -Dlogback.logs.directory=$(dirname $0)/logs -Xms512m -Xmn512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar $(dirname $0)/honeynode-distribution-1.19.04.jar STATUS=$? echo "Honeycomb exited with status: $STATUS" if [ $STATUS -eq 100 ] @@ -29,7 +59,7 @@ then else echo "initial config file doesn't exist !" fi -else - echo "honeycomb-tpce port initial-config-xml (option)pm-list-xml" - echo "Eg : honeycomb-tpce 17832 sample-config-ROADM.xml pm-list.xml" +else + echo "honeycomb-tpce port initial-config-xml" + echo "Eg : honeycomb-tpce 17832 sample-config-ROADM.xml (rest-http port will be 81 + netconf-port last two digits : 8132)" fi