Ray Milkey
Committed by Gerrit Code Review

Fix up drivers test to not shut down all of ONOS

Change-Id: Id72aa88e9f7bda14324d448232a6677dd8ff3ba1
......@@ -11,38 +11,34 @@ if len(sys.argv) < 3:
node = sys.argv[1]
cfgRequest = requests.get('http://' + node + ':8181/onos/v1/network/configuration',
cfgRequest = requests.get('http://' + node +
':8181/onos/v1/network/configuration/apps/org.onosproject.dhcp',
auth=HTTPBasicAuth('onos', 'rocks'))
print cfgRequest.text
if cfgRequest.status_code != 200:
print cfgRequest.text
sys.exit(1)
cfgJson = cfgRequest.json()
appFound = False
for index in range(2, len(sys.argv)):
pair = sys.argv[index].split("=")
for app in cfgJson["apps"]:
if app == "org.onosproject.dhcp":
dhcp = cfgJson["apps"][app]["dhcp"]
appFound = True
name = pair[0]
value = pair[1]
dhcp = cfgJson["dhcp"]
appFound = True
name = pair[0]
value = pair[1]
if dhcp[name] != value:
print name + " differs: expected " + value + " but found " + dhcp[name]
print cfgJson
sys.exit(1)
if dhcp[name] != value:
print name + " differs: expected " + value + " but found " + dhcp[name]
print cfgJson
sys.exit(1)
if appFound:
sys.exit(0)
sys.exit(0)
print "DHCP app not found"
print cfgJson
sys.exit(2)
......
......@@ -17,47 +17,46 @@
description="Driver CLI activate/deactivate test">
<group name="Drivers-Test">
<!-- Check initial state of select drivers -->
<step name="DriversTest.FindCelesticaCorsa"
exec="onos-find-driver ${OC1} celestica celestica" />
<step name="DriversTest.CheckCelesticaCorsa" requires="^"
exec="test '${celesticaDriver}' != ''"/>
<step name="DriversTest.Default" requires="^"
exec="onos-find-driver ${OC1} default default" />
<step name="DriversTest.CheckDefault" requires="^"
exec="test '${defaultDriver}' != ''"/>
<!-- Deactivate openfow app - prevents spawning multiple controllers -->
<step name="DriversTest.DeactivateOpenflowApp" requires="^"
exec="onos ${OCI} onos:app deactivate org.onosproject.openflow"/>
<!-- Deactivate drivers app -->
<step name="DriversTest.DeactivateDriversApp" requires="^"
exec="onos ${OCI} onos:app deactivate org.onosproject.drivers"/>
<!-- Check that drivers are no longer present -->
<step name="DriversTest.AfterDeactivateFindCelesticaCorsa" requires="^"
exec="onos-find-driver ${OC1} celestica celesticaInactive" env="!"/>
<step name="DriversTest.AfterDeactivateFindDefault" requires="^"
exec="onos-find-driver ${OC1} default defaultInactive" env="!"/>
<!-- Reactivate openflow apps -->
<step name="DriversTest.ActivateOpenflowApp" requires="^"
exec="onos ${OCI} onos:app activate org.onosproject.openflow"/>
<!-- Reactivate all drivers -->
<step name="DriversTest.ActivateDriversApp" requires="^"
exec="onos ${OCI} onos:app activate org.onosproject.drivers"/>
<!-- Check reactivated state of drivers -->
<step name="DriversTest.ReactivatedFindCelesticaCorsa" requires="^"
exec="onos-find-driver ${OC1} celestica celestica" />
<step name="DriversTest.ReactivatedCheckCelesticaCorsa" requires="^"
exec="test '${celesticaDriver}' != ''"/>
<step name="DriversTest.ReactivatedDefault" requires="^"
exec="onos-find-driver ${OC1} default default" />
<step name="DriversTest.ReactivatedCheckDefault" requires="^"
exec="test '${defaultDriver}' != ''"/>
<!-- Check initial state of the Fujitsu driver -->
<step name="DriversTest.FindFujitsuInitial"
exec="onos-find-driver ${OC1} fujitsu-netconf fujitsu" env="!"/>
<!-- Activate Fujitsu driver app -->
<!--
<step name="DriversTest.ActivateNetconfApp" requires="^"
exec="onos ${OCI} onos:app activate org.onosproject.netconf"/>
<step name="DriversTest.ActivateFujitsuDriverApp" requires="^"
exec="onos ${OCI} onos:app activate org.onosproject.drivers.fujitsu"/>
-->
<!-- Check that the activation was successful -->
<!--
<group name="DriversTest.Check-Fujitsu-App-Activated" requires="DriversTest.ActivateFujitsuDriverApp">
<parallel var="${OC#}">
<step name="DriversTest.Check-Fujitsu-App-Activated-${#}"
exec="onos-check-apps ${OC#} drivers,openflow,proxyarp,dhcp,fujitsu includes"/>
</parallel>
</group>
-->
<!-- Check that Fujitsu driver is active. -->
<!--
<step name="DriversTest.FindFujitsuAfterActivate" requires="^"
exec="onos-find-driver ${OC1} fujitsu-netconf fujitsu" />
<step name="DriversTest.CheckFujitsuAfterActivate" requires="^"
exec="test '${fujitsuDriver}' != ''"/>
-->
<!-- Deactivate Fujitsu driver app -->
<!--
<step name="DriversTest.DeactivateFujitsuDriverApp" requires="^"
exec="onos ${OCI} onos:app deactivate org.onosproject.drivers.fujitsu"/>
-->
<!-- Check that Fujitsu driver is no longer present -->
<step name="DriversTest.AfterDeactivateFindFujitsu" requires="^"
exec="onos-find-driver ${OC1} fujitsu fujitsuInactive" env="!"/>
</group>
</scenario>
......
......@@ -22,8 +22,16 @@
<step name="Netcfg.Activate-Dhcp"
exec="onos ${OC1} app activate org.onosproject.dhcp"/>
<!-- 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"
exec="onos-check-apps ${OC#} drivers,openflow,proxyarp,dhcp includes"/>
</parallel>
</group>
<!-- Upload the first set of config changes -->
<step name="Netcfg.Post-1" requires="^"
<step name="Netcfg.Post-1" requires="Netcfg.Check-Dhcp-App-Activated"
exec="post-netcfg.py ${OC1} ${ONOS_SCENARIOS}/netcfg-test/dhcp-cfg1.json"/>
<group name="Query1" requires="Netcfg.Post-1">
......