X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-controller-run-test.sh;h=c6beeed410da498e9cccb2a5dc1db1b0ee6ab7fd;hb=refs%2Fchanges%2F45%2F67545%2F1;hp=7e3a7beb6b3ae297e445d39a50d4bfea3a5f3636;hpb=9cee01662b07b3401361822a23dd67ff0f1373d1;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-deploy-controller-run-test.sh b/jjb/integration/integration-deploy-controller-run-test.sh index 7e3a7beb6..c6beeed41 100644 --- a/jjb/integration/integration-deploy-controller-run-test.sh +++ b/jjb/integration/integration-deploy-controller-run-test.sh @@ -5,7 +5,6 @@ # shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091 source ${ROBOT_VENV}/bin/activate -CONTROLLERMEM="2048m" if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then echo "Configure cluster" @@ -16,16 +15,22 @@ fi if [ ${CONTROLLERSCOPE} == 'all' ]; then ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}" - CONTROLLERMEM="3072m" + export CONTROLLERMEM="3072m" COOLDOWN_PERIOD="180" else - ACTUALFEATURES="${CONTROLLERFEATURES}" + ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}" COOLDOWN_PERIOD="60" fi # Some versions of jenkins job builder result in feature list containing spaces # and ending in newline. Remove all that. ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'` +echo "ACTUALFEATURES: ${ACTUALFEATURES}" + +# In the case that we want to install features via karaf shell, a space separated list of +# ACTUALFEATURES IS NEEDED +SPACE_SEPARATED_FEATURES=$(echo "${ACTUALFEATURES}" | tr ',' ' ') +echo "SPACE_SEPARATED_FEATURES: ${SPACE_SEPARATED_FEATURES}" if [ -f "${WORKSPACE}/test/csit/scriptplans/${TESTPLAN}" ]; then echo "scriptplan exists!!!" @@ -50,48 +55,54 @@ wget --progress=dot:mega '${ACTUAL_BUNDLE_URL}' echo "Extracting the new controller..." unzip -q ${BUNDLE} -echo "Configuring the startup features..." -FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg -CUSTOMPROP=/tmp/${BUNDLEFOLDER}/etc/custom.properties -sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" \${FEATURESCONF} -sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,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 "Adding external repositories..." +sed -ie "s%org.ops4j.pax.url.mvn.repositories=%org.ops4j.pax.url.mvn.repositories=http://repo1.maven.org/maven2@id=central, http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, http://zodiac.springsource.com/maven/bundles/release@id=gemini, http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases%g" ${MAVENCONF} +cat ${MAVENCONF} + +if [[ "$USEFEATURESBOOT" == "True" ]]; then + echo "Configuring the startup features..." + sed -ie "s/\(featuresBoot=\|featuresBoot =\)/featuresBoot = ${ACTUALFEATURES},/g" ${FEATURESCONF} +fi + +FEATURE_TEST_STRING="features-integration-test" +if [[ "$KARAF_VERSION" == "karaf4" ]]; then + FEATURE_TEST_STRING="features-test" +fi + +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..." - echo "ovsdb.l3.fwd.enabled=yes" >> \${CUSTOMPROP} + echo "ovsdb.l3.fwd.enabled=yes" >> ${CUSTOMPROP} fi -cat \${CUSTOMPROP} +cat ${CUSTOMPROP} echo "Configuring the log..." -LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg -sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF} +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} -echo "log4j.logger.org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver = WARN" >> \${LOGCONF} -cat \${LOGCONF} +sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=30GB/g' ${LOGCONF} +echo "log4j.logger.org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver = WARN" >> ${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 +fi +cat ${LOGCONF} -echo "Configure java home and max memory..." -MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv -sed -ie 's%^# export JAVA_HOME%export JAVA_HOME="\${JAVA_HOME:-${JAVA_HOME}}"%g' \${MEMCONF} -sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF} -cat \${MEMCONF} +set_java_vars echo "Listing all open ports on controller system..." netstat -pnatu -echo "Set Java version" -sudo /usr/sbin/alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 1 -sudo /usr/sbin/alternatives --set java ${JAVA_HOME}/bin/java -echo "JDK default version..." -java -version - -echo "Set JAVA_HOME" -export JAVA_HOME="${JAVA_HOME}" -# Did you know that in HERE documents, single quote is an ordinary character, but backticks are still executing? -JAVA_RESOLVED=\`readlink -e "\${JAVA_HOME}/bin/java"\` -echo "Java binary pointed at by JAVA_HOME: \${JAVA_RESOLVED}" - if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then # Copy shard file if exists @@ -121,6 +132,7 @@ cat > ${WORKSPACE}/startup-script.sh < ${WORKSPACE}/post-startup-script.sh < ${WORKSPACE}/karaf_${i}_threads_before.log || true + ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_before.log + pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_before.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') + echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" + ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_before.log || true done if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then @@ -274,7 +315,23 @@ fi echo "Changing the testplan path..." cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt cat testplan.txt -SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' ) + +# Use the testplan if specific SUITES are not defined. +if [ -z "${SUITES}" ]; then + SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '` +else + newsuites="" + workpath="${WORKSPACE}/test/csit/suites" + for suite in ${SUITES}; do + fullsuite="${workpath}/${suite}" + if [ -z "${newsuites}" ]; then + newsuites+=${fullsuite} + else + newsuites+=" "${fullsuite} + fi + done + SUITES=${newsuites} +fi echo "Starting Robot test suites ${SUITES} ..." pybot -N ${TESTPLAN} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \ @@ -297,8 +354,10 @@ for i in `seq 1 ${NUM_ODL_SYSTEM}` do CONTROLLERIP=ODL_SYSTEM_${i}_IP echo "Lets's take the karaf thread dump again..." - KARAF_PID=$(ssh ${!CONTROLLERIP} "ps aux | grep ${KARAF_ARTIFACT} | grep -v grep | tr -s ' ' | cut -f2 -d' '") - ssh ${!CONTROLLERIP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_${i}_threads_after.log || true + ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_after.log + pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_after.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') + echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" + ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_after.log || true echo "Killing ODL" set +e # We do not want to create red dot just because something went wrong while fetching logs. ssh "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'