First take on integration test for using on devstack

Change-Id: Ie9a3f7b6ac9b3560c4d001739cae4a3b65176abf
Implements: blueprint devstack-plugin
changes/41/169241/1
Dmitry Tantsur 8 years ago
parent a0884628cb
commit dfede47ad9

@ -0,0 +1,49 @@
#!/bin/bash
set -eux
INTROSPECTION_SLEEP=${INTROSPECTION_SLEEP:-30}
nodes=$(ironic node-list | tail -n +4 | head -n -1 | tr '|' ' ' | awk '{ print $1; }')
if [ -z "$nodes" ]; then
echo "No nodes found in Ironic"
exit 1
fi
for uuid in $nodes; do
for p in cpus cpu_arch memory_mb local_gb; do
ironic node-update $uuid remove properties/$p > /dev/null
done
done
for uuid in $nodes; do
# TODO(dtantsur): use Ironic API instead
openstack baremetal introspection start $uuid
done
current_nodes=$nodes
temp_nodes=
while true; do
sleep $INTROSPECTION_SLEEP
for uuid in $current_nodes; do
finished=$(openstack baremetal introspection status $uuid -f value -c finished)
if [ "$finished" = "True" ]; then
error=$(openstack baremetal introspection status $uuid -f value -c error)
if [ "$error" != "None" ]; then
echo "Introspection for $uuid failed: $error"
exit 1
fi
else
temp_nodes="$temp_nodes $uuid"
fi
done
if [ "$temp_nodes" = "" ]; then
echo "Introspection done"
break
else
current_nodes=$temp_nodes
temp_nodes=
fi
done
# TODO(dtantsur): check results
Loading…
Cancel
Save