X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-openstack-run-test.sh;h=d413310a92be2adef584261d91668d2d73b2aca2;hb=f618ffefcc5a3904f0fdcc2db3bcb88323bcd425;hp=58e17ec98b8ec4923e1a4acfd6b38d50604638b7;hpb=242a9940a327c3da608daec524c96866ed17186d;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 58e17ec98..d413310a9 100644 --- a/jjb/integration/integration-deploy-openstack-run-test.sh +++ b/jjb/integration/integration-deploy-openstack-run-test.sh @@ -6,7 +6,8 @@ source ${ROBOT_VENV}/bin/activate PYTHON="${ROBOT_VENV}/bin/python" SSH="ssh -t -t" -ADMIN_PASSWORD=admin +ADMIN_PASSWORD="admin" +OPENSTACK_MASTER_CLIENTS_VERSION="pike" # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level echo "showing recent changes that made it in to the distribution used by this job" @@ -98,6 +99,38 @@ function create_etc_hosts() { cat ${WORKSPACE}/hosts_file } # create_etc_hosts() +#function to install Openstack Clients for Testing +#This will pull the latest versions compatiable with the +# openstack release +function install_openstack_clients_in_robot_vm() { + packages=("python-novaclient" "python-neutronclient" "python-openstackclient") + for plugin_name in ${ENABLE_OS_PLUGINS}; do + if [ "$plugin_name" == "networking-sfc" ]; then + packages+=("networking-sfc") + fi + done + openstack_version=$(echo ${OPENSTACK_BRANCH} | cut -d/ -f2) + #If the job tests "master", we will use the clients from previous released stable version to avoid failures + if [ "${openstack_version}" == "master" ]; then + openstack_version=${OPENSTACK_MASTER_CLIENTS_VERSION} + fi + for package in ${packages[*]}; do + echo "Get the current support version of the package ${package}" + wget https://raw.githubusercontent.com/openstack/requirements/stable/${openstack_version}/upper-constraints.txt -O /tmp/constraints.txt 2>/dev/null + echo "$PYTHON -m pip install --upgrade --no-deps ${package} --no-cache-dir -c /tmp/constraints.txt" + $PYTHON -m pip install --upgrade --no-deps ${package} --no-cache-dir -c /tmp/constraints.txt + echo "$PYTHON -m pip install ${package} --no-cache-dir -c /tmp/constraints.txt" + $PYTHON -m pip install ${package} --no-cache-dir -c /tmp/constraints.txt + done + + if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then + #networking-l2gw is not officially available in any release yet. Gettting the latest stable version. + $PYTHON -m pip install networking-l2gw + fi +} + + + # convert commas in csv strings to spaces (ssv) function csv2ssv() { local csv=$1 @@ -158,7 +191,7 @@ NEUTRON_CREATE_INITIAL_NETWORKS=${CREATE_INITIAL_NETWORKS} ODL_MODE=manual ODL_MGR_IP=${MGRIP} -ODL_PORT=8080 +ODL_PORT=${ODL_PORT} ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING} ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS} @@ -252,10 +285,6 @@ minimize_polling=True physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1400 path_mtu = 1458 -# workaround for port-status not working due to https://bugs.opendaylight.org/show_bug.cgi?id=9092 -[ml2_odl] -odl_features=nothing - [[post-config|/etc/neutron/dhcp_agent.ini]] [DEFAULT] force_metadata = True @@ -264,6 +293,7 @@ enable_isolated_metadata = True [[post-config|/etc/nova/nova.conf]] [DEFAULT] force_config_drive = False +force_raw_images = False [scheduler] discover_hosts_in_cells_interval = 30 @@ -301,7 +331,7 @@ Q_ML2_TENANT_NETWORK_TYPE=${TENANT_NETWORK_TYPE} ODL_MODE=manual ODL_MGR_IP=${MGRIP} -ODL_PORT=8080 +ODL_PORT=${ODL_PORT} ODL_PORT_BINDING_CONTROLLER=${ODL_ML2_PORT_BINDING} ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS} @@ -344,6 +374,7 @@ EOF auth_strategy = keystone [DEFAULT] use_neutron = True +force_raw_images = False EOF echo "Compute local.conf created:" @@ -352,6 +383,7 @@ EOF function configure_haproxy_for_neutron_requests() { MGRIP=$1 + # shellcheck disable=SC2206 ODL_IPS=(${2//,/ }) cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF @@ -452,15 +484,11 @@ function collect_logs () { echo -e "/usr/sbin/lsmod | /usr/bin/grep openvswitch\n" /usr/sbin/lsmod | /usr/bin/grep openvswitch echo -e "\ngrep ct_ /var/log/openvswitch/ovs-vswitchd.log\n" -grep ct_ /var/log/openvswitch/ovs-vswitchd.log -echo -e "\novsdb-tool -mm show-log\n" -ovsdb-tool -mm show-log +grep "Datapath supports" /var/log/openvswitch/ovs-vswitchd.log echo -e "\nsudo netstat -punta\n" sudo netstat -punta echo -e "\nsudo getenforce\n" sudo getenforce -echo -e "\njournalctl > /tmp/journalctl.log\n" -sudo journalctl > /tmp/journalctl.log echo -e "\nsudo systemctl status httpd\n" sudo systemctl status httpd echo -e "\nenv\n" @@ -468,10 +496,16 @@ env source /opt/stack/devstack/openrc admin admin echo -e "\nenv after openrc\n" env -echo "\nsudo du -hs /opt/stack" +echo -e "\nsudo du -hs /opt/stack" sudo du -hs /opt/stack -echo "\nsudo mount" +echo -e "\nsudo mount" sudo mount +echo -e "\ndmesg -T > /tmp/dmesg.log" +dmesg -T > /tmp/dmesg.log +echo -e "\njournalctl > /tmp/journalctl.log\n" +sudo journalctl > /tmp/journalctl.log +echo -e "\novsdb-tool -mm show-log > /tmp/ovsdb-tool.log" +ovsdb-tool -mm show-log > /tmp/ovsdb-tool.log EOF # Since this log collection work is happening before the archive build macro which also @@ -479,6 +513,8 @@ EOF # archives build step will essentially be a noop. mkdir -p ${WORKSPACE}/archives + mv /tmp/changes.txt ${WORKSPACE}/archives + sleep 5 # FIXME: Do not create .tar and gzip before copying. for i in `seq 1 ${NUM_ODL_SYSTEM}`; do @@ -522,6 +558,8 @@ EOF echo "collect_logs: for openstack control node ip: ${!OSIP}" NODE_FOLDER="control_${i}" mkdir -p ${NODE_FOLDER} + scp extra_debug.sh ${!OSIP}:/tmp + ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log" scp ${!OSIP}:/etc/dnsmasq.conf ${NODE_FOLDER} scp ${!OSIP}:/etc/keystone/keystone.conf ${NODE_FOLDER} scp ${!OSIP}:/etc/keystone/keystone-uwsgi-admin.ini ${NODE_FOLDER} @@ -544,7 +582,12 @@ EOF scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER} scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER} scp ${!OSIP}:/opt/stack/tempest/etc/tempest.conf ${NODE_FOLDER} + scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER} + scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER} + scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER} + scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} + scp ${!OSIP}:/tmp/ovsdb-tool.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}" @@ -556,14 +599,8 @@ EOF 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" - scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER} - ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log" - scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER} mv local.conf_control_${!OSIP} ${NODE_FOLDER}/local.conf + # qdhcp files are created by robot tests mv /tmp/qdhcp ${NODE_FOLDER} mv ${NODE_FOLDER} ${WORKSPACE}/archives/ done @@ -574,6 +611,8 @@ EOF echo "collect_logs: for openstack compute node ip: ${!OSIP}" NODE_FOLDER="compute_${i}" mkdir -p ${NODE_FOLDER} + scp extra_debug.sh ${!OSIP}:/tmp + ${SSH} ${!OSIP} "bash /tmp/extra_debug.sh > /tmp/extra_debug.log" scp ${!OSIP}:/etc/nova/nova.conf ${NODE_FOLDER} scp ${!OSIP}:/etc/nova/nova-cpu.conf ${NODE_FOLDER} scp ${!OSIP}:/etc/openstack/clouds.yaml ${NODE_FOLDER} @@ -581,7 +620,12 @@ EOF scp ${!OSIP}:/opt/stack/devstack/nohup.out ${NODE_FOLDER}/stack.log scp ${!OSIP}:/opt/stack/devstack/openrc ${NODE_FOLDER} scp ${!OSIP}:/opt/stack/requirements/upper-constraints.txt ${NODE_FOLDER} + scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/ + scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER} + scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} scp ${!OSIP}:/tmp/get_devstack.sh.txt ${NODE_FOLDER} + scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} + scp ${!OSIP}:/tmp/ovsdb-tool.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}" @@ -591,13 +635,6 @@ EOF rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/messages ${NODE_FOLDER} rsync --rsync-path="sudo rsync" -avhe ssh ${!OSIP}:/var/log/nova-agent.log ${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" - scp ${!OSIP}:/tmp/extra_debug.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/journalctl.log ${NODE_FOLDER} - scp ${!OSIP}:/tmp/*.xz ${NODE_FOLDER}/ - ${SSH} ${!OSIP} "dmesg -T > /tmp/dmesg.log" - scp ${!OSIP}:/tmp/dmesg.log ${NODE_FOLDER} mv local.conf_compute_${!OSIP} ${NODE_FOLDER}/local.conf mv ${NODE_FOLDER} ${WORKSPACE}/archives/ done @@ -746,6 +783,7 @@ else fi RECLONE=False +ODL_PORT=8181 # Always compare the lists below against the devstack upstream ENABLED_SERVICES in # https://github.com/openstack-dev/devstack/blob/master/stackrc#L52 @@ -813,6 +851,10 @@ echo "workaround: adjust wait from 60s to 1800s (30m)" sed -i 's/wait_for_compute 60/wait_for_compute 1800/g' /opt/stack/devstack/lib/nova # TODO: modify sleep 1 to sleep 60, search wait_for_compute, then first sleep 1 # that would just reduce the number of logs in the compute stack.log + +#Install qemu-img command in Control Node for Pike +echo "Install qemu-img application" +sudo yum install -y qemu-img EOF cat > "${WORKSPACE}/setup_host_cell_mapping.sh" << EOF @@ -852,7 +894,7 @@ done for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do CONTROLIP=OPENSTACK_CONTROL_NODE_${i}_IP - echo "Configure the stack of the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}" + echo "Configure the stack of the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${!CONTROLIP}" scp ${WORKSPACE}/disable_firewall.sh ${!CONTROLIP}:/tmp ${SSH} ${!CONTROLIP} "sudo bash /tmp/disable_firewall.sh" create_etc_hosts ${!CONTROLIP} @@ -865,7 +907,7 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &" ssh ${!CONTROLIP} "ps -ef | grep stack.sh" ssh ${!CONTROLIP} "ls -lrt /opt/stack/devstack/nohup.out" - os_node_list+=(${!CONTROLIP}) + os_node_list+=("${!CONTROLIP}") # Workaround for stable/newton jobs # TODO: can this be removed now? if [ "${ODL_ML2_BRANCH}" == "stable/newton" ]; then @@ -902,7 +944,7 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do SITE_INDEX=$((((i - 1) / NUM_COMPUTES_PER_SITE) + 1)) # We need the site index to infer the control node IP for this compute COMPUTEIP=OPENSTACK_COMPUTE_NODE_${i}_IP CONTROLIP=OPENSTACK_CONTROL_NODE_${SITE_INDEX}_IP - echo "Configure the stack of the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}" + echo "Configure the stack of the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${!COMPUTEIP}" scp ${WORKSPACE}/disable_firewall.sh "${!COMPUTEIP}:/tmp" ${SSH} "${!COMPUTEIP}" "sudo bash /tmp/disable_firewall.sh" create_etc_hosts ${!COMPUTEIP} ${!CONTROLIP} @@ -926,7 +968,7 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do echo "Stack the compute node ${i} of ${NUM_OPENSTACK_COMPUTE_NODES}: ${COMPUTEIP}" ssh ${!COMPUTEIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &" ssh ${!COMPUTEIP} "ps -ef | grep stack.sh" - os_node_list+=(${!COMPUTEIP}) + os_node_list+=("${!COMPUTEIP}") done echo "nodelist: ${os_node_list[*]}" @@ -1054,6 +1096,7 @@ for i in `seq 1 ${NUM_OPENSTACK_SITES}`; do # ipsec support if [ "${IPSEC_VXLAN_TUNNELS_ENABLED}" == "yes" ]; then + # shellcheck disable=SC2206 ALL_NODES=(${!CONTROLIP} ${COMPUTE_IPS[*]}) for ((inx_ip1=0; inx_ip1<$((${#ALL_NODES[@]} - 1)); inx_ip1++)); do for ((inx_ip2=$((inx_ip1 + 1)); inx_ip2<${#ALL_NODES[@]}; inx_ip2++)); do @@ -1161,7 +1204,7 @@ else workpath="${WORKSPACE}/test/csit/suites" for suite in ${SUITES}; do fullsuite="${workpath}/${suite}" - if [ -z ${newsuites} ]; then + if [ -z "${newsuites}" ]; then newsuites+=${fullsuite} else newsuites+=" "${fullsuite} @@ -1170,6 +1213,9 @@ else SUITES=${newsuites} fi +#install all client versions required for this job testing +install_openstack_clients_in_robot_vm + # TODO: run openrc on control node and then scrape the vars from it # Environment Variables Needed to execute Openstack Client for NetVirt Jobs cat > /tmp/os_netvirt_client_rc << EOF @@ -1187,6 +1233,17 @@ EOF source /tmp/os_netvirt_client_rc +echo "Get all versions before executing pybot" +echo "openstack --version" +which openstack +openstack --version +echo "nova --version" +which nova +nova --version +echo "neutron --version" +which neutron +neutron --version + echo "Starting Robot test suites ${SUITES} ..." # please add pybot -v arguments on a single line and alphabetized suite_num=0 @@ -1201,7 +1258,7 @@ for suite in ${SUITES}; do --log log_${log_name}.html --report None --output output_${log_name}.xml \ -v BUNDLEFOLDER:${BUNDLEFOLDER} \ -v BUNDLE_URL:${ACTUAL_BUNDLE_URL} \ - -v CONTROLLERFEATURES:${CONTROLLERFEATURES} \ + -v CONTROLLERFEATURES:"${CONTROLLERFEATURES}" \ -v CONTROLLER_USER:${USER} \ -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \ -v HA_PROXY_IP:${HA_PROXY_IP} \