Add verification of number of hypervisors to netvirt loading 10/49810/3
authorAlon Kochba <alonko@hpe.com>
Mon, 26 Dec 2016 14:37:41 +0000 (16:37 +0200)
committerAlon Kochba <alonko@hpe.com>
Mon, 26 Dec 2016 16:19:41 +0000 (18:19 +0200)
Change-Id: Idd9ea821c086b269ea81c8a88db16122604d27eb
Signed-off-by: Alon Kochba <alonko@hpe.com>
jjb/integration/include-raw-integration-deploy-openstack-run-test.sh

index b795d05156e263424369439b7bee44932362ce7c..38c520b1559895568dac083955fedae097300150 100644 (file)
@@ -521,6 +521,13 @@ ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "sudo bash /tmp/disable_firewall.sh"
 echo "sleep for a minute and print hypervisor-list"
 sleep 60
 ${SSH} ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack/devstack; source openrc admin admin; nova hypervisor-list"
+expected_num_hypervisors=$((NUM_OPENSTACK_SYSTEM - 1))
+num_hypervisors=$(${SSH} ${OPENSTACK_CONTROL_NODE_IP} "cd /opt/stack/devstack; source openrc admin admin; openstack hypervisor list -f value | wc -l" | tail -1 | tr -d "\r")
+if ! [ "${num_hypervisors}" ] || ! [ ${num_hypervisors} -eq ${expected_num_hypervisors} ]; then
+  echo "Error: Only $num_hypervisors hypervisors detected, expected $expected_num_hypervisors"
+  collect_logs_and_exit
+  exit 1
+fi
 
 #Need to disable firewalld and iptables in compute nodes as well
 for i in `seq 1 $((NUM_OPENSTACK_SYSTEM - 1))`