WIP Additional methods to log and test application startup
diff --git a/TestON/tests/FuncPlatform/Dependency/App.py b/TestON/tests/FuncPlatform/Dependency/App.py
index f6fecd6..ceb0023 100644
--- a/TestON/tests/FuncPlatform/Dependency/App.py
+++ b/TestON/tests/FuncPlatform/Dependency/App.py
@@ -1,3 +1,8 @@
+"""
+Methods related to application interaction
+
+"""
+
 
 def __init__( self ):
     self.ip = '127.0.0.1'
@@ -10,27 +15,44 @@
         nodeToActivateFrom = range( 0, nodes )
     """
     if isinstance( apps, ( int, basestring ) ):
-        main.log.error( "Please pass in a list of strings for args" )
+        main.log.error( 'Please pass in a list of strings for args' )
         return main.FALSE
 
     if not isinstance( nodeToActivateFrom, ( int ) ) or \
             nodeToActivateFrom < 0:
-        main.log.error( "Incorrect node specified" )
+        main.log.error( 'Incorrect node specified' )
         return main.FALSE
 
+    # TODO: Start log capture and listen for exceptions
+    #       and errors. Also investigate possible keywords
+    #       to listen for when activating applications
+    
+
     for app in apps:
         # Check if app str in appList is in the main scope
         # definition main.appList
         if app not in main.appList:
-            main.log.error( "Invalid app name given" )
+            main.log.error( 'Invalid app name given' )
             return main.FALSE
-      
-        # NOTE: assumes node 1 is always activating application
-        appOutput = main.CLIs[nodeToActivateFrom].activateApp( 
+     
+        try:
+            # NOTE: assumes node 1 is always activating application
+            appOutput = main.CLIs[nodeToActivateFrom].activateApp( 
                 main.appList[app] ) 
+        except KeyError:
+            main.log.error( 'There was an error with the key '+
+                    str(app) )
+            return main.FALSE
 
     return main.TRUE
 
+def deactivate( apps, nodeToDeactivateFrom=0 ):
+    """
+    Deactivate specified applications from node specified
+
+    """
+    main.log.report( 'deactivate implment me' )
+
 def isAppInstallSuccess():
     """
     Check the app list across clusters to determine
@@ -38,5 +60,5 @@
 
     """
 
-    main.log.report( "isAppInstallSuccess" )
+    main.log.report( 'isAppInstallSuccess implement me' )
 
diff --git a/TestON/tests/FuncPlatform/Dependency/Logger.py b/TestON/tests/FuncPlatform/Dependency/Logger.py
new file mode 100644
index 0000000..5448ad2
--- /dev/null
+++ b/TestON/tests/FuncPlatform/Dependency/Logger.py
@@ -0,0 +1,48 @@
+
+
+def __init__( self ):
+    self.ip = '127.0.0.1'
+
+def getOnosLog( nodeIp, option='grep \'ERROR\'',
+        outputType=0):
+    """
+    Specify grep command to listen for in onos log
+
+    Runs 'onos-check-logs <option>'
+    
+    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
+        if outputType == 0:
+            logResult = main.ONOSnode[0].handle.sendline( cmd )
+            return logResult
+        elif outputType == 1:
+            # Important in assertion criteria
+            # to determine how much warn / error is 
+            # acceptable
+            return 'Implement option 1'
+        else:
+            main.log.error( 'Incorrect outputType specified' )
+            return main.FALSE
+
+    except Exception:
+        main.log.exception( self.name + ': Uncaught exception' ) 
+        main.cleanup()
+        main.exit()
+
+def setLogLevel( level ):
+    """
+    Set the log level of onos
+    """
+    main.log.info( 'setLogLevel implement me' )
+
+
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.params b/TestON/tests/FuncPlatform/FuncPlatform.params
index eb274ae..8d152c3 100644
--- a/TestON/tests/FuncPlatform/FuncPlatform.params
+++ b/TestON/tests/FuncPlatform/FuncPlatform.params
@@ -14,6 +14,13 @@
         <appClassName>
             App
         </appClassName>
+    
+        <logSrc>
+            /home/admin/ONLabTest/TestON/tests/FuncPlatform/Dependency/Logger.py
+        </logSrc>
+        <logClassName>
+            Log
+        </logClassName>
     </DEP> 
 
     <CTRL>
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.py b/TestON/tests/FuncPlatform/FuncPlatform.py
index 6bcb06c..7b012e6 100644
--- a/TestON/tests/FuncPlatform/FuncPlatform.py
+++ b/TestON/tests/FuncPlatform/FuncPlatform.py
@@ -31,6 +31,9 @@
         """
         Main scope initialization case
         """   
+        # NOTE: Application name subject to change
+        #       closely monitor and make changes when necessary
+        #       (or implement ways to dynamically get names)
         main.appList = { 
             'bgprouter' : 'org.onosproject.bgprouter',
             'config' : 'org.onosproject.config',
@@ -51,12 +54,15 @@
         # List of ONOS ip's specififed in params
         main.ONOSips = [] 
         main.CLIs = []
+        main.ONOSnode = []
 
         for node in range( 0, int(main.params['CTRL']['num']) ):
             main.ONOSips.append( main.params['CTRL']['ip'+str(node+1)] )
             main.CLIs.append(
                     getattr( main, 'ONOS' + str(node+1) + 'cli' ) )
-       
+            main.ONOSnode.append(
+                    getattr( main, 'ONOS' + str(node+1) ) )
+
     def CASE2( self, main ):
         import time
         import imp
@@ -110,9 +116,13 @@
         appClassName = main.params['DEP']['appClassName']
         appSrc = main.params['DEP']['appSrc']
 
+        logClassName = main.params['DEP']['logClassName']
+        logSrc = main.params['DEP']['logSrc']
+
         # Import application file to use its methods
         try:
             app = imp.load_source( appClassName, appSrc )
+            onosLog = imp.load_source( logClassName, logSrc )
         except ImportError:
             main.log.error( "Error importing class " +
                     str(startupClassName) + " from " + str(startupSrc) )
@@ -128,5 +138,9 @@
                 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