X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-controller-run-test.sh;h=423420abafcc83088b3528a21f1bd92edd098610;hb=82a320615a6f6db6c62edf9d3cf3188acfeb0354;hp=06cc4542e8912620d722b3760787f613242f9de2;hpb=0b55e3bbd76ebac846187addc0140e7293b78d6c;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 06cc4542e..423420aba 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 @@ -80,28 +78,9 @@ if [ "${ODL_ENABLE_L3_FWD}" == "yes" ]; then fi cat ${CUSTOMPROP} -echo "Configuring the log..." -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} -# 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 -echo "cat ${LOGCONF}" -cat ${LOGCONF} +configure_karaf_log "${KARAF_VERSION}" "${CONTROLLERDEBUGMAP}" -set_java_vars "${JAVA_HOME}" +set_java_vars "${JAVA_HOME}" "${CONTROLLERMEM}" "${MEMCONF}" echo "Listing all open ports on controller system..." netstat -pnatu @@ -173,20 +152,62 @@ if [[ "$USEFEATURESBOOT" != "True" ]]; then feature:list -i fi -echo "Waiting for controller to come up..." -COUNT="0" -while true; do - RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )" - echo \$RESP - if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then - SHARD="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/jolokia/read/org.opendaylight.controller:Category=Shards,name=\member-\$1-shard-inventory-config,type=DistributedConfigDatastore)" - echo \$SHARD +if [ "${DISTROSTREAM}" == "carbon" ] || [ "${DISTROSTREAM}" == "nitrogen" ]; +then + echo "only oxygen and above have the infrautils.ready feature, so using REST API to /modules or /shards to determine if the controller is ready."; + + COUNT="0" + + while true; do + RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )" + echo \$RESP + + if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then + SHARD="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/jolokia/read/org.opendaylight.controller:Category=Shards,name=\member-\$1-shard-inventory-config,type=DistributedConfigDatastore)" + echo \$SHARD + fi + + if ([[ \$RESP == *"200"* ]] && ([[ "${ENABLE_HAPROXY_FOR_NEUTRON}" != "yes" ]] || [[ \$SHARD == *'"status":200'* ]])); then + echo "Controller is UP" + break + + elif (( "\$COUNT" > "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 - if ([[ \$RESP == *"200"* ]] && ([[ "${ENABLE_HAPROXY_FOR_NEUTRON}" != "yes" ]] || [[ \$SHARD == *'"status":200'* ]])); then - echo Controller is UP - break - elif (( "\$COUNT" > "600" )); then - echo Timeout Controller DOWN + done + +else + echo "Waiting up to 3 minutes for controller to come up, checking every 5 seconds..." + for i in {1..36}; + do sleep 5; + grep 'org.opendaylight.infrautils.ready-impl.*System ready' /tmp/${BUNDLEFOLDER}/data/log/karaf.log + if [ \$? -eq 0 ] + then + echo "Controller is UP" + break + fi + 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..." @@ -194,14 +215,8 @@ while true; do 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 +fi echo "Listing all open ports on controller system..." netstat -pnatu @@ -285,9 +300,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 @@ -340,17 +352,37 @@ 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 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 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_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/"