X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-deploy-controller-run-test.sh;h=d99bc93a732a57bef92e6d991242729e1100301f;hb=f571cb39b33e760f2267691cf97d792d36848882;hp=1eb50f14df939996e7b05cc8524220c30130c751;hpb=f74851aa75dfa2922cedff57a1b75e80cf319403;p=releng%2Fbuilder.git diff --git a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh index 1eb50f14d..d99bc93a7 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -29,55 +29,64 @@ if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then done fi -cat > ${WORKSPACE}/controller-script.sh < ${WORKSPACE}/configuration-script.sh <> \${CUSTOMPROP} +fi +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} # FIXME: Make log size limit configurable from build parameter. -sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF} +sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=30GB/g' \${LOGCONF} cat \${LOGCONF} -echo "Configure max memory..." +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} echo "Listing all open ports on controller system..." -netstat -natu - -if [ ${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 -echo "JAVA_HOME is \${JAVA_HOME}" +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}" -echo "JDK default version ..." -java -version + +EOF + +# Create the startup script to be run on controller. +cat > ${WORKSPACE}/startup-script.sh < configplan.txt + cat configplan.txt + for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' configplan.txt ); do + echo "Executing ${line}..." + source ${line} + done +fi + +# Copy over the startup script to controller and execute it. +scp ${WORKSPACE}/startup-script.sh ${ODL_SYSTEM_IP}:/tmp +ssh ${ODL_SYSTEM_IP} 'bash /tmp/startup-script.sh' + +if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then + echo "Exiting without running tests to deploy openstack for testing" + exit +fi + +echo "Lets's take the karaf thread dump" +KARAF_PID=$(ssh ${ODL_SYSTEM_IP} "ps aux | grep 'distribution-karaf' | grep -v grep | tr -s ' ' | cut -f2 -d' '") +ssh ${ODL_SYSTEM_IP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_threads_before.log || true echo "Locating test plan to use..." testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}" @@ -141,29 +176,35 @@ 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' ' ' ) echo "Starting Robot test suites ${SUITES} ..." -pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \ --v BUNDLE_URL:${ACTUALBUNDLEURL} -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \ --v CONTROLLER:${ODL_SYSTEM_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} \ +pybot -N ${TESTPLAN} --removekeywords wuks -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp \ +-v JAVA_HOME:${JAVA_HOME} -v BUNDLE_URL:${ACTUALBUNDLEURL} -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \ +-v CONTROLLER:${ODL_SYSTEM_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_IP} \ +-v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} \ -v TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_IP} -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} -v TOOLS_SYSTEM_3_IP:${TOOLS_SYSTEM_3_IP} \ -v TOOLS_SYSTEM_4_IP:${TOOLS_SYSTEM_4_IP} -v TOOLS_SYSTEM_5_IP:${TOOLS_SYSTEM_5_IP} -v TOOLS_SYSTEM_6_IP:${TOOLS_SYSTEM_6_IP} \ --v TOOLS_SYSTEM_USER:${USER} -v JDKVERSION:${JDKVERSION} -v ODL_STREAM:${DISTROSTREAM} \ +-v TOOLS_SYSTEM_USER:${USER} -v JDKVERSION:${JDKVERSION} -v ODL_STREAM:${DISTROSTREAM} -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} \ -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} \ -v MININET3:${TOOLS_SYSTEM_4_IP} -v MININET4:${TOOLS_SYSTEM_5_IP} -v MININET5:${TOOLS_SYSTEM_6_IP} \ -v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true # FIXME: Sort (at least -v) options alphabetically. -echo "Killing ODL and fetching Karaf log..." +echo "Lets's take the karaf thread dump again" +KARAF_PID=$(ssh ${ODL_SYSTEM_IP} "ps aux | grep 'distribution-karaf' | grep -v grep | tr -s ' ' | cut -f2 -d' '") +ssh ${ODL_SYSTEM_IP} "jstack $KARAF_PID"> ${WORKSPACE}/karaf_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 "${ODL_SYSTEM_IP}" tail --bytes=1M "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" > "karaf.log" ssh "${ODL_SYSTEM_IP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh' sleep 5 -ssh "${ODL_SYSTEM_IP}" xz -9ekvv "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" -scp "${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log.xz" . +echo "Compressing karaf.log" +ssh ${ODL_SYSTEM_IP} gzip --best "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" +echo "Fetching compressed karaf.log" +scp "${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log.gz" . +# TODO: Should we compress the output log file as well? +scp "${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/data/log/karaf_console.log" . true # perhaps Jenkins is testing last exit code # vim: ts=4 sw=4 sts=4 et ft=sh : -