X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fdistribution%2Fdistribution-check-bootup.sh;h=a02b91bf58a328fa68a9b4dc04647fdb182e8a76;hb=30335204e5bcf1f465fd890b5fc330539c7089fd;hp=6ab50cfb389161cf82ca817635beb5ce7ae02033;hpb=ddc0947933af78b12a3b0df8302d6c71c800c5b5;p=releng%2Fbuilder.git diff --git a/jjb/integration/distribution/distribution-check-bootup.sh b/jjb/integration/distribution/distribution-check-bootup.sh index 6ab50cfb3..a02b91bf5 100644 --- a/jjb/integration/distribution/distribution-check-bootup.sh +++ b/jjb/integration/distribution/distribution-check-bootup.sh @@ -1,15 +1,27 @@ -CONTROLLERMEM="3072m" -ACTUALFEATURES="odl-integration-all" +#!/bin/bash +# do not add integration features in MRI projects +if [[ "$KARAF_PROJECT" == integration ]]; then + if [[ -n "${CONTROLLERFEATURES}" ]]; then + ACTUALFEATURES="odl-integration-all,${CONTROLLERFEATURES}" + else + ACTUALFEATURES="odl-integration-all" + fi +else + ACTUALFEATURES="${CONTROLLERFEATURES}" +fi -if [[ ! -z "${CONTROLLERFEATURES}" ]]; then - ACTUALFEATURES="odl-integration-all,${CONTROLLERFEATURES}" +if [[ "${JOB_NAME}" == *"distribution-sanity"* ]]; then + CONTROLLERMEM="4096m" +else + CONTROLLERMEM="3072m" fi echo "Kill any controller running" +# shellcheck disable=SC2009 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh echo "Clean Existing distribution" -rm -rf ${BUNDLEFOLDER} +rm -rf "${BUNDLEFOLDER}" echo "Fetch the distribution..." if [[ -z "${BUNDLE_PATH}" ]]; then @@ -24,23 +36,28 @@ unzip -q "${BUNDLE}" echo "Configuring the startup features..." FEATURESCONF="${WORKSPACE}/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg" FEATURE_TEST_STRING="features-test" -if [[ "$KARAF_VERSION" == "karaf3" ]]; then - FEATURE_TEST_STRING="features-integration-test" +FEATURE_TEST_VERSION="$BUNDLE_VERSION" +if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then + FEATURE_TEST_VERSION="$(sed -r "s%^([0-9]+)\.([0-9]+)\.0(.*)%0.\1.\2\3%" <<<"$BUNDLE_VERSION")" fi -sed -ie "s%\(featuresRepositories= \|featuresRepositories = \)%featuresRepositories = mvn:org.opendaylight.integration/${FEATURE_TEST_STRING}/${BUNDLE_VERSION}/xml/features,%g" ${FEATURESCONF} +# only replace feature repo in integration/distro, MRI projects need to pull in +# the features they need by themselves +if [[ "$KARAF_PROJECT" == integration ]]; then + sed -ie "s%\(featuresRepositories= \|featuresRepositories = \)%featuresRepositories = mvn:org.opendaylight.integration/${FEATURE_TEST_STRING}/${FEATURE_TEST_VERSION}/xml/features,%g" "${FEATURESCONF}" -if [[ ! -z "${REPO_URL}" ]]; then - # 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 + if [[ -n "${REPO_URL}" ]]; then + # 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 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}" + # Add actual boot features. + # 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}" +fi echo "Configuring the log..." LOGCONF="${WORKSPACE}/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg" @@ -57,17 +74,12 @@ netstat -pnatu if [ "$JDKVERSION" == 'openjdk11' ]; then echo "Preparing for JRE Version 11" - JAVA_HOME="/opt/jdk-11" + JAVA_HOME="/usr/lib/jvm/java-11-openjdk" 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 export JAVA_HOME='/usr/lib/jvm/java-1.8.0' -elif [ "${JDKVERSION}" == 'openjdk7' ]; then - echo "Setting the JRE Version to 7" - # 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.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64/jre/bin/java - export JAVA_HOME='/usr/lib/jvm/java-1.7.0' fi readlink -e "${JAVA_HOME}/bin/java" echo "JDK Version should be overriden by JAVA_HOME" @@ -75,10 +87,10 @@ java -version echo "Redirecting karaf console output to karaf_console.log" export KARAF_REDIRECT="${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log" -mkdir -p ${WORKSPACE}/${BUNDLEFOLDER}/data/log +mkdir -p "${WORKSPACE}/${BUNDLEFOLDER}/data/log" echo "Starting controller..." -${WORKSPACE}/${BUNDLEFOLDER}/bin/start +"${WORKSPACE}/${BUNDLEFOLDER}/bin/start" function dump_log_and_exit { echo "Dumping first 500K bytes of karaf log..." @@ -93,7 +105,7 @@ function dump_log_and_exit { echo "Waiting up to 6 minutes for controller to come up, checking every 5 seconds..." COUNT="0" while true; do - COUNT=$(( ${COUNT} + 5 )) + COUNT=$(( COUNT + 5 )) sleep 5 echo "already waited ${COUNT} seconds..." if grep --quiet 'org.opendaylight.infrautils.*System ready' "${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log"; then @@ -136,11 +148,12 @@ cp "${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log" . cp "${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf_console.log" . echo "Kill controller" +# shellcheck disable=SC2009 ps axf | grep karaf | grep -v grep | awk '{print "kill -9 " $1}' | sh echo "Bug 4628: Detecting misplaced config files" pushd "${WORKSPACE}/${BUNDLEFOLDER}" || exit -XMLS_FOUND="$(echo *.xml)" +XMLS_FOUND="$(echo -- *.xml)" popd || exit if [ "$XMLS_FOUND" != "*.xml" ]; then echo "Bug 4628 confirmed."