-#!/bin/bash
+#!/bin/sh
ORDMVERSION=${1:-1.2.1}
set -e
-. reflectwarn.sh
+. $(dirname $0)/reflectwarn.sh
cd honeynode/$ORDMVERSION
mvn clean install -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip=true -s ../fd_io_honeycomb_settings.xml -q -V
chmod +x ./honeynode-distribution/target/honeynode-distribution-1.19.04-hc/honeynode-distribution-1.19.04/honeycomb-tpce
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' ' "/restconf-port/c\ \"restconf-port\" : "$REST_HTTP"," $(dirname $0)/config/restconf.json
+ 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' ' "/restconf-websocket-port/c\ \"restconf-websocket-port\" : "$REST_WEBSOCKET"," $(dirname $0)/config/restconf.json
+ 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' ' "/restconf-https-enabled/c\ \"restconf-https-enabled\" : \"false\"," $(dirname $0)/config/restconf.json
+ 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
. $(dirname $0)/../../../../../../reflectwarn.sh
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
+ 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
+ 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
+ mv $(dirname $0)/config/yang/openconfig/* $(dirname $0)/config/yang/.
+ rm -rf $(dirname $0)/config/yang/openconfig
fi
if [ "$#" -ge 2 ]
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' ' "/restconf-port/c\ \"restconf-port\" : "$REST_HTTP"," $(dirname $0)/config/restconf.json
+ 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' ' "/restconf-websocket-port/c\ \"restconf-websocket-port\" : "$REST_WEBSOCKET"," $(dirname $0)/config/restconf.json
+ 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' ' "/restconf-https-enabled/c\ \"restconf-https-enabled\" : \"false\"," $(dirname $0)/config/restconf.json
+ 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
. $(dirname $0)/../../../../../../reflectwarn.sh
-psutil>=3.0.1 # 3-clause / New BSD License
+psutil>=5.6.7 # 3-clause / New BSD License
requests!=2.12.2,>=2.10.0 # Apache License 2.0
executable = "../lighty/target/lighty-transportpce-12.0.0-SNAPSHOT/clean-start-controller.sh"
with open('odl.log', 'w') as outfile:
return subprocess.Popen(
- ["bash", executable], stdout=outfile, stderr=outfile,
+ ["sh", executable], stdout=outfile, stderr=outfile,
stdin=open(os.devnull))
else:
print ("starting KARAF TransportPCE build...")
executable = "../karaf/target/assembly/bin/karaf"
with open('odl.log', 'w') as outfile:
return subprocess.Popen(
- ["bash", executable, "server"], stdout=outfile, stderr=outfile,
+ ["sh", executable, "server"], stdout=outfile, stderr=outfile,
stdin=open(os.devnull))
executable = "../lighty/target/lighty-transportpce-12.0.0-SNAPSHOT/clean-start-controller.sh"
with open('odl.log', 'w') as outfile:
return subprocess.Popen(
- ["bash", executable], stdout=outfile, stderr=outfile,
+ ["sh", executable], stdout=outfile, stderr=outfile,
stdin=open(os.devnull))
else:
print ("starting KARAF TransportPCE build...")
executable = "../karaf/target/assembly/bin/karaf"
with open('odl.log', 'w') as outfile:
return subprocess.Popen(
- ["bash", executable, "server"], stdout=outfile, stderr=outfile,
+ ["sh", executable, "server"], stdout=outfile, stderr=outfile,
stdin=open(os.devnull))
deps =
-r{toxinidir}/tests/requirements.txt
-r{toxinidir}/tests/test-requirements.txt
-whitelist_externals = bash
+whitelist_externals = sh
sudo
changedir={toxinidir}/tests
commands =
#install maven and JDK11 on the Gate since they are not there by default
- {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh ; fi"
+ {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - sh -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh ; fi"
#build 1.2.1 sims
- {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end}: - bash -c "./buildHoneynode.sh"
+ {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end}: - sh -c "./buildHoneynode.sh"
#patch OLM constant to speed up tests, unnecessary for PCE
- {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otn-topology,olm221,end2end221}: - bash -c "sed -i' ' 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
+ {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otn-topology,olm221,end2end221}: - sh -c "sed -i' ' 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
#build controller, source JDK_JAVA_OPTIONS to remove illegal reflective acces warnings introduced by Java11
- {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c ". reflectwarn.sh && cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip"
+ {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - sh -c ". $PWD/reflectwarn.sh && cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip"
#patch Karaf exec for the same reason at runtime
- {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "sed -i' ' 's@!/bin/sh@!/bin/sh\n. $(dirname $0)/../../../../tests/reflectwarn.sh@' ../karaf/target/assembly/bin/karaf"
+ {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - sh -c "sed -i' ' 's@!/bin/sh@!/bin/sh\'$'\n. $(dirname $0)/../../../../tests/reflectwarn.sh@' ../karaf/target/assembly/bin/karaf"
#build Lighty if needed
- {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c 'if [ "$USE_LIGHTY" == "True" ]; then (cd ../lighty && ./build.sh); fi'
+ {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221,gnpy}: - sh -c 'if [ "$USE_LIGHTY" = "True" ]; then (cd ../lighty && ./build.sh); fi'
#run 1.2.1 functional tests
{py3,portmapping}: nosetests --with-xunit transportpce_tests/1.2.1/test_portmapping.py
{py3,topoPortMapping}: nosetests --with-xunit transportpce_tests/1.2.1/test_topoPortMapping.py
{py3,olm}: nosetests --with-xunit transportpce_tests/1.2.1/test_olm.py
{end2end}: nosetests --with-xunit transportpce_tests/1.2.1/test_end2end.py
#build 2.2.1 sims
- {py3,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221}: - bash -c "./buildHoneynode.sh 2.2.1"
+ {py3,portmapping221,rspn221,otnrenderer,topology221,otntopology,olm221,end2end221}: - sh -c "./buildHoneynode.sh 2.2.1"
#run 2.2.1 functional tests
{py3,portmapping221}: nosetests --with-xunit transportpce_tests/2.2.1/test_portmapping.py
{py3,topology221}: nosetests --with-xunit transportpce_tests/2.2.1/test_topology.py