X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-controller-run-test.sh;h=6f43a35e5a1d57aa5650441c3457921030f7a5d9;hb=67c4519e550e8503e105977027ba470a909b812f;hp=b3da33674beb45cbc8bfa469e0394a2fc9162301;hpb=78cfb7cfa1f7ebd40849acec57c549977915f588;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 b3da33674..6f43a35e5 100644 --- a/jjb/integration/integration-deploy-controller-run-test.sh +++ b/jjb/integration/integration-deploy-controller-run-test.sh @@ -16,10 +16,8 @@ fi if [ ${CONTROLLERSCOPE} == 'all' ]; then ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}" export CONTROLLERMEM="3072m" - COOLDOWN_PERIOD="180" else ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}" - COOLDOWN_PERIOD="60" fi # Some versions of jenkins job builder result in feature list containing spaces @@ -32,17 +30,7 @@ echo "ACTUALFEATURES: ${ACTUALFEATURES}" SPACE_SEPARATED_FEATURES=$(echo "${ACTUALFEATURES}" | tr ',' ' ') echo "SPACE_SEPARATED_FEATURES: ${SPACE_SEPARATED_FEATURES}" -if [ -f "${WORKSPACE}/test/csit/scriptplans/${TESTPLAN}" ]; then - echo "scriptplan exists!!!" - echo "Changing the scriptplan path..." - cat ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > scriptplan.txt - cat scriptplan.txt - for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' scriptplan.txt ); do - echo "Executing ${line}..." - # shellcheck source=${line} disable=SC1091 - source ${line} - done -fi +run_plan "script" cat > ${WORKSPACE}/configuration-script.sh < "600" )); then - echo Timeout Controller DOWN - echo "Dumping first 500K bytes of karaf log..." - head --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" - echo "Dumping last 500K bytes of karaf log..." - tail --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" - echo "Listing all open ports on controller system" - netstat -pnatu - exit 1 - else - COUNT=\$(( \${COUNT} + 1 )) - sleep 1 - if [[ \$((\$COUNT % 5)) == 0 ]]; then - echo already waited \${COUNT} seconds... - fi - fi -done +done; + +# if we ended up not finding ready status in the above loop, we can output some debugs +grep 'org.opendaylight.infrautils.ready-impl.*System ready' /tmp/${BUNDLEFOLDER}/data/log/karaf.log +if [ $? -ne 0 ] +then + echo "Timeout Controller DOWN" + echo "Dumping first 500K bytes of karaf log..." + head --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" + echo "Dumping last 500K bytes of karaf log..." + tail --bytes=500K "/tmp/${BUNDLEFOLDER}/data/log/karaf.log" + echo "Listing all open ports on controller system" + netstat -pnatu + exit 1 +fi echo "Listing all open ports on controller system..." netstat -pnatu @@ -227,23 +213,7 @@ do done done -echo "Locating config plan to use..." -configplan_filepath="${WORKSPACE}/test/csit/configplans/${STREAMTESTPLAN}" -if [ ! -f "${configplan_filepath}" ]; then - configplan_filepath="${WORKSPACE}/test/csit/configplans/${TESTPLAN}" -fi - -if [ -f "${configplan_filepath}" ]; then - echo "configplan exists!!!" - echo "Changing the configplan path..." - cat ${configplan_filepath} | sed "s:integration:${WORKSPACE}:" > configplan.txt - cat configplan.txt - for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' configplan.txt ); do - echo "Executing ${line}..." - # shellcheck source=${line} disable=SC1091 - source ${line} - done -fi +run_plan "config" # Copy over the startup script to controller and execute it. for i in `seq 1 ${NUM_ODL_SYSTEM}` @@ -266,9 +236,6 @@ do fi done -echo "Cool down for ${COOLDOWN_PERIOD} seconds :)..." -sleep ${COOLDOWN_PERIOD} - echo "Generating controller variables..." for i in `seq 1 ${NUM_ODL_SYSTEM}` do @@ -278,7 +245,7 @@ do 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 + ssh ${!CONTROLLERIP} "${JAVA_HOME}/bin/jstack -l ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_before.log || true done if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then @@ -321,17 +288,40 @@ else 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 \ --v JAVA_HOME:${JAVA_HOME} -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} -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 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. +pybot -N ${TESTPLAN} \ + --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} \ + -v BUNDLEFOLDER:${BUNDLEFOLDER} \ + -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \ + -v CONTROLLER:${ODL_SYSTEM_IP} \ + -v CONTROLLER_USER:${USER} \ + -v JAVA_HOME:${JAVA_HOME} \ + -v JDKVERSION:${JDKVERSION} \ + -v JENKINS_WORKSPACE:${WORKSPACE} \ + -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:${TOOLS_SYSTEM_IP} \ + -v MININET_USER:${USER} \ + -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \ + -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} \ + -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} \ + -v ODL_STREAM:${DISTROSTREAM} \ + -v ODL_SYSTEM_1_IP:${ODL_SYSTEM_IP} \ + -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \ + -v ODL_SYSTEM_USER:${USER} \ + -v TOOLS_SYSTEM_1_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_IP:${TOOLS_SYSTEM_IP} \ + -v TOOLS_SYSTEM_USER:${USER} \ + -v USER_HOME:${HOME} \ + -v WORKSPACE:/tmp \ + ${TESTOPTIONS} ${SUITES} || true echo "Examining the files in data/log and checking filesize" ssh ${ODL_SYSTEM_IP} "ls -altr /tmp/${BUNDLEFOLDER}/data/log/" @@ -344,7 +334,7 @@ do 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 + ssh ${!CONTROLLERIP} "${JAVA_HOME}/bin/jstack -l ${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'