Ray Milkey
Committed by Gerrit Code Review

Check that the DHCP Manager is active before testing its configuration

Change-Id: Id760d58df005060c0f1d0c2ebdde90fe356d2c9f
#!/bin/bash
# -----------------------------------------------------------------------------
# Checks whether the given ONOS component has a given state.
# -----------------------------------------------------------------------------
aux=/tmp/stc-$$.log
trap "rm -f $aux 2>/dev/null" EXIT
node=$1
component=$2
state=$3
for attempt in {1..30}; do
onos ${node:-$OCI} scr:list | grep $component > $aux
if grep -q $state $aux; then
exit 0
else
sleep 1
fi
done
cat $aux && exit 1
......@@ -25,8 +25,10 @@
<!-- Check that the activation was successful -->
<group name="Netcfg.Check-Dhcp-App-Activated" requires="Netcfg.Activate-Dhcp">
<parallel var="${OC#}">
<step name="Netcfg.Check-Dhcp-App-Activated-${#}" delay="2"
<step name="Netcfg.Check-Dhcp-App-Activated-${#}"
exec="onos-check-apps ${OC#} drivers,openflow,proxyarp,dhcp includes"/>
<step name="Netcfg.Check-Dhcp-Component-Active-${#}"
exec="onos-check-component ${OC#} org.onosproject.dhcp.impl.DhcpManager ACTIVE"/>
</parallel>
</group>
......@@ -37,7 +39,7 @@
<group name="Query1" requires="Netcfg.Post-1">
<parallel var="${OC#}" starts="Netcfg.Query-1-${#}">
<!-- Check that the values made it into the config for the DHCP server -->
<step name="Netcfg.QueryDhcp-1-${#}" delay="2"
<step name="Netcfg.QueryDhcp-1-${#}"
exec="check-dhcp-netcfg.py ${OC#} ttl=1 lease=2 renew=3 rebind=4 delay=5 timeout=6"/>
</parallel>
</group>
......@@ -50,7 +52,7 @@
<group name="Query2" requires="Netcfg.Post-2">
<parallel var="${OC#}" starts="Netcfg.Query-2-${#}">
<!-- Check that the values made it into the config for the DHCP server -->
<step name="Netcfg.QueryDhcp-2-${#}" delay="2"
<step name="Netcfg.QueryDhcp-2-${#}"
exec="check-dhcp-netcfg.py ${OC#} ttl=21 lease=22 renew=23 rebind=24 delay=25 timeout=26"/>
</parallel>
</group>
......