Multi node check added, additional documentation
diff --git a/TestON/tests/FuncPlatform/Dependency/App.py b/TestON/tests/FuncPlatform/Dependency/App.py
index ceb0023..3e205d6 100644
--- a/TestON/tests/FuncPlatform/Dependency/App.py
+++ b/TestON/tests/FuncPlatform/Dependency/App.py
@@ -41,7 +41,7 @@
main.appList[app] )
except KeyError:
main.log.error( 'There was an error with the key '+
- str(app) )
+ str(app) + '. Check the appList dictionary' )
return main.FALSE
return main.TRUE
diff --git a/TestON/tests/FuncPlatform/Dependency/Logger.py b/TestON/tests/FuncPlatform/Dependency/Logger.py
index 5448ad2..b4558b5 100644
--- a/TestON/tests/FuncPlatform/Dependency/Logger.py
+++ b/TestON/tests/FuncPlatform/Dependency/Logger.py
@@ -1,9 +1,8 @@
-
def __init__( self ):
self.ip = '127.0.0.1'
-def getOnosLog( nodeIp, option='grep \'ERROR\'',
+def getOnosLog( nodeIp, option='grep \'ERROR\' \| \'WARN\'',
outputType=0):
"""
Specify grep command to listen for in onos log
diff --git a/TestON/tests/FuncPlatform/Dependency/Startup.py b/TestON/tests/FuncPlatform/Dependency/Startup.py
index 3096eee..ca77838 100644
--- a/TestON/tests/FuncPlatform/Dependency/Startup.py
+++ b/TestON/tests/FuncPlatform/Dependency/Startup.py
@@ -9,6 +9,7 @@
on failure (TBD)
"""
import time
+import json
def __init__( self ):
self.ip = '127.0.0.1'
@@ -69,8 +70,33 @@
for node in range( 0, numNodes ):
cli = cli and main.CLIs[node].startOnosCli( onosIps[node] )
- if sc and vc and op and oi and iu and cli == main.TRUE:
+ # Check if all nodes are discovered correctly using
+ # 'nodes' command in Onos Cli
+ na = main.TRUE
+ try:
+ nodeCmdJson = json.loads( main.CLIs[0].nodes() )
+ for node in nodeCmdJson:
+ if node['state'] != 'ACTIVE':
+ main.log.warn( str( node['id'] ) +
+ ' Node is not in ACTIVE state.' )
+ na = main.FALSE
+ if na != main.FALSE:
+ main.log.info( 'All nodes discovered successfully' )
+ except Exception:
+ main.log.error( 'nodes command did not execute properly' )
+ return main.FALSE
+
+ if sc and vc and op and oi and iu and cli and na == main.TRUE:
return main.TRUE
else:
return main.FALSE
+def addAndStartOnosNode( nodeIps ):
+ """
+ A scale-out scenario that adds specified list of
+ nodes and starts those instances.
+
+ Ex) nodeIps = ['10.0.0.2', '10.0.0.3', 10.0.0.4']
+ """
+ main.log.info( 'addAndStartOnosNode implement me!' )
+
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.py b/TestON/tests/FuncPlatform/FuncPlatform.py
index 7b012e6..6b681a7 100644
--- a/TestON/tests/FuncPlatform/FuncPlatform.py
+++ b/TestON/tests/FuncPlatform/FuncPlatform.py
@@ -19,6 +19,10 @@
3. Activate application Y
4. Deactivate application X
+The ideal platform test script should have incredible
+robustness to possible exceptions and report the most
+useful error messages.
+
contributers to contact for help:
andrew@onlab.us
"""
@@ -30,8 +34,9 @@
def CASE1( self, main ):
"""
Main scope initialization case
+ Must include to run any other test cases
"""
- # NOTE: Application name subject to change
+ # NOTE: Hardcoded application name subject to change
# closely monitor and make changes when necessary
# (or implement ways to dynamically get names)
main.appList = {