Merge "Revert "Install odl-mdsal-trace in netvirt oxygen csit""
[releng/builder.git] / jjb / integration / integration-configure-clustering.sh
index 89dd8e9aa1c239a4d40ee1a4872c50a3b4de6139..ee18f254061a97139c1158faee4ee820f26b3810 100644 (file)
@@ -4,6 +4,7 @@
 # script.
 # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
 source ${ROBOT_VENV}/bin/activate
+source /tmp/common-functions.sh ${BUNDLEFOLDER}
 
 echo "#################################################"
 echo "##         Configure Cluster and Start         ##"
@@ -55,6 +56,8 @@ fi
 
 # Create the configuration script to be run on controllers.
 cat > ${WORKSPACE}/configuration-script.sh <<EOF
+set -x
+source /tmp/common-functions.sh ${BUNDLEFOLDER}
 
 echo "Changing to /tmp"
 cd /tmp
@@ -71,27 +74,14 @@ cat ${MAVENCONF}
 
 echo "Configuring the startup features..."
 sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF}
-sed -ie "s%\(featuresRepositories=\|featuresRepositories =\)%featuresRepositories = mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.0.0/xml/features,%g" ${FEATURESCONF}
-cat ${FEATURESCONF}
 
-echo "Configuring the log..."
-sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' ${LOGCONF}
-# FIXME: Make log size limit configurable from build parameter.
-sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=30GB/g' ${LOGCONF}
-# Add custom logging levels
-# CONTROLLERDEBUGMAP is expected to be a key:value map of space separated values like "module:level module2:level2"
-# where module is abbreviated and does not include org.opendaylight
-unset IFS
-if [ -n "${CONTROLLERDEBUGMAP}" ]; then
-    for kv in ${CONTROLLERDEBUGMAP}; do
-        module=\${kv%%:*}
-        level=\${kv#*:}
-        if [ -n \${module} ] && [ -n \${level} ]; then
-            echo "log4j.logger.org.opendaylight.\${module} = \${level}" >> \${LOGCONF}
-        fi
-    done
+FEATURE_TEST_STRING="features-integration-test"
+if [[ "$KARAF_VERSION" == "karaf4" ]]; then
+    FEATURE_TEST_STRING="features-test"
 fi
-cat ${LOGCONF}
+
+sed -ie "s%\(featuresRepositories=\|featuresRepositories =\)%featuresRepositories = mvn:org.opendaylight.integration/\${FEATURE_TEST_STRING}/${BUNDLEVERSION}/xml/features,mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.0.0/xml/features,%g" ${FEATURESCONF}
+cat ${FEATURESCONF}
 
 if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
   echo "Enable the l3.fwd in custom.properties.."
@@ -99,7 +89,9 @@ if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then
   cat ${CUSTOMPROP}
 fi
 
-set_java_vars
+configure_karaf_log "${KARAF_VERSION}" "${CONTROLLERDEBUGMAP}"
+
+set_java_vars "${JAVA_HOME}" "${CONTROLLERMEM}" "${MEMCONF}"
 
 # Copy shard file if exists
 if [ -f /tmp/custom_shard_config.txt ]; then