X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-deploy-controller-run-test.sh;h=ff0d118fbed29c1b1a63baf39d23935284079dbd;hb=a36016126b3773799c549c909e62ecff1a0d0a23;hp=0d47fc60a2cee3e25f7c24fb6081c8edab84b3d1;hpb=b2b18042a298c488839bec7014548a148cb54eeb;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 0d47fc60a..ff0d118fb 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -1,4 +1,9 @@ -export NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org} +#@IgnoreInspection BashAddShebang +# Activate robotframework virtualenv +# ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh +# script. +source ${ROBOT_VENV}/bin/activate + CONTROLLERMEM="2048m" if [ ${CONTROLLERSCOPE} == 'all' ]; then @@ -8,31 +13,6 @@ else ACTUALFEATURES="${CONTROLLERFEATURES}" fi -if [ ${BUNDLEURL} == 'last' ]; then - NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf" - # Extract the BUNDLEVERSION from the pom.xml - export BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null` - echo "Bundle version is ${BUNDLEVERSION}" - # Acquire the timestamp information from maven-metadata.xml - wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml - TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null` - echo "Nexus timestamp is ${TIMESTAMP}" - export BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}" - export BUNDLE="distribution-karaf-${TIMESTAMP}.zip" - export ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}" -else - export ACTUALBUNDLEURL="${BUNDLEURL}" - export BUNDLE="${BUNDLEURL##*/}" - export BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))" - export BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}" -fi - -echo "Distribution bundle URL is ${ACTUALBUNDLEURL}" -echo "Distribution bundle is ${BUNDLE}" -echo "Distribution bundle version is ${BUNDLEVERSION}" -echo "Distribution folder is ${BUNDLEFOLDER}" -echo "Nexus prefix is ${NEXUSURL_PREFIX}" - if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then echo "scriptplan exists!!!" echo "Changing the scriptplan path..." @@ -71,6 +51,9 @@ MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv 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 + echo "Starting controller..." /tmp/${BUNDLEFOLDER}/bin/start @@ -86,6 +69,8 @@ while true; do echo Timeout Controller DOWN echo "Dumping Karaf log..." cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log + echo "Listing all open ports on controller system" + netstat -natu exit 1 else COUNT=\$(( \${COUNT} + 5 )) @@ -100,10 +85,26 @@ sleep 60 echo "Checking OSGi bundles..." sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list' +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 + echo ABORTING: found "\$1" + echo "Dumping Karaf log..." + cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log + exit 1 + fi +} + +exit_on_log_file_message 'BindException: Address already in use' +exit_on_log_file_message 'server is unhealthy' + EOF -scp ${WORKSPACE}/controller-script.sh ${CONTROLLER0}:/tmp -ssh ${CONTROLLER0} 'bash /tmp/controller-script.sh' +scp ${WORKSPACE}/controller-script.sh ${ODL_SYSTEM_IP}:/tmp +ssh ${ODL_SYSTEM_IP} 'bash /tmp/controller-script.sh' echo "Changing the testplan path..." cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt @@ -113,12 +114,15 @@ 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 NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v CONTROLLER:${CONTROLLER0} -v CONTROLLER_USER:${USER} \ --v MININET:${MININET0} -v MININET1:{$MININET1} -v MININET2:${MININET2} -v MININET_USER:${USER} \ +-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} \ +-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_USER:${USER} \ +-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 "Fetching Karaf log" -scp ${CONTROLLER0}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log . +scp ${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log . # vim: ts=4 sw=4 sts=4 et ft=sh :