ONOS Cli Driver Stability Fixes
- Catch ValueError thrown from json.loads and additional logging
- Check for "Command not found" on all CLI function responses
- Remove old ONOS Feature commands
- Fix mininet statup issue in SAMPstartTemplate
- Style fixes
- onos-package now expects the "Downloading" output
Change-Id: I834d40429592578fd4e79ea61edc20e169e1cc2c
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 58b113c..7b19efc 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -216,9 +216,7 @@
for node in main.nodes:
started = main.ONOSbench.isup( node.ip_address )
if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
+ main.log.error( node.name + " hasn't started" )
onosIsupResult = onosIsupResult and started
if onosIsupResult == main.TRUE:
break
@@ -2258,10 +2256,14 @@
"Error" not in devices[ controller ] and\
"Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
+ try:
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ except ( TypeError, ValueError ) as e:
+ main.log.exception( "Object not as expected; devices={!r}\nports={!r}".format(
+ devices[ controller ], ports[ controller ] ) )
else:
currentDevicesResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index d31cd30..c1f979a 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -244,9 +244,7 @@
for node in main.nodes:
started = main.ONOSbench.isup( node.ip_address )
if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
+ main.log.error( node.name + " hasn't started" )
onosIsupResult = onosIsupResult and started
if onosIsupResult == main.TRUE:
break
@@ -2255,10 +2253,14 @@
"Error" not in devices[ controller ] and\
"Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
+ try:
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ except ( TypeError, ValueError ) as e:
+ main.log.exception( "Object not as expected; devices={!r}\nports={!r}".format(
+ devices[ controller ], ports[ controller ] ) )
else:
currentDevicesResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index ed37e33..f58073f 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -212,9 +212,7 @@
for node in main.nodes:
started = main.ONOSbench.isup( node.ip_address )
if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
+ main.log.error( node.name + " hasn't started" )
onosIsupResult = onosIsupResult and started
if onosIsupResult == main.TRUE:
break
@@ -2151,10 +2149,14 @@
"Error" not in devices[ controller ] and\
"Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
+ try:
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ except ( TypeError, ValueError ) as e:
+ main.log.exception( "Object not as expected; devices={!r}\nports={!r}".format(
+ devices[ controller ], ports[ controller ] ) )
else:
currentDevicesResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index 2f7f922..1587563 100644
--- a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -1476,10 +1476,14 @@
"Error" not in devices[ controller ] and\
"Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
+ try:
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ except ( TypeError, ValueError ) as e:
+ main.log.exception( "Object not as expected; devices={!r}\nports={!r}".format(
+ devices[ controller ], ports[ controller ] ) )
else:
currentDevicesResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index b7f1e77..edcc4d1 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -237,9 +237,7 @@
for node in main.nodes:
started = main.ONOSbench.isup( node.ip_address )
if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
+ main.log.error( node.name + " hasn't started" )
onosIsupResult = onosIsupResult and started
if onosIsupResult == main.TRUE:
break
@@ -2244,10 +2242,14 @@
"Error" not in devices[ controller ] and\
"Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
+ try:
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ except ( TypeError, ValueError ) as e:
+ main.log.exception( "Object not as expected; devices={!r}\nports={!r}".format(
+ devices[ controller ], ports[ controller ] ) )
else:
currentDevicesResult = main.FALSE
utilities.assert_equals( expect=main.TRUE,
diff --git a/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
index 2122570..b6184da 100644
--- a/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
+++ b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
@@ -230,7 +230,7 @@
main.log.case( "Start Mininet topology" )
main.step( "Starting Mininet Topology" )
- topoResult = main.Mininet1.startNet( topoFile=topology )
+ topoResult = main.Mininet1.startNet( topoFile=main.dependencyPath + main.topology )
stepResult = topoResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,