Merge "Addition of Suite Variable"
[releng/builder.git] / jjb / integration / integration-deploy-openstack-run-test.sh
index 84796ba3e276057848a28b80603cdb89ac3b34c0..2b66677df0b2f14a35c1fc6dfcbb419bf1377fdd 100644 (file)
@@ -6,7 +6,7 @@
 source ${ROBOT_VENV}/bin/activate
 PYTHON="${ROBOT_VENV}/bin/python"
 SSH="ssh -t -t"
-ADMIN_PASSWORD=admin
+ADMIN_PASSWORD="admin"
 
 # 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"
@@ -264,6 +264,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
@@ -344,6 +345,7 @@ EOF
 auth_strategy = keystone
 [DEFAULT]
 use_neutron = True
+force_raw_images = False
 EOF
 
     echo "Compute local.conf created:"
@@ -352,6 +354,7 @@ EOF
 
 function configure_haproxy_for_neutron_requests() {
     MGRIP=$1
+    # shellcheck disable=SC2206
     ODL_IPS=(${2//,/ })
 
     cat > ${WORKSPACE}/install_ha_proxy.sh<< EOF
@@ -468,6 +471,10 @@ env
 source /opt/stack/devstack/openrc admin admin
 echo -e "\nenv after openrc\n"
 env
+echo "\nsudo du -hs /opt/stack"
+sudo du -hs /opt/stack
+echo "\nsudo mount"
+sudo mount
 EOF
 
     # Since this log collection work is happening before the archive build macro which also
@@ -483,9 +490,10 @@ EOF
         NODE_FOLDER="odl_${i}"
         mkdir -p ${NODE_FOLDER}
         echo "Lets's take the karaf thread dump again..."
-        ${SSH} ${!CONTROLLERIP} "sudo ps aux > /tmp/ps.log"
-        KARAF_PID=$(ssh ${!CONTROLLERIP} "ps aux | grep ${KARAF_ARTIFACT} | grep -v grep | tr -s ' ' | cut -f2 -d' '")
-        ssh ${!CONTROLLERIP} "jstack ${KARAF_PID}"> ${WORKSPACE}/karaf_${i}_threads_after.log || true
+        ssh ${!CONTROLLERIP} "sudo ps aux" > ${WORKSPACE}/ps_after.log
+        pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_after.log | grep -v grep | tr -s ' ' | cut -f2 -d' ')
+        echo "karaf main: org.apache.karaf.main.Main, pid:${pid}"
+        ssh ${!CONTROLLERIP} "jstack ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_after.log || true
         echo "killing karaf process..."
         ${SSH} "${!CONTROLLERIP}" bash -c 'ps axf | grep karaf | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
         ${SSH} ${!CONTROLLERIP} "sudo journalctl > /tmp/journalctl.log"
@@ -504,7 +512,8 @@ EOF
         # 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 *_threads* ${NODE_FOLDER}
+        mv ps_* ${NODE_FOLDER}
         mv ${NODE_FOLDER} ${WORKSPACE}/archives/
     done
 
@@ -791,6 +800,8 @@ echo "127.0.0.1   localhost \${HOSTNAME}" >> /tmp/hosts
 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 chmod 777 /opt/stack
 cd /opt/stack
 echo "git clone https://git.openstack.org/openstack-dev/devstack --branch ${OPENSTACK_BRANCH}"
@@ -805,6 +816,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
@@ -857,7 +872,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
@@ -918,7 +933,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[*]}"
@@ -1046,6 +1061,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
@@ -1153,7 +1169,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}
@@ -1193,6 +1209,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 CONTROLLER_USER:${USER} \
     -v DEVSTACK_DEPLOY_PATH:/opt/stack/devstack \
     -v HA_PROXY_IP:${HA_PROXY_IP} \