Add check for onos service failing to start
Retry onos-install by default if it fails
Change-Id: I8989c21bb05c60f5e314a3613e01c1a39c669c5e
(cherry picked from commit 370733fb51f02bf64d9d16aabd44ab09c22dc9b4)
diff --git a/TestON/tests/dependencies/Cluster.py b/TestON/tests/dependencies/Cluster.py
index 2e79481..2e16a45 100644
--- a/TestON/tests/dependencies/Cluster.py
+++ b/TestON/tests/dependencies/Cluster.py
@@ -543,7 +543,7 @@
result = result and t.result
return result
- def installOnos( self, installMax=True, installParallel=True ):
+ def installOnos( self, installMax=True, installParallel=True, retries=5 ):
"""
Description:
Installing onos.
@@ -560,16 +560,21 @@
options = "-f"
if installMax and i >= self.numCtrls:
options = "-nf"
+ args = [ ctrl.Bench.onosInstall, main.FALSE ]
+ kwargs={ "node" : ctrl.ipAddress,
+ "options" : options }
if installParallel:
- t = main.Thread( target=ctrl.Bench.onosInstall,
+ t = main.Thread( target=utilities.retry,
name="onos-install-" + ctrl.name,
- kwargs={ "node" : ctrl.ipAddress,
- "options" : options } )
+ args=args,
+ kwargs={ 'kwargs': kwargs,
+ 'attempts': retries } )
+
threads.append( t )
t.start()
else:
result = result and \
- main.ONOSbench.onosInstall( node=ctrl.ipAddress, options=options )
+ utilities.retry( args=args, kwargs=kwargs, attempts=retries )
i += 1
if installParallel:
for t in threads: