Fix no-share-servers CI job

Our Tempest job "*no-share-servers*" fails after merge of change [1]

The root cause for it is in changed behaviour:
After merge of change [1] share services with driver that use Nova
started verify availability of a Nova VM by its net interface and
do not report its capabilities until it is available.
It takes about 2,5 minutes. During this time scheduler has no available
hosts and we get "no hosts available" errors from it in case of CI that
runs Tempest tests much faster than 2,5 minutes after VM creation.

So, add waiter in post_test_hook.sh script.

[1] I325d6461c4b12f481769bb01f792ef850dba789c

Change-Id: I58d617dd76cf079e5e26bf6a4ddc6b4fba4e20e6
Closes-Bug: #1507605
This commit is contained in:
Valeriy Ponomaryov 2015-10-26 18:09:29 +02:00 committed by vponomaryov
parent 7523165b56
commit cbefc53051

@ -108,6 +108,57 @@ elif [[ "$JOB_NAME" =~ "no-share-servers" ]]; then
MANILA_TEMPEST_CONCURRENCY=8
fi
function check_service_vm_availability {
wait_step=10
wait_timeout=300
available='false'
while (( wait_timeout > 0 )) ; do
if [[ "$(ping -w 1 $1)" =~ "1 received" ]]; then
available='true'
break
fi
((wait_timeout-=$wait_step))
sleep $wait_step
done
if [[ $available == 'true' ]]; then
echo "SUCCESS! Service VM $1 is available."
else
echo "FAILURE! Service VM $1 is not available."
exit 1
fi
}
# Also, we should wait until service VM is available
# before running Tempest tests using Generic driver in DHSS=False mode.
DRIVER_GROUPS=$(iniget $MANILA_CONF DEFAULT enabled_share_backends)
for driver_group in ${DRIVER_GROUPS//,/ }; do
SHARE_DRIVER=$(iniget $MANILA_CONF $driver_group share_driver)
GENERIC_DRIVER='manila.share.drivers.generic.GenericShareDriver'
DHSS=$(iniget $MANILA_CONF $driver_group driver_handles_share_servers)
if [[ $SHARE_DRIVER == $GENERIC_DRIVER && $(trueorfalse False DHSS) == False ]]; then
# Wait for availability
source /opt/stack/new/devstack/openrc admin demo
vm_id=$(iniget $MANILA_CONF $driver_group service_instance_name_or_id)
vm_ips=$(nova show $vm_id | grep "private network")
attempts=0
for vm_ip in ${vm_ips//,/ }; do
# Get IPv4 address
if [[ $vm_ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
# Check availability
((attempts++))
check_service_vm_availability $vm_ip
break
fi
done
if [[ (( attempts < 1 )) ]]; then
echo "No IPv4 addresses found among private IPs of '$vm_id' for '$GENERIC_DRIVER'. "\
"Reported IPs: '$vm_ips'."
exit 1
fi
fi
done
# check if tempest plugin was installed correctly
echo 'import pkg_resources; print list(pkg_resources.iter_entry_points("tempest.test_plugins"))' | python