Merge "let number of hypervisors be 1 in the case that it's a single node openstack...
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 11 Jan 2017 23:59:27 +0000 (23:59 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 11 Jan 2017 23:59:27 +0000 (23:59 +0000)
jjb/integration/include-raw-integration-deploy-openstack-run-test.sh

index 38c520b1559895568dac083955fedae097300150..5d46e9d4ae2e680e16f736f73a217ba1ab817fc0 100644 (file)
@@ -521,7 +521,15 @@ ${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))
+# in the case that we are doing openstack (control + compute) all in one node, then the number of hypervisors
+# will be the same as the number of openstack systems. However, if we are doing multinode openstack then the
+# assumption is we have a single control node and the rest are compute nodes, so the number of expected hypervisors
+# is one less than the total number of openstack systems
+if [ "${NUM_OPENSTACK_SYSTEM}" -eq 1 ]; then
+  expected_num_hypervisors=1
+else
+  expected_num_hypervisors=$((NUM_OPENSTACK_SYSTEM - 1))
+fi
 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"