File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,9 +40,14 @@ def setUp(self, handler=logging.StreamHandler()):
4040 self .services = self .testClient .getParsedTestDataConfig ()
4141 self .zone = get_zone (self .apiclient , self .testClient .getZoneForTests ())
4242 self .pod = get_pod (self .apiclient , self .zone .id )
43+ self .original_host_state_map = {}
4344 self .cleanup = []
4445
4546 def tearDown (self ):
47+ for host_id in self .original_host_state_map :
48+ state = self .original_host_state_map [host_id ]
49+ sql_query = "UPDATE host SET status = '" + state + "' WHERE uuid = '" + host_id + "'"
50+ self .dbConnection .execute (sql_query )
4651 super (TestHostPing , self ).tearDown ()
4752
4853 def checkHostStateInCloudstack (self , state , host_id ):
@@ -92,6 +97,7 @@ def test_01_host_ping_on_alert(self):
9297 self .logger .debug ('Hypervisor = {}' .format (host .id ))
9398
9499 hostToTest = listHost [0 ]
100+ self .original_host_state_map [hostToTest .id ] = hostToTest .state
95101 sql_query = "UPDATE host SET status = 'Alert' WHERE uuid = '" + hostToTest .id + "'"
96102 self .dbConnection .execute (sql_query )
97103
You can’t perform that action at this time.
0 commit comments