X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-openstack-run-test.sh;h=f2fef4655e30b6d0ec15701eda3b965b31727e3b;hb=417035461954a2a53ae3c2c3037042cc92592f75;hp=94c94c44d412a44bf447c4f9496099300d63eaa2;hpb=a76d4739fab486aeeb9903f24a946dc0b4d0104c;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-deploy-openstack-run-test.sh b/jjb/integration/integration-deploy-openstack-run-test.sh index 94c94c44d..f2fef4655 100644 --- a/jjb/integration/integration-deploy-openstack-run-test.sh +++ b/jjb/integration/integration-deploy-openstack-run-test.sh @@ -1,4 +1,4 @@ -#@IgnoreInspection BashAddShebang +#!/bin/bash # Activate robotframework virtualenv # ${ROBOT_VENV} comes from the integration-install-robotframework.sh # script. @@ -143,7 +143,6 @@ USE_SCREEN=True SCREEN_LOGDIR=/opt/stack/data/log LOG_COLOR=False RECLONE=${RECLONE} -CELLSV2_SETUP=singleconductor disable_all_services EOF @@ -288,7 +287,6 @@ LOG_COLOR=False USE_SCREEN=True SCREEN_LOGDIR=/opt/stack/data/log RECLONE=${RECLONE} -CELLSV2_SETUP=singleconductor disable_all_services EOF @@ -477,29 +475,37 @@ echo -e "\nenv after openrc\n" env EOF + # Since this log collection work is happening before the archive build macro which also + # creates the ${WORKSPACE}/archives dir, we have to do it here first. The mkdir in the + # archives build step will essentially be a noop. + mkdir -p ${WORKSPACE}/archives + sleep 5 # FIXME: Do not create .tar and gzip before copying. for i in `seq 1 ${NUM_ODL_SYSTEM}`; do CONTROLLERIP=ODL_SYSTEM_${i}_IP - ${SSH} "${!CONTROLLERIP}" "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log" - ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*" - scp "${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar" "${WORKSPACE}/odl${i}_karaf.log.tar" - ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log" - scp "${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar" "${WORKSPACE}/odl${i}_zrpcd.log.tar" - tar -xvf ${WORKSPACE}/odl${i}_karaf.log.tar -C . --strip-components 2 --transform s/karaf/odl${i}_karaf/g - grep "ROBOT MESSAGE\| ERROR " odl${i}_karaf.log > odl${i}_err.log - # Print ROBOT lines, Print Caused by...Exception: lines, - # Print Exception{ lines as well as the previous line that has the timestamp for context - sed -n -e '/ROBOT MESSAGE/P' -e '/Caused by.*Exception:/P' -e '$!N;/Exception:/P;D' -e '$!N;/Exception{/P;D' odl${i}_karaf.log > odl${i}_exception.log - grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" odl${i}_karaf.log > odl${i}_err_warn_exception.log - rm ${WORKSPACE}/odl${i}_karaf.log.tar + NODE_FOLDER="odl_${i}" + mkdir -p ${NODE_FOLDER} + ${SSH} ${!CONTROLLERIP} "journalctl > /tmp/journalctl.log" + scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER} + ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log" + scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER} + ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log" + ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*" + scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER} + ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log" + scp ${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar ${NODE_FOLDER} + tar -xvf ${NODE_FOLDER}/odl${i}_karaf.log.tar -C ${NODE_FOLDER} --strip-components 2 --transform s/karaf/odl${i}_karaf/g + grep "ROBOT MESSAGE\| ERROR " ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err.log + grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" \ + ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err_warn_exception.log + # Print ROBOT lines and print Exception lines. For exception lines also print the previous line for context + sed -n -e '/ROBOT MESSAGE/P' -e '$!N;/Exception/P;D' ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_exception.log + rm ${NODE_FOLDER}/odl${i}_karaf.log.tar + mv karaf_${i}_threads* ${NODE_FOLDER} + mv ${NODE_FOLDER} ${WORKSPACE}/archives/ done - # Since this log collection work is happening before the archive build macro which also - # creates the ${WORKSPACE}/archives dir, we have to do it here first. The mkdir in the - # archives build step will essentially be a noop. - mkdir -p ${WORKSPACE}/archives - print_job_parameters > ${WORKSPACE}/archives/params.txt # Control Node @@ -529,16 +535,17 @@ EOF scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER} scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER} scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER} - scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER} scp ${!OSIP}:/var/log/httpd/keystone_access.log ${NODE_FOLDER} scp ${!OSIP}:/var/log/httpd/keystone.log ${NODE_FOLDER} + scp ${!OSIP}:/var/log/openvswitch/ovs-vswitchd.log ${NODE_FOLDER} + scp ${!OSIP}:/var/log/openvswitch/ovsdb-server.log ${NODE_FOLDER} list_files "${!OSIP}" "${NODE_FOLDER}" rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/etc/hosts ${NODE_FOLDER} rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/usr/lib/systemd/system/haproxy.service ${NODE_FOLDER} rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/audit/audit.log ${NODE_FOLDER} rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/dmesg.log ${NODE_FOLDER} rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER} + rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/rabbitmq ${NODE_FOLDER} rsync -avhe ssh ${!OSIP}:/opt/stack/logs/* ${NODE_FOLDER} # rsync to prevent copying of symbolic links scp extra_debug.sh ${!OSIP}:/tmp ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log" @@ -668,6 +675,43 @@ function get_service () { set -e } +# Check if rabbitmq is ready by looking for a pid in it's status. +# The function returns the status of the grep command which callers can check. +function is_rabbitmq_ready() { + local -r ip=$1 + rm -f rabbit.txt + ${SSH} ${ip} "sudo rabbitmqctl status" > rabbit.txt + grep pid rabbit.txt +} + +# retry the given command ($3) until success for a number of iterations ($1) +# sleeping ($2) between tries. +function retry() { + set +e + local -r -i max_tries=${1} + local -r -i sleep_time=${2} + local -r cmd=${3} + local -i retries=1 + local -i rc=1 + while true; do + echo "retry ${cmd}: attempt: ${retries}" + ${cmd} + rc=$? + if ((${rc} == 0)); then + break; + else + if ((${retries} == ${max_tries})); then + break + else + ((retries++)) + sleep ${sleep_time} + fi + fi + done + set -e + return ${rc} +} + # if we are using the new netvirt impl, as determined by the feature name # odl-netvirt-openstack (note: old impl is odl-ovsdb-openstack) then we # want PROVIDER_MAPPINGS to be used -- this should be fixed if we want to support @@ -820,11 +864,22 @@ done # compute exits and does not attempt to restart. # 180s is chosen because in test runs the control node usually finished in 17-20 minutes and the computes finished # in 17 minutes, so take the max difference of 3 minutes and the jobs should still finish around the same time. -# This is the error seen in the compute n-cpu.log: +# one of the following errors is seen in the compute n-cpu.log: # Unhandled error: NotAllowed: Connection.open: (530) NOT_ALLOWED - access to vhost 'nova_cell1' refused for user 'stackrabbit' -# Compare that to this log in the control stack.log: sudo rabbitmqctl set_permissions -p nova_cell1 stackrabbit -# echo "Sleeping for 180s to allow controller to create nova_cell1 before the computes need it" -# sleep 180 +# AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile. +# Compare that timestamp to this log in the control stack.log: sudo rabbitmqctl set_permissions -p nova_cell1 stackrabbit +# If the n-cpu.log is earlier than the control stack.log timestamp then the failure condition is likely hit. + +echo "Wait a maximum of 30m until rabbitmq is ready to allow the controller to create nova_cell1 before the computes need it" +retry 30 60 "is_rabbitmq_ready ${OPENSTACK_CONTROL_NODE_1_IP}" +rc=$? +if ((${rc} == 0)); then + echo "rabbitmq is ready, starting ${NUM_OPENSTACK_COMPUTE_NODES} compute(s)" +else + echo "rabbitmq was not ready in " + collect_logs + exit 1 +fi for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do NUM_COMPUTES_PER_SITE=$((NUM_OPENSTACK_COMPUTE_NODES / NUM_OPENSTACK_SITES)) @@ -1026,6 +1081,10 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do sudo ip netns exec pnf_ns ifconfig pnf_veth1 up ${EXTNET_PNF_IP}/24; sudo ovs-vsctl add-port ${PUBLIC_BRIDGE} pnf_veth0; " + # Control Node - set VXLAN TEP IP for Genius Auto TZ + ${SSH} ${!CONTROLIP} " + sudo ovs-vsctl set O . external_ids:tep-ip=${!CONTROLIP}; + " # Control Node - external net internet address simulation ${SSH} ${!CONTROLIP} " @@ -1046,6 +1105,10 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do ${SSH} $compute_ip " sudo ovs-vsctl add-port $PUBLIC_BRIDGE $CONTROLPORT -- set interface $CONTROLPORT type=vxlan options:local_ip=$compute_ip options:remote_ip=${!CONTROLIP} options:dst_port=9876 options:key=flow " + #Compute Node - set VXLAN TEP IP for Genius Auto TZ + ${SSH} $compute_ip " + sudo ovs-vsctl set O . external_ids:tep-ip=${compute_ip}; + " done done @@ -1077,6 +1140,18 @@ cat testplan.txt # Use the testplan if specific SUITES are not defined. if [ -z "${SUITES}" ]; then SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '` +else + newsuites="" + workpath="${WORKSPACE}/test/csit/suites" + for suite in ${SUITES}; do + fullsuite="${workpath}/${suite}" + if [ -z ${newsuites} ]; then + newsuites+=${fullsuite} + else + newsuites+=" "${fullsuite} + fi + done + SUITES=${newsuites} fi # TODO: run openrc on control node and then scrape the vars from it @@ -1098,7 +1173,16 @@ source /tmp/os_netvirt_client_rc echo "Starting Robot test suites ${SUITES} ..." # please add pybot -v arguments on a single line and alphabetized -pybot -N ${TESTPLAN} --removekeywords wuks --flattenkeywords for -c critical -e exclude -e skip_if_${DISTROSTREAM} \ +suite_num=0 +for suite in ${SUITES}; do + # prepend a incrmental counter to the suite name so that the full robot log combining all the suites as is done + # in the rebot step below will list all the suites in chronological order as rebot seems to alphabatize them + let "suite_num = suite_num + 1" + suite_index="$(printf %02d ${suite_num})" + suite_name="$(basename ${suite} | cut -d. -f1)" + log_name="${suite_index}_${suite_name}" + pybot -N ${log_name} --removekeywords wuks -c critical -e exclude -e skip_if_${DISTROSTREAM} \ + --log log_${log_name}.html --report None --output output_${log_name}.xml \ -v BUNDLEFOLDER:${BUNDLEFOLDER} \ -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \ -v CONTROLLER_USER:${USER} \ @@ -1144,7 +1228,10 @@ pybot -N ${TESTPLAN} --removekeywords wuks --flattenkeywords for -c critical -e -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} \ -v USER_HOME:${HOME} \ -v WORKSPACE:/tmp \ - ${TESTOPTIONS} ${SUITES} || true + ${TESTOPTIONS} ${suite} || true +done +#rebot exit codes seem to be different +rebot --output ${WORKSPACE}/output.xml --log log_full.html --report None -N openstack output_*.xml || true echo "Examining the files in data/log and checking file size" ssh ${ODL_SYSTEM_IP} "ls -altr /tmp/${BUNDLEFOLDER}/data/log/"