Unify onos startup checks

Change-Id: Ia82f696839608031f67aec8f944156d6231b0177
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index ec64601..78bed55 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -147,16 +147,6 @@
                                      onfail="Test step FAIL" )
             installResult = ( installResult and iResult )
 
-        main.step( "Verify ONOS nodes UP status" )
-        statusResult = main.TRUE
-        for i in range( int( main.numCtrls ) ):
-            main.log.info( "ONOS Node " + main.onosIPs[i] + " status:" )
-            onos_status = main.ONOSbench.onosStatus( node=main.onosIPs[i] )
-            utilities.assert_equals( expect=main.TRUE, actual=onos_status,
-                                     onpass="Test step PASS",
-                                     onfail="Test step FAIL" )
-            statusResult = ( statusResult and onos_status )
-
         main.step( "Set up ONOS secure SSH" )
         secureSshResult = main.TRUE
         for i in range( int( main.numCtrls ) ):
@@ -165,6 +155,30 @@
                                  onpass="Test step PASS",
                                  onfail="Test step FAIL" )
 
+        time.sleep( 5 )
+        main.step( "Starting ONOS service" )
+        stopResult = main.TRUE
+        startResult = main.TRUE
+        onosIsUp = main.TRUE
+        for i in range( main.numCtrls ):
+            onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
+        if onosIsUp == main.TRUE:
+            main.log.report( "ONOS instance is up and ready" )
+        else:
+            main.log.report( "ONOS instance may not be up, stop and " +
+                             "start ONOS again " )
+            for i in range( main.numCtrls ):
+                stopResult = stopResult and \
+                        main.ONOSbench.onosStop( main.ONOSip[ i ] )
+            for i in range( main.numCtrls ):
+                startResult = startResult and \
+                        main.ONOSbench.onosStart( main.ONOSip[ i ] )
+        stepResult = onosIsUp and stopResult and startResult
+        utilities.assert_equals( expect=main.TRUE,
+                                 actual=stepResult,
+                                 onpass="ONOS service is ready",
+                                 onfail="ONOS service did not start properly" )
+
         main.step( "Start ONOS CLI on all nodes" )
         cliResult = main.TRUE
         startCliResult  = main.TRUE