Redefinition of checkOnosLog method and modified .topo to use correct driver
diff --git a/TestON/tests/FuncPlatform/Dependency/Logger.py b/TestON/tests/FuncPlatform/Dependency/Logger.py
index b4558b5..22d3f61 100644
--- a/TestON/tests/FuncPlatform/Dependency/Logger.py
+++ b/TestON/tests/FuncPlatform/Dependency/Logger.py
@@ -2,27 +2,33 @@
def __init__( self ):
self.ip = '127.0.0.1'
-def getOnosLog( nodeIp, option='grep \'ERROR\' \| \'WARN\'',
+def checkOnosLog( nodeIp, option='',
outputType=0):
"""
- Specify grep command to listen for in onos log
+ Listens to the log for any Errors and Exceptions.
Runs 'onos-check-logs <option>'
-
+ This script only returns if there are any errors
+ or exceptions
+
outputType
0: Return output of log
1: Return (#Errors, #Exceptions, #Warn)
"""
- main.log.info( 'Starting Onos-log listening for '+str(option) )
if not isinstance( option, basestring ):
main.log.error( 'Incorrect grep format specified' )
return main.FALSE
try:
- cmd = 'onos-check-logs ' + str(nodeIp) + ' | ' + option
+ main.log.info( 'Starting Onos-log listening for '+
+ str(option) )
+ cmd = 'onos-check-logs ' + str(nodeIp) + ' old'
if outputType == 0:
- logResult = main.ONOSnode[0].handle.sendline( cmd )
+ main.ONOSbench.handle.sendline( cmd )
+ main.ONOSbench.handle.expect( cmd )
+ main.ONOSbench.handle.expect('\$')
+ logResult = main.ONOSbench.handle.before
return logResult
elif outputType == 1:
# Important in assertion criteria
@@ -44,4 +50,8 @@
"""
main.log.info( 'setLogLevel implement me' )
-
+def getLogReport( nodeIp, searchTerms ):
+ """
+ Refer to CLI driver for 'logReport'
+ """
+ main.log.info( 'getLogReport - implement me!' )
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.py b/TestON/tests/FuncPlatform/FuncPlatform.py
index 6b681a7..13f8a24 100644
--- a/TestON/tests/FuncPlatform/FuncPlatform.py
+++ b/TestON/tests/FuncPlatform/FuncPlatform.py
@@ -133,6 +133,17 @@
str(startupClassName) + " from " + str(startupSrc) )
main.cleanup()
main.exit()
+
+ # NOTE: Test only
+ # Unceremoniously kill onos 2
+ main.ONOSbench.onosDie( '10.128.174.2' )
+
+ time.sleep( 30 )
+
+ main.step( 'Sample Onos log check' )
+ logResult = onosLog.checkOnosLog( main.ONOSips[0] )
+ main.log.info( logResult )
+ # TODO: Define assertion pass / fail criteria
# Sample app activation
main.step( 'Activating applications metrics and fwd' )
@@ -143,9 +154,5 @@
onpass= 'App activation of ' + str(appList) + ' successful',
onfail= 'App activation failed ' + str(appResult) )
- main.step( 'Sample Onos log check' )
- logResult = onosLog.getOnosLog( main.ONOSips[0] )
- main.log.info( logResult )
- # TODO: Define assertion pass / fail criteria
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.topo b/TestON/tests/FuncPlatform/FuncPlatform.topo
index fcc087d..f19e8f8 100644
--- a/TestON/tests/FuncPlatform/FuncPlatform.topo
+++ b/TestON/tests/FuncPlatform/FuncPlatform.topo
@@ -14,7 +14,7 @@
<host>10.128.174.1</host>
<user>admin</user>
<password></password>
- <type>OnosCliDriver</type>
+ <type>OnosDriver</type>
<connect_order>3</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS1>
@@ -23,7 +23,7 @@
<host>10.128.174.2</host>
<user>admin</user>
<password></password>
- <type>OnosCliDriver</type>
+ <type>OnosDriver</type>
<connect_order>4</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS2>
@@ -32,7 +32,7 @@
<host>10.128.174.3</host>
<user>admin</user>
<password></password>
- <type>OnosCliDriver</type>
+ <type>OnosDriver</type>
<connect_order>5</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS3>