def test_wait_for_ris_firmware_update_to_complete_for_very_quick_update( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | get_firmware_update_progress_mock.side_effect = [('COMPLETED', 100)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(1, get_firmware_update_progress_mock.call_count)
def test_wait_for_ris_firmware_update_to_complete_ok( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | get_firmware_update_progress_mock.side_effect = [('PROGRESSING', 25), ('COMPLETED', 100)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(2, get_firmware_update_progress_mock.call_count)
def test_wait_for_ris_firmware_update_to_complete_retry_on_exception( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | exc = exception.IloError('error') get_firmware_update_progress_mock.side_effect = [('PROGRESSING', 25), exc, ('COMPLETED', 100)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(3, get_firmware_update_progress_mock.call_count)
def test_wait_for_ris_firmware_update_to_complete_retry_on_exception( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | exc = exception.IloError('error') get_firmware_update_progress_mock.side_effect = [('PROGRESSING', 25), exc, ('COMPLETED', 100)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(3, get_firmware_update_progress_mock.call_count)
def test_wait_for_ris_firmware_update_to_complete_multiple_retries( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | get_firmware_update_progress_mock.side_effect = [('IDLE', 0), ('PROGRESSING', 25), ('PROGRESSING', 50), ('PROGRESSING', 75), ('ERROR', 0)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(5, get_firmware_update_progress_mock.call_count)
def test_wait_for_ris_firmware_update_to_complete_multiple_retries( self, get_firmware_update_progress_mock, sleep_mock): # | GIVEN | get_firmware_update_progress_mock.side_effect = [('IDLE', 0), ('PROGRESSING', 25), ('PROGRESSING', 50), ('PROGRESSING', 75), ('ERROR', 0)] # | WHEN | common.wait_for_ris_firmware_update_to_complete(self.ris) # | THEN | self.assertEqual(5, get_firmware_update_progress_mock.call_count)