X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-start-cluster-run-test.sh;h=4f92934c00ec9d395b96b449034fac9c830b97ce;hb=476a8ee1380ba4f1061ce676469a01da22bc50f0;hp=37cc3e4d004845ad27e4e2ec2fc9ebb2bf869c2d;hpb=41bfa1a933fdaf542feb1a6e27af1b468e536735;p=releng%2Fbuilder.git diff --git a/jjb/integration/include-raw-integration-start-cluster-run-test.sh b/jjb/integration/include-raw-integration-start-cluster-run-test.sh index 37cc3e4d0..4f92934c0 100644 --- a/jjb/integration/include-raw-integration-start-cluster-run-test.sh +++ b/jjb/integration/include-raw-integration-start-cluster-run-test.sh @@ -26,7 +26,7 @@ while true; do elif (( "\$COUNT" > "600" )); then echo Timeout Controller DOWN echo "Dumping Karaf log..." - cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log + head --bytes=1M "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" echo "Listing all open ports on controller system" netstat -natu exit 1 @@ -40,15 +40,15 @@ done echo "Checking OSGi bundles..." sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list' -echo "Listing all open ports on controller system" +echo "Listing all open ports on controller system.." netstat -natu function exit_on_log_file_message { echo "looking for \"\$1\" in log file" - if grep --quiet "\$1" /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then + if grep --quiet "\$1" "/tmp/${BUNDLEFOLDER}/data/log/karaf.log"; then echo ABORTING: found "\$1" echo "Dumping Karaf log..." - cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log + head --bytes=1M "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" exit 1 fi } @@ -73,7 +73,7 @@ echo "Changing the testplan path..." cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt cat testplan.txt -SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' ) +SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '` echo "Generating controller variables..." for i in `seq 1 ${NUM_ODL_SYSTEM}` @@ -97,15 +97,22 @@ TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_IP} ${tools_variables} -v NUM_TOOLS_SYSTEM:${NUM_ -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} -v MININET_USER:${USER} \ -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true -echo "Remove any Karaf log" -rm -f controller?-karaf.log - -echo "Fetching Karaf log" +echo "Killing ODL and fetching Karaf log..." +set +e # We do not want to create red dot just because something went wrong while fetching logs. +for i in `seq 1 ${NUM_ODL_SYSTEM}` +do + CONTROLLERIP=ODL_SYSTEM_${i}_IP + ssh "${!CONTROLLERIP}" head --bytes=1M "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" > "odl${i}_karaf.log" + ssh "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh' +done +sleep 5 for i in `seq 1 ${NUM_ODL_SYSTEM}` do CONTROLLERIP=ODL_SYSTEM_${i}_IP - scp ${!CONTROLLERIP}:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller${i}-karaf.log + ssh "${!CONTROLLERIP}" xz -9ekvv "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" + scp "${!CONTROLLERIP}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log.xz" "odl${i}_karaf.log.xz" done +true # perhaps Jenkins is testing last exit code # vim: ts=4 sw=4 sts=4 et ft=sh :