Add more memory to distribution sanity test
[releng/builder.git] / jjb / integration / distribution / distribution-check-bootup.sh
index 7547109446da8185e9d404c8004a05d6d322e546..e3147f335e64e9ca9a2161064aa92606f4ce3906 100644 (file)
@@ -1,8 +1,13 @@
-CONTROLLERMEM="3072m"
-ACTUALFEATURES="odl-integration-all"
-
 if [[ ! -z "${CONTROLLERFEATURES}" ]]; then
     ACTUALFEATURES="odl-integration-all,${CONTROLLERFEATURES}"
+else
+    ACTUALFEATURES="odl-integration-all"
+fi
+
+if [[ "${JOB_NAME}" == *"distribution-sanity"* ]]; then
+    CONTROLLERMEM="4096m"
+else
+    CONTROLLERMEM="3072m"
 fi
 
 echo "Kill any controller running"
@@ -28,14 +33,18 @@ if [[ "$KARAF_VERSION" == "karaf3" ]]; then
     FEATURE_TEST_STRING="features-integration-test"
 fi
 
-sed -ie "s%\(featuresRepositories=\|featuresRepositories =\)%featuresRepositories = mvn:org.opendaylight.integration/${FEATURE_TEST_STRING}/${BUNDLE_VERSION}/xml/features,%g" ${FEATURESCONF}
+sed -ie "s%\(featuresRepositories= \|featuresRepositories = \)%featuresRepositories = mvn:org.opendaylight.integration/${FEATURE_TEST_STRING}/${BUNDLE_VERSION}/xml/features,%g" ${FEATURESCONF}
 
 if [[ ! -z "${REPO_URL}" ]]; then
-   sed -ie "s%featuresRepositories =%featuresRepositories = ${REPO_URL},%g" ${FEATURESCONF}
+   # sed below will fail if it finds space between feature repos.
+   REPO_URL_NO_SPACE="$(echo -e "${REPO_URL}" | tr -d '[:space:]')"
+   sed -ie "s%featuresRepositories = %featuresRepositories = ${REPO_URL_NO_SPACE},%g" ${FEATURESCONF}
 fi
 
 # Add actual boot features.
-sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" "${FEATURESCONF}"
+# sed below will fail if it finds space between feature repos.
+FEATURES_NO_SPACE="$(echo -e "${ACTUALFEATURES}" | tr -d '[:space:]')"
+sed -ie "s/\(featuresBoot= \|featuresBoot = \)/featuresBoot = ${FEATURES_NO_SPACE},/g" "${FEATURESCONF}"
 cat "${FEATURESCONF}"
 
 echo "Configuring the log..."
@@ -51,7 +60,10 @@ cat "${MEMCONF}"
 echo "Listing all open ports on controller system"
 netstat -pnatu
 
-if [ "${JDKVERSION}" == 'openjdk8' ]; then
+if [ "$JDKVERSION" == 'openjdk11' ]; then
+    echo "Preparing for JRE Version 11"
+    JAVA_HOME="/opt/jdk-11"
+elif [ "${JDKVERSION}" == 'openjdk8' ]; then
     echo "Setting the JRE Version to 8"
     # dynamic_verify does not allow sudo, JAVA_HOME should be enough for karaf start.
     # sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64/jre/bin/java
@@ -83,16 +95,16 @@ function dump_log_and_exit {
     exit 1
 }
 
-echo "Waiting up to 5 minutes for controller to come up, checking every 5 seconds..."
+echo "Waiting up to 6 minutes for controller to come up, checking every 5 seconds..."
 COUNT="0"
 while true; do
     COUNT=$(( ${COUNT} + 5 ))
     sleep 5
     echo "already waited ${COUNT} seconds..."
-    if grep --quiet 'org.opendaylight.infrautils.ready-impl.*System ready' "${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log"; then
+    if grep --quiet 'org.opendaylight.infrautils.*System ready' "${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log"; then
         echo "Controller is UP"
         break
-    elif (( "${COUNT}" > "300" )); then
+    elif (( "${COUNT}" >= "360" )); then
         echo "Timeout Controller DOWN"
         dump_log_and_exit
     fi