X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Finclude-raw-integration-start-cluster-run-test.sh;h=37cc3e4d004845ad27e4e2ec2fc9ebb2bf869c2d;hb=727214c2dae3e0cd5933049a6cbb0f34c59e45a8;hp=4f74dc9086b70e9a18d0b914fc9b721a8bf14433;hpb=6b812c1a38b56101b15babe2efc8b877b54cdca9;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 4f74dc908..37cc3e4d0 100644 --- a/jjb/integration/include-raw-integration-start-cluster-run-test.sh +++ b/jjb/integration/include-raw-integration-start-cluster-run-test.sh @@ -1,3 +1,4 @@ +#@IgnoreInspection BashAddShebang # Activate robotframework virtualenv # ${ROBOT_VENV} comes from the include-raw-integration-install-robotframework.sh # script. @@ -42,22 +43,27 @@ sshpass -p karaf /tmp/${BUNDLEFOLDER}/bin/client -u karaf 'bundle:list' echo "Listing all open ports on controller system" netstat -natu -# checking for any bind exceptions in log which could indicate a port conflict -if grep --quiet 'BindException: Address already in use' /tmp/${BUNDLEFOLDER}/data/log/karaf.log; then - echo BindException found: Possible port conflict - echo "Dumping Karaf log..." - cat /tmp/${BUNDLEFOLDER}/data/log/karaf.log - exit 1 -fi +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 -ODL_SYSTEM_IPS=(${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP}) -for i in "${!ODL_SYSTEM_IPS[@]}" +for i in `seq 1 ${NUM_ODL_SYSTEM}` do - echo "Verifying member-$((i+1)) with IP address ${ODL_SYSTEM_IPS[$i]} is UP" - scp ${WORKSPACE}/verify-cluster-is-up.sh ${ODL_SYSTEM_IPS[$i]}:/tmp - ssh ${ODL_SYSTEM_IPS[$i]} "bash /tmp/verify-cluster-is-up.sh $((i+1)) ${ODL_SYSTEM_IPS[$i]}" + CONTROLLERIP=ODL_SYSTEM_${i}_IP + echo "Verifying member-${i} with IP address ${!CONTROLLERIP} is UP" + scp ${WORKSPACE}/verify-cluster-is-up.sh ${!CONTROLLERIP}:/tmp + ssh ${!CONTROLLERIP} "bash /tmp/verify-cluster-is-up.sh ${i} ${!CONTROLLERIP}" done echo "Cool down for 1 min :)..." @@ -69,20 +75,37 @@ cat testplan.txt SUITES=$( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' ' ) +echo "Generating controller variables..." +for i in `seq 1 ${NUM_ODL_SYSTEM}` +do + CONTROLLERIP=ODL_SYSTEM_${i}_IP + odl_variables=${odl_variables}" -v ${CONTROLLERIP}:${!CONTROLLERIP}" +done + +echo "Generating mininet variables..." +for i in `seq 1 ${NUM_TOOLS_SYSTEM}` +do + MININETIP=TOOLS_SYSTEM_${i}_IP + tools_variables=${tools_variables}" -v ${MININETIP}:${!MININETIP}" +done + 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:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} \ --v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} -v ODL_SYSTEM_2_IP:${ODL_SYSTEM_2_IP} \ --v ODL_SYSTEM_3_IP:${ODL_SYSTEM_3_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} \ +pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \ +-v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \ +${odl_variables} -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} -v \ +TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_IP} ${tools_variables} -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} -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 "Remove any Karaf log" +rm -f controller?-karaf.log + echo "Fetching Karaf log" -scp $ODL_SYSTEM_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller0-karaf.log -scp $ODL_SYSTEM_2_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller1-karaf.log -scp $ODL_SYSTEM_3_IP:/tmp/$BUNDLEFOLDER/data/log/karaf.log controller2-karaf.log +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 +done # vim: ts=4 sw=4 sts=4 et ft=sh :