diff --git a/TestON/core/logger.py b/TestON/core/logger.py
index 7826017..72db4c9 100644
--- a/TestON/core/logger.py
+++ b/TestON/core/logger.py
@@ -97,6 +97,12 @@
         main.wikiFile.write( main.TEST + " at " + currentTime + "<p></p>\n" )
         main.wikiFile.close()
 
+        # TAP file header
+        main.TAPFile = open( main.TAPFileName, "w+" )
+        main.TAPFile.write( "TAP version 13\n" )
+        main.TAPFile.close()
+
+
     def initlog( self, main ):
         '''
             Initialise all the log handles.
@@ -115,6 +121,7 @@
         main.LogFileName = main.logdir + "/" + main.TEST + "_" + str( currentTime ) + ".log"
         main.ReportFileName = main.logdir + "/" + main.TEST + "_" + str( currentTime ) + ".rpt"
         main.WikiFileName = main.logdir + "/" + main.TEST + "Wiki.txt"
+        main.TAPFileName = main.logdir + "/" + main.TEST + ".tap"
         main.SummaryFileName = main.logdir + "/" + main.TEST + "Summary.txt"
         main.JenkinsCSV = main.logdir + "/" + main.TEST + ".csv"
         main.resultFile = main.logdir + "/" + main.TEST + "Result.txt"
@@ -166,6 +173,18 @@
 
         main.log.wiki = wiki
 
+        def TAP( msg ):
+            '''
+                Will append the message to the txt file for TAP.
+            '''
+            main.log._log( 6, msg, "OpenFlowAutoMattion", "OFAutoMation" )
+            main.TAPFile = open( main.TAPFileName, "a+" )
+            main.TAPFile.write( msg + "\n" )
+            main.TAPFile.close()
+
+        main.log.TAP = TAP
+
+
         def exact( exmsg ):
             '''
                Will append the raw formatted message to the logs
@@ -338,19 +357,23 @@
             main.TOTAL_TC_NORESULT = main.TOTAL_TC_NORESULT + 1
             main.log.exact( "\n " + "*" * 29 + "\n" + "\n Result: No Assertion Called \n" + "*" * 29 + "\n" )
             line = "Case " + case + ": " + main.CurrentTestCase + " - No Result"
+            main.log.TAP( "ok - %s # TODO No assert called" % line )
         elif currentResult == 1:
             main.TOTAL_TC_RUN = main.TOTAL_TC_RUN + 1
             main.TOTAL_TC_PASS = main.TOTAL_TC_PASS + 1
             main.log.exact( "\n" + "*" * 29 + "\n Result: Pass \n" + "*" * 29 + "\n" )
             line = "Case " + case + ": " + main.CurrentTestCase + " - PASS"
+            main.log.TAP( "ok - %s" % line )
         elif currentResult == 0:
             main.TOTAL_TC_RUN = main.TOTAL_TC_RUN + 1
             main.TOTAL_TC_FAIL = main.TOTAL_TC_FAIL + 1
             main.log.exact( "\n" + "*" * 29 + "\n Result: Failed \n" + "*" * 29 + "\n" )
             line = "Case " + case + ": " + main.CurrentTestCase + " - FAIL"
+            main.log.TAP( "not ok - %s" % line )
         else:
             main.log.error( " Unknown result of case " + case +
                             ". Result was: " + currentResult )
             line = "Case " + case + ": " + main.CurrentTestCase + " - ERROR"
+            main.log.TAP( "not ok - %s" % line )
         main.log.wiki( "<h3>" + line + "</h3>" )
         main.log.summary( line )
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 632c56c..ff01b00 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -235,6 +235,7 @@
         self.code = test.getStepCode()
         repeat = int( self.params.get( 'repeat', 1 ) )
         self.TOTAL_TC_PLANNED = len( self.testcases_list ) * repeat
+        self.log.TAP( "1..%s" % self.TOTAL_TC_PLANNED )
 
         result = self.TRUE
         while repeat:
@@ -303,34 +304,76 @@
             self.testCaseResult[ str( self.CurrentTestCaseNumber ) ] = self.CASERESULT
             self.organizeResult( self.CurrentTestCaseNumber, self.CASERESULT )
             self.logger.updateCaseResults( self )
-            self.log.wiki( "<p>" + self.caseExplanation + "</p>" )
             self.log.summary( self.caseExplanation )
-            self.log.wiki( "<ul>" )
-            subcaseMessage = False
-            for line in self.stepCache.splitlines():
-                if re.search( "[0-9]\.[0-9]", line ):  # Step
-                    if subcaseMessage:  # End of Failure Message Printout
-                        self.log.wiki( "</ul>\n" )
-                        subcaseMessage = False
-                    if re.search( " - PASS$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"tick\" /></li>\n" )
-                    elif re.search( " - FAIL$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"cross\" /></li>\n" )
-                    elif re.search( " - No Result$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"warning\" /></li>\n" )
-                else:  # Substep
-                    if not subcaseMessage:  # Open Failure Message Printout
-                        self.log.wiki( "<ul><li>" + line + "</li>\n" )
-                        subcaseMessage = True
-                    else:  # Add to Failure Message Printout
-                        self.log.wiki( "<li>" + line + "</li>\n" )
-            if subcaseMessage:  # End of Failure Message Printout for last item
-                self.log.wiki( "</ul>\n" )
-            self.log.wiki( "</ul>" )
             self.log.summary( self.stepCache )
+            self.caseResultsWiki()
+            self.caseResultsTAP()
             self.stepCache = ""
         return result
 
+    def caseResultsWiki( self ):
+        """
+        Add case results to the wiki results file
+        """
+        self.log.wiki( "<p>" + self.caseExplanation + "</p>" )
+        self.log.wiki( "<ul>" )
+        subcaseMessage = False
+        for line in self.stepCache.splitlines():
+            if re.search( "[0-9]\.[0-9]", line ):  # Step
+                if subcaseMessage:  # End of Failure Message Printout
+                    self.log.wiki( "</ul>\n" )
+                    subcaseMessage = False
+                if re.search( " - PASS$", line ):
+                    self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"tick\" /></li>\n" )
+                elif re.search( " - FAIL$", line ):
+                    self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"cross\" /></li>\n" )
+                elif re.search( " - No Result$", line ):
+                    self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"warning\" /></li>\n" )
+            else:  # Substep
+                if not subcaseMessage:  # Open Failure Message Printout
+                    self.log.wiki( "<ul><li>" + line + "</li>\n" )
+                    subcaseMessage = True
+                else:  # Add to Failure Message Printout
+                    self.log.wiki( "<li>" + line + "</li>\n" )
+        if subcaseMessage:  # End of Failure Message Printout for last item
+            self.log.wiki( "</ul>\n" )
+        self.log.wiki( "</ul>" )
+
+    def caseResultsTAP( self ):
+        """
+        Add case results to the TAP results file
+        """
+        #self.log.TAP( "<p>" + self.caseExplanation + "</p>" )
+        main.log.debug( self.stepCache )
+        subcaseMessage = False
+        steps = 0
+        stepLines = []
+        for line in self.stepCache.splitlines():
+            main.log.debug( line )
+            if re.search( "[0-9]\.[0-9]", line ):  # Step
+                if subcaseMessage:  # End of Failure Message Printout
+                    subcaseMessage = False
+                if re.search( " - PASS$", line ):
+                    steps += 1
+                    stepLines.append( "    ok -- STEP %s" % line )
+                elif re.search( " - FAIL$", line ):
+                    steps += 1
+                    stepLines.append( "    not ok -- STEP %s" % line )
+                elif re.search( " - No Result$", line ):
+                    steps += 1
+                    stepLines.append( "    ok -- STEP %s # TODO: No assertion in test step" % line )
+            else:  # Substep
+                if not subcaseMessage:  # Open Failure Message Printout
+                    stepLines.append( "    # %s" % line )
+                    subcaseMessage = True
+                else:  # Add to Failure Message Printout
+                    self.log.TAP( "    # %s" % line )
+        if steps > 0:
+            self.log.TAP( "    1..%s" % steps )
+            for line in stepLines:
+                self.log.TAP( line )
+
+
     def organizeResult( self, caseNum, result ):
         """
             Organize the result and put the current number into either
@@ -382,18 +425,8 @@
                 self.log.exception( "" )
                 self.stepCount = self.stepCount + 1
                 self.logger.updateCaseResults( self )
-                # WIKI results
-                self.log.wiki( "<ul>" )
-                for line in self.stepCache.splitlines():
-                    if re.search( " - PASS$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"tick\" /></li>\n" )
-                    elif re.search( " - FAIL$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"cross\" /></li>\n" )
-                    elif re.search( " - No Result$", line ):
-                        self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"warning\" /></li>\n" )
-                    else:  # Should only be on fail message
-                        self.log.wiki( "<ul><li>" + line + "</li></ul>\n" )
-                self.log.wiki( "</ul>" )
+                self.stepResultsWiki()
+                self.stepResultsTAP()
                 # summary results
                 self.log.summary( self.stepCache )
                 self.stepCache = ""
@@ -408,6 +441,40 @@
             result = self.cleanup()
             return self.FALSE
 
+    def stepResultsWiki( self ):
+        """
+        Add step results to the wiki file
+        """
+        # WIKI results
+        self.log.wiki( "<ul>" )
+        for line in self.stepCache.splitlines():
+            if re.search( " - PASS$", line ):
+                self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"tick\" /></li>\n" )
+            elif re.search( " - FAIL$", line ):
+                self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"cross\" /></li>\n" )
+            elif re.search( " - No Result$", line ):
+                self.log.wiki( "<li>" + line + "  <ac:emoticon ac:name=\"warning\" /></li>\n" )
+            else:  # Should only be on fail message
+                self.log.wiki( "<ul><li>" + line + "</li></ul>\n" )
+        self.log.wiki( "</ul>" )
+
+    def stepResultsTAP( self ):
+        """
+        Add step results to the TAP file
+        """
+        # TAP results
+        # TODO Do we need indetation for the steps?
+        main.log.debug( "StepResultsTAP" )
+        for line in self.stepCache.splitlines():
+            if re.search( " - PASS$", line ):
+                self.log.TAP( "    ok -- STEP %s" % line )
+            elif re.search( " - FAIL$", line ):
+                self.log.TAP( "    not ok -- STEP %s" % line )
+            elif re.search( " - No Result$", line ):
+                self.log.TAP( "    ok -- STEP %s # TODO: No assertion in test step" % line )
+            else:  # Should only be on fail message
+                self.log.TAP( "    # %s" % line )
+
     def parseStepResults( self, testCaseNumber ):
         """
         Parse throught the step results for the wiki
diff --git a/TestON/drivers/common/cli/hostdriver.py b/TestON/drivers/common/cli/hostdriver.py
index 3232361..ba8b1b9 100644
--- a/TestON/drivers/common/cli/hostdriver.py
+++ b/TestON/drivers/common/cli/hostdriver.py
@@ -125,7 +125,7 @@
                     for r in self.tempRoutes:
                         self.deleteRoute( *r )
                 # Disconnect from the host
-                if not self.options[ 'inband' ] == 'True':
+                if not self.options.get( 'inband', False ) == 'True':
                     self.handle.sendline( "" )
                     self.handle.expect( self.prompt )
                     self.handle.sendline( "exit" )
