From: guillaume.lambert Date: Thu, 26 Aug 2021 12:50:27 +0000 (+0200) Subject: Refactor buildcontroller tox profile X-Git-Tag: 4.0.0~19^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=commitdiff_plain;h=e84adfdd7aef4f56e1084a5471e7b46436c0ab1e Refactor buildcontroller tox profile JIRA: TRNSPRTPCE-482 Signed-off-by: guillaume.lambert Change-Id: Ic53c9f04ab7f35756792e615af299a98687bb288 --- diff --git a/tests/build_controller.sh b/tests/build_controller.sh new file mode 100755 index 000000000..b261d951b --- /dev/null +++ b/tests/build_controller.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +current_dir=$PWD + +cd $(dirname $0) + +#install maven and JDK11 on the Gate since they are not there by default +which mvn >/dev/null || ./installMavenCentOS.sh +cd ../ + +#patch OLM constant to speed up tests, unnecessary for PCE tests +sed -i'_' 's@=.*//#FUNCTESTVAL=@=@g' olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java +if [ "$USE_LIGHTY" != "True" ]; then + for suffix in 121 221 71; do + rm -rf "karaf$suffix" + cp -r karaf "karaf$suffix" + done +fi + +#build controller, source JDK_JAVA_OPTIONS to remove illegal reflective acces warnings introduced by Java11 +. "$current_dir"/reflectwarn.sh +mvn clean install -B -q -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip + +mv olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java_ olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java + +#patch Karaf exec for the same reason at runtime and also to have the possibility to use alternative ports +./karaf/target/assembly/ressources/post_install_for_tests.sh + +#build Lighty if needed +if [ "$USE_LIGHTY" = "True" ]; then + cd lighty + ./build.sh +fi diff --git a/tox.ini b/tox.ini index 298c8cb3f..82315a4a6 100644 --- a/tox.ini +++ b/tox.ini @@ -23,21 +23,9 @@ changedir = {toxinidir}/tests parallel_show_output = true [testenv:buildcontroller] -whitelist_externals = sh - sudo +whitelist_externals = build_controller.sh commands = -#install maven and JDK11 on the Gate since they are not there by default - sh -c "which mvn >/dev/null || ./installMavenCentOS.sh" -#patch OLM constant to speed up tests, unnecessary for PCE tests - sh -c "sed -i'_' 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java" - sh -c 'if [ "$USE_LIGHTY" != "True" ]; then (cd ../; for suffix in 121 221 71; do rm -rf "karaf$suffix"; cp -r karaf "karaf$suffix";done) ; fi' -#build controller, source JDK_JAVA_OPTIONS to remove illegal reflective acces warnings introduced by Java11 - sh -c ". $PWD/reflectwarn.sh && cd .. && mvn clean install -B -q -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true -Dodlparent.spotbugs.skip -Dodlparent.checkstyle.skip" - sh -c "mv ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java_ ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java" -#patch Karaf exec for the same reason at runtime and also to have the possibility to use alternative ports - sh -c "../karaf/target/assembly/ressources/post_install_for_tests.sh" -#build Lighty if needed - sh -c 'if [ "$USE_LIGHTY" = "True" ]; then (cd ../lighty && ./build.sh); fi' + ./build_controller.sh [testenv:sims121] whitelist_externals = install_honeynode.sh