[ONOS-6901] Fix how the systemTest does not return any result when it forced to quit the test
Change-Id: If93c48d46e8dc2494046b42de21f732775d7f520
diff --git a/TestON/core/teston.py b/TestON/core/teston.py
index 3030f3f..0f45e04 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -754,6 +754,17 @@
os.system( "stty sane" ) # fix format if necessary
sys.exit()
+ def cleanAndExit( self ):
+ """
+ It will set the testcase result to be FAILED and update it
+ before cleaning up and exitting the test.
+ :return:
+ """
+ if self.CurrentTestCaseNumber:
+ self.testCaseResult[ str( self.CurrentTestCaseNumber ) ] = self.FALSE
+ self.logger.updateCaseResults( self )
+ self.cleanup()
+ self.exit()
def stop( self, email=False ):
"""
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index be15bc1..ed37ae3 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -336,12 +336,10 @@
return ret
except AssertionError:
main.log.exception( "Invalid arguements for retry: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
except Exception:
main.log.exception( "Uncaught exception in retry: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if __name__ != "__main__":