Close session files opened by components created in the tests
Change-Id: I1a3ac33c0efee4a86bbd5419118436ece4ec6e8b
(cherry picked from commit a174f6bdd07ce9f546c97eef6419a844e497a523)
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 3a29d00..120d8c9 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -3750,10 +3750,14 @@
try:
# Disconnect from component
component.disconnect()
+ component.close_log_handles()
# Delete component
delattr( main, name )
# Delete component from ComponentDictionary
del( main.componentDictionary[ name ] )
+ except StandardError:
+ self.log.exception( "Exception while closing log files for " + name )
+ return main.FALSE
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
main.log.error( self.name + ": " + self.handle.before )
diff --git a/TestON/drivers/common/cli/emulator/mininetscapyclidriver.py b/TestON/drivers/common/cli/emulator/mininetscapyclidriver.py
index 4874c02..fa4518c 100644
--- a/TestON/drivers/common/cli/emulator/mininetscapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetscapyclidriver.py
@@ -218,11 +218,15 @@
try:
# Disconnect from component
component.disconnect()
+ component.close_log_handles()
# Delete component
delattr( main, name )
# Delete component from ComponentDictionary
del( main.componentDictionary[ name ] )
return main.TRUE
+ except StandardError:
+ self.log.exception( "Exception while closing log files for " + name )
+ return main.FALSE
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()