X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-deploy-openstack-run-test.sh;h=277e488ef5797e59daae8b2a35f84daf6e996056;hb=3f74d54d316d9ee1648aa645be5dc71fe5b6cfa3;hp=b02d4f7ea80b63f714d315ba2d753b63be3e1cea;hpb=c5a578187039bb1bc1486ee515e1afafd9bc34d2;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 b02d4f7ea..277e488ef 100644 --- a/jjb/integration/integration-deploy-openstack-run-test.sh +++ b/jjb/integration/integration-deploy-openstack-run-test.sh @@ -14,6 +14,8 @@ PYTHON="${ROBOT_VENV}/bin/python" SSH="ssh -t -t" ADMIN_PASSWORD="admin" OPENSTACK_MASTER_CLIENTS_VERSION="queens" +#Size of the partition to /opt/stack in control and compute nodes +TMPFS_SIZE=2G # TODO: remove this work to run changes.py if/when it's moved higher up to be visible at the Robot level printf "\nshowing recent changes that made it into the distribution used by this job:\n" @@ -108,10 +110,6 @@ function install_openstack_clients_in_robot_vm() { function install_rdo_release() { local ip=$1 case ${OPENSTACK_BRANCH} in - *pike*) - ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-pike/rdo-release-pike-1.noarch.rpm" - ;; - *queens*) ${SSH} ${ip} "sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-queens/rdo-release-queens-1.noarch.rpm" ;; @@ -125,7 +123,7 @@ function install_rdo_release() { # Involves just setting up the shared directory function setup_live_migration_control() { local control_ip=$1 - printf "${control_ip}:Setup directory Share with NFS" + printf "%s:Setup directory Share with NFS" "${control_ip}" cat > ${WORKSPACE}/setup_live_migration_control.sh << EOF sudo mkdir --mode=777 /vm_instances sudo chown -R jenkins:jenkins /vm_instances @@ -142,8 +140,8 @@ EOF function setup_live_migration_compute() { local compute_ip=$1 local control_ip=$2 - printf "${compute_ip}:Mount Shared directory from ${control_ip}" - printf "${compute_ip}:Configure libvirt in listen mode" + printf "%s:Mount Shared directory from ${control_ip}" "${compute_ip}" + printf "%s:Configure libvirt in listen mode" "${compute_ip}" cat > ${WORKSPACE}/setup_live_migration_compute.sh << EOF sudo yum install -y libvirt libvirt-devel nfs-utils sudo crudini --verbose --set --inplace /etc/libvirt/libvirtd.conf '' listen_tls 0 @@ -315,7 +313,13 @@ minimize_polling=True physical_network_mtus = ${PUBLIC_PHYSICAL_NETWORK}:1400 path_mtu = 1458 EOF - + if [ "${ENABLE_GRE_TYPE_DRIVERS}" == "yes" ]; then + cat >> ${local_conf_file_name} << EOF +type_drivers = local,flat,vlan,gre,vxlan +[ml2_type_gre] +tunnel_id_ranges = 1:1000 +EOF + fi if [ "${ENABLE_NETWORKING_L2GW}" == "yes" ]; then cat >> ${local_conf_file_name} << EOF @@ -442,59 +446,71 @@ EOF } # create_compute_node_local_conf() function configure_haproxy_for_neutron_requests() { - MGRIP=$1 + local -r haproxy_ip=$1 # shellcheck disable=SC2206 - ODL_IPS=(${2//,/ }) + local -r odl_ips=(${2//,/ }) cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF sudo systemctl stop firewalld sudo yum -y install policycoreutils-python haproxy EOF -cat > ${WORKSPACE}/haproxy.cfg << EOF + cat > ${WORKSPACE}/haproxy.cfg << EOF global daemon group haproxy - log /dev/log local0 + log /dev/log local0 debug maxconn 20480 pidfile /tmp/haproxy.pid + ssl-default-bind-ciphers !SSLv2:kEECDH:kRSA:kEDH:kPSK:+3DES:!aNULL:!eNULL:!MD5:!EXP:!RC4:!SEED:!IDEA:!DES + ssl-default-bind-options no-sslv3 no-tlsv10 + stats socket /var/lib/haproxy/stats mode 600 level user + stats timeout 2m user haproxy defaults log global + option log-health-checks maxconn 4096 mode tcp retries 3 timeout http-request 10s - timeout queue 1m - timeout connect 10s - timeout client 1m - timeout server 1m - timeout check 10s + timeout queue 2m + timeout connect 5s + timeout client 5s + timeout server 5s listen opendaylight - bind ${MGRIP}:8080 - balance source + bind ${haproxy_ip}:8181 transparent + mode http + http-request set-header X-Forwarded-Proto https if { ssl_fc } + http-request set-header X-Forwarded-Proto http if !{ ssl_fc } + option httpchk GET /diagstatus + option httplog +EOF -listen opendaylight_rest - bind ${MGRIP}:8181 - balance source + odlindex=1 + for odlip in ${odl_ips[*]}; do + echo " server opendaylight-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2" >> ${WORKSPACE}/haproxy.cfg + odlindex=$((odlindex+1)) + done -listen opendaylight_websocket - bind ${MGRIP}:8185 - balance source + cat >> ${WORKSPACE}/haproxy.cfg << EOF +listen opendaylight_ws + bind ${haproxy_ip}:8185 transparent + mode http + timeout tunnel 3600s + option httpchk GET /data-change-event-subscription/neutron:neutron/neutron:ports/datastore=OPERATIONAL/scope=SUBTREE HTTP/1.1\r\nHost:\ ws.opendaylight.org\r\nConnection:\ Upgrade\r\nUpgrade:\ websocket\r\nSec-WebSocket-Key:\ haproxy\r\nSec-WebSocket-Version:\ 13\r\nSec-WebSocket-Protocol:\ echo-protocol + http-check expect status 101 EOF odlindex=1 - for odlip in ${ODL_IPS[*]}; do - sed -i "/listen opendaylight$/a server controller-${odlindex} ${odlip}:8080 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg - sed -i "/listen opendaylight_rest$/a server controller-rest-${odlindex} ${odlip}:8181 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg - sed -i "/listen opendaylight_websocket$/a server controller-websocket-${odlindex} ${odlip}:8185 check fall 5 inter 2000 rise 2" ${WORKSPACE}/haproxy.cfg + for odlip in ${odl_ips[*]}; do + echo " server opendaylight-ws-${odlindex} ${odlip}:8185 check fall 3 inter 1000 rise 2" >> ${WORKSPACE}/haproxy.cfg odlindex=$((odlindex+1)) done - echo "Dump haproxy.cfg" cat ${WORKSPACE}/haproxy.cfg @@ -509,11 +525,11 @@ sudo systemctl status haproxy true EOF - scp ${WORKSPACE}/install_ha_proxy.sh ${MGRIP}:/tmp - ${SSH} ${MGRIP} "sudo bash /tmp/install_ha_proxy.sh" - scp ${WORKSPACE}/haproxy.cfg ${MGRIP}:/tmp - scp ${WORKSPACE}/deploy_ha_proxy.sh ${MGRIP}:/tmp - ${SSH} ${MGRIP} "sudo bash /tmp/deploy_ha_proxy.sh" + scp ${WORKSPACE}/install_ha_proxy.sh ${haproxy_ip}:/tmp + ${SSH} ${haproxy_ip} "sudo bash /tmp/install_ha_proxy.sh" + scp ${WORKSPACE}/haproxy.cfg ${haproxy_ip}:/tmp + scp ${WORKSPACE}/deploy_ha_proxy.sh ${haproxy_ip}:/tmp + ${SSH} ${haproxy_ip} "sudo bash /tmp/deploy_ha_proxy.sh" } # configure_haproxy_for_neutron_requests() # Following three functions are debugging helpers when debugging devstack changes. @@ -622,6 +638,26 @@ function retry() { return ${rc} } +function install_ovs() { + local -r node=${1} + local -r rpm_path=${2} + + if [ "${OVS_INSTALL:0:1}" = "v" ]; then + # An OVS version was given, so we build it ourselves from OVS git repo. + # Only on the first node though, consecutive nodes will use RPMs + # built for the first one. + [ ! -d "${rpm_path}" ] && mkdir -p "${rpm_path}" && build_ovs ${node} ${OVS_INSTALL} "${rpm_path}" + # Install OVS from path + install_ovs_from_path ${node} "${rpm_path}" + elif [ "${OVS_INSTALL:0:4}" = "http" ]; then + # Otherwise, install from rpm repo directly. + install_ovs_from_repo ${node} ${OVS_INSTALL} + else + echo "Expected either an OVS version git tag or a repo http url" + exit 1 + fi +} + ODL_PROVIDER_MAPPINGS="\${PUBLIC_PHYSICAL_NETWORK}:${PUBLIC_BRIDGE}" RECLONE=False ODL_PORT=8181 @@ -663,6 +699,10 @@ sudo iptables --line-numbers -nvL true EOF +#For SFC Tests a larger partition is required for creating instances with Ubuntu +if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then + TMPFS_SIZE=12G +fi cat > ${WORKSPACE}/get_devstack.sh << EOF sudo systemctl stop firewalld sudo yum install bridge-utils python-pip -y @@ -677,7 +717,7 @@ echo "::1 localhost \${HOSTNAME}" >> /tmp/hosts sudo mv /tmp/hosts /etc/hosts sudo mkdir /opt/stack echo "Create RAM disk for /opt/stack" -sudo mount -t tmpfs -o size=2G tmpfs /opt/stack +sudo mount -t tmpfs -o size=${TMPFS_SIZE} tmpfs /opt/stack sudo chmod 777 /opt/stack cd /opt/stack echo "git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}" @@ -687,16 +727,14 @@ if [ -n "${DEVSTACK_HASH}" ]; then echo "git checkout ${DEVSTACK_HASH}" git checkout ${DEVSTACK_HASH} fi +wget https://raw.githubusercontent.com/shague/odl_tools/master/fix-logging.patch.txt -O /tmp/fix-logging.patch.txt +patch --verbose -p1 -i /tmp/fix-logging.patch.txt git --no-pager log --pretty=format:'%h %<(13)%ar%<(13)%cr %<(20,trunc)%an%d %s%b' -n20 echo echo "workaround: do not upgrade openvswitch" sudo yum install -y yum-plugin-versionlock sudo yum versionlock add openvswitch - -#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 @@ -706,6 +744,16 @@ sudo nova-manage db sync sudo nova-manage cell_v2 discover_hosts EOF +cat > "${WORKSPACE}/workaround_networking_sfc.sh" << EOF +cd /opt/stack +git clone https://git.openstack.org/openstack/networking-sfc +cd networking-sfc +git checkout ${OPENSTACK_BRANCH} +git checkout master -- devstack/plugin.sh +EOF + +NUM_OPENSTACK_SITES=${NUM_OPENSTACK_SITES:-1} +compute_index=1 os_node_list=() if [ "${ENABLE_HAPROXY_FOR_NEUTRON}" == "yes" ]; then @@ -741,6 +789,7 @@ for i in "${!os_ip_list[@]}"; do tcpdump_start "${i}" "${ip}" "port 6653" done + # Begin stacking the nodes, starting with the controller(s) and then the compute(s) for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do @@ -761,6 +810,13 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do if [ "${ODL_ML2_BRANCH}" == "stable/queens" ]; then ssh ${!CONTROLIP} "sed -i 's/flat_networks public/flat_networks public,physnet1/' /opt/stack/devstack/lib/neutron" ssh ${!CONTROLIP} "sed -i '186i iniset \$NEUTRON_CORE_PLUGIN_CONF ml2_type_vlan network_vlan_ranges public:1:4094,physnet1:1:4094' /opt/stack/devstack/lib/neutron" + #Workaround for networking-sfc to configure the paramaters in neutron.conf if the + # services used are neutron-api, neutron-dhcp etc instead of q-agt. + # Can be removed if the patch https://review.openstack.org/#/c/596287/ gets merged + if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then + scp ${WORKSPACE}/workaround_networking_sfc.sh ${!CONTROLIP}:/tmp/ + ssh ${!CONTROLIP} "bash -x /tmp/workaround_networking_sfc.sh" + fi fi create_control_node_local_conf ${!CONTROLIP} ${ODLMGRIP} "${ODL_OVS_MGRS}" scp ${WORKSPACE}/local.conf_control_${!CONTROLIP} ${!CONTROLIP}:/opt/stack/devstack/local.conf @@ -770,6 +826,12 @@ for i in `seq 1 ${NUM_OPENSTACK_CONTROL_NODES}`; do if [ "$(is_openstack_feature_enabled n-cpu)" == "1" ]; then setup_live_migration_compute ${!CONTROLIP} ${!CONTROLIP} fi + [ -n "${OVS_INSTALL}" ] && install_ovs ${!CONTROLIP} /tmp/ovs_rpms + if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then + # This should be really done by networking-odl devstack plugin, + # but in the meantime do it ourselves + ssh ${!CONTROLIP} "sudo ovs-vsctl set Open_vSwitch . external_ids:of-tunnel=true" + fi echo "Stack the control node ${i} of ${NUM_OPENSTACK_CONTROL_NODES}: ${CONTROLIP}" ssh ${!CONTROLIP} "cd /opt/stack/devstack; nohup ./stack.sh > /opt/stack/devstack/nohup.out 2>&1 &" ssh ${!CONTROLIP} "ps -ef | grep stack.sh" @@ -819,6 +881,12 @@ for i in `seq 1 ${NUM_OPENSTACK_COMPUTE_NODES}`; do echo "Install rdo release to avoid incompatible Package versions" install_rdo_release ${!COMPUTEIP} setup_live_migration_compute ${!COMPUTEIP} ${!CONTROLIP} + [ -n "${OVS_INSTALL}" ] && install_ovs ${!COMPUTEIP} /tmp/ovs_rpms + if [[ "${ENABLE_OS_PLUGINS}" =~ networking-sfc ]]; then + # This should be really done by networking-odl devstack plugin, + # but in the meantime do it ourselves + ssh ${!COMPUTEIP} "sudo ovs-vsctl set Open_vSwitch . external_ids:of-tunnel=true" + fi 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" @@ -1007,32 +1075,7 @@ else HA_PROXY_3_IP=${ODL_SYSTEM_3_IP} fi -echo "Locating test plan to use..." -testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}" -if [ ! -f "${testplan_filepath}" ]; then - testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}" -fi - -echo "Changing the testplan path..." -cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt -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 +get_test_suites SUITES #install all client versions required for this job testing install_openstack_clients_in_robot_vm @@ -1132,6 +1175,7 @@ for suite in ${SUITES}; do -v TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_1_IP} \ -v TOOLS_SYSTEM_1_IP:${TOOLS_SYSTEM_1_IP} \ -v TOOLS_SYSTEM_2_IP:${TOOLS_SYSTEM_2_IP} \ + -v TOOLS_SYSTEM_3_IP:${TOOLS_SYSTEM_3_IP} \ -v USER_HOME:${HOME} \ -v WORKSPACE:/tmp \ ${TESTOPTIONS} ${suite} || true