JDK 11 controller support in tox job 09/87509/18
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 7 Feb 2020 12:45:25 +0000 (13:45 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Fri, 21 Feb 2020 23:01:35 +0000 (00:01 +0100)
update tox.ini to use JDK8 to build the sims
and JDK11 to build the controller and run the JVMs
inside ODL jenkins releng tox job.

JIRA: TRNSPRTPCE-192 TRNSPRTPCE-197
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Ibb355d1181fd8de32b5b112b0145b87f38e2c38b

tests/buildHoneynode.sh
tests/installJDK11CentOS.sh [new file with mode: 0755]
tests/installMavenCentOS.sh
tox.ini

index 5bffcea9bd4f34abe09cf1d47179a92a8614874d..3c1b6bf26c3075b637f7b44adffc594fd8d11994 100755 (executable)
@@ -8,7 +8,7 @@ rm -rf honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb
 mkdir -p honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang
 #cp honeynode/$ORDMVERSION/honeynode-plugin-api/src/main/yang/* honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang
 find honeynode/$ORDMVERSION/honeynode-plugin-api/src/main/yang/ -name "*.yang" -type f -exec cp {} ./honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang \;
 mkdir -p honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang
 #cp honeynode/$ORDMVERSION/honeynode-plugin-api/src/main/yang/* honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang
 find honeynode/$ORDMVERSION/honeynode-plugin-api/src/main/yang/ -name "*.yang" -type f -exec cp {} ./honeynode/$ORDMVERSION/honeynode-plugin-impl/src/main/resources/honeycomb-minimal-resources/config/yang \;
-(cd honeynode/$ORDMVERSION/ && mvn clean install -DskipTests -Dcheckstyle.skip -s ../fd_io_honeycomb_settings.xml)
+(cd honeynode/$ORDMVERSION/ && mvn clean install -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip=true -s ../fd_io_honeycomb_settings.xml)
 chmod +x ./honeynode/$ORDMVERSION/honeynode-distribution/target/honeynode-distribution-1.18.01-hc/honeynode-distribution-1.18.01/honeycomb-tpce
 
 exit $?
 chmod +x ./honeynode/$ORDMVERSION/honeynode-distribution/target/honeynode-distribution-1.18.01-hc/honeynode-distribution-1.18.01/honeycomb-tpce
 
 exit $?
diff --git a/tests/installJDK11CentOS.sh b/tests/installJDK11CentOS.sh
new file mode 100755 (executable)
index 0000000..da2893d
--- /dev/null
@@ -0,0 +1,13 @@
+#/bin/bash
+
+#sudo yum remove -y java-1.8.0-openjdk-devel java-1.8.0-openjdk
+#sudo yum check-update
+sudo yum install -y java-11-openjdk java-11-openjdk-devel
+last_installed_jdk11=$(ls -tr1 /usr/lib/jvm/ | grep java-11-openjdk-11 | tail -1)
+if [ -n "$last_installed_jdk11" ];then
+  sudo alternatives --set java /usr/lib/jvm/$last_installed_jdk11/bin/java
+  sudo alternatives --set javac /usr/lib/jvm/$last_installed_jdk11/bin/javac
+else
+  echo "No java11 available"
+  exit 1
+fi
index cc2869266e24c1eb16577be6ea7d386824c842c8..f4feca9b99d712d598eb39bbf8b2c7d5e4cf9616 100755 (executable)
@@ -6,3 +6,4 @@ sudo mkdir -p /opt
 sudo tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
 sudo ln -s /opt/apache-maven-3.6.3 /opt/maven
 sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn
 sudo tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
 sudo ln -s /opt/apache-maven-3.6.3 /opt/maven
 sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn
+touch FLAG_TPCE_RELENG
diff --git a/tox.ini b/tox.ini
index 0880f88666856f9602c875db858402fc4d7a3329..58365ed45925f9957b59204d876b919f9dd09e26 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -18,10 +18,12 @@ whitelist_externals = bash
 changedir={toxinidir}/tests
 commands =
   {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh  ; fi"
 changedir={toxinidir}/tests
 commands =
   {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "if [ ! `which mvn` ]; then ./installMavenCentOS.sh  ; fi"
+  {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end}: - ./buildHoneynode.sh
+  {py3,portmapping221,rspn221,topology221,otntopology,olm221,end2end221}: - ./buildHoneynode.sh 2.2.1
+  {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "if [ -f FLAG_TPCE_RELENG ]; then ./installJDK11CentOS.sh  ; fi"
   {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end,portmapping221,rspn221,topology221,otn-topology,olm221,end2end221}: - bash -c "sed 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java >/tmp/pivot; mv /tmp/pivot ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
   {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end,portmapping221,rspn221,topology221,otn-topology,olm221,end2end221}: - bash -c "sed 's@=.*//#FUNCTESTVAL=@=@g' ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java >/tmp/pivot; mv /tmp/pivot ../olm/src/main/java/org/opendaylight/transportpce/olm/util/OlmUtils.java"
-  {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "(cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true)"
+  {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c "cd .. && mvn clean install -s tests/odl_settings.xml -DskipTests -Dmaven.javadoc.skip=true"
   {py3,portmapping,topoPortMapping,rspn,topology,pce,olm,end2end,portmapping221,rspn221,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,topology221,otntopology,olm221,end2end221,gnpy}: - bash -c 'if [ "$USE_LIGHTY" == "True" ]; then (cd ../lighty && ./build.sh); fi'
-  {py3,portmapping,topoPortMapping,rspn,topology,olm,end2end}: - ./buildHoneynode.sh
   {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,topology}: nosetests --with-xunit transportpce_tests/1.2.1/test_topology.py
   {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,topology}: nosetests --with-xunit transportpce_tests/1.2.1/test_topology.py
@@ -29,7 +31,6 @@ commands =
   {py3,pce}: nosetests --with-xunit transportpce_tests/1.2.1/test_pce.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
   {py3,pce}: nosetests --with-xunit transportpce_tests/1.2.1/test_pce.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
-  {py3,portmapping221,rspn221,topology221,otntopology,olm221,end2end221}: - ./buildHoneynode.sh 2.2.1
   {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
   {otntopology}: nosetests --with-xunit transportpce_tests/2.2.1/test_otn_topology.py
   {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
   {otntopology}: nosetests --with-xunit transportpce_tests/2.2.1/test_otn_topology.py
@@ -41,7 +42,6 @@ commands =
   {gnpy}: nosetests --with-xunit transportpce_tests/1.2.1/test_gnpy.py
   {gnpy}: - sudo docker container rm -f gnpy_tpce_rest1
 
   {gnpy}: nosetests --with-xunit transportpce_tests/1.2.1/test_gnpy.py
   {gnpy}: - sudo docker container rm -f gnpy_tpce_rest1
 
-
 [testenv:docs]
 deps = -rdocs/requirements.txt
 commands =
 [testenv:docs]
 deps = -rdocs/requirements.txt
 commands =