Merge "Wait for cleaning is completed after base smoke tests"
This commit is contained in:
commit
3eb915b6e5
@ -31,6 +31,29 @@ NEUTRON_NET=ironic_grenade
|
|||||||
|
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
|
function wait_for_ironic_resources {
|
||||||
|
local i
|
||||||
|
local nodes_count
|
||||||
|
nodes_count=$(openstack baremetal node list -f value -c "Provisioning State" | wc -l)
|
||||||
|
echo_summary "Waiting 5 minutes for Ironic resources become available again"
|
||||||
|
for i in $(seq 1 30); do
|
||||||
|
if openstack baremetal node list -f value -c "Provisioning State" | grep -qi failed; then
|
||||||
|
die $LINENO "One of nodes is in failed state."
|
||||||
|
fi
|
||||||
|
if [[ $(openstack baremetal node list -f value -c "Provisioning State" | grep -ci available) == $nodes_count ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
openstack baremetal node list
|
||||||
|
die $LINENO "Timed out waiting for Ironic nodes are available again."
|
||||||
|
}
|
||||||
|
|
||||||
|
total_cpus=$(( $IRONIC_VM_SPECS_CPU * $IRONIC_VM_COUNT ))
|
||||||
|
|
||||||
|
if [[ "${HOST_TOPOLOGY}" == "multinode" ]]; then
|
||||||
|
total_cpus=$(( 2 * $total_cpus ))
|
||||||
|
fi
|
||||||
|
|
||||||
function early_create {
|
function early_create {
|
||||||
# We need these steps only in case of flat-network
|
# We need these steps only in case of flat-network
|
||||||
@ -125,6 +148,8 @@ function destroy {
|
|||||||
# Dispatcher
|
# Dispatcher
|
||||||
case $1 in
|
case $1 in
|
||||||
"early_create")
|
"early_create")
|
||||||
|
wait_for_ironic_resources
|
||||||
|
wait_for_nova_resources "vcpus" $total_cpus
|
||||||
early_create
|
early_create
|
||||||
;;
|
;;
|
||||||
"create")
|
"create")
|
||||||
@ -139,9 +164,5 @@ case $1 in
|
|||||||
"destroy")
|
"destroy")
|
||||||
destroy
|
destroy
|
||||||
;;
|
;;
|
||||||
"force_destroy")
|
|
||||||
set +o errexit
|
|
||||||
destroy
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user