def test_get_iscsi_persistent_logins(self): self._mock_ctypes() _get_iscsi_persistent_logins = _utils.get_wrapped_function( self._initiator._get_iscsi_persistent_logins) _get_iscsi_persistent_logins(self._initiator, buff=mock.sentinel.buff, buff_size=mock.sentinel.buff_size, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.ReportIScsiPersistentLoginsW, self._ctypes.byref(mock.sentinel.element_count), mock.sentinel.buff, self._ctypes.byref(mock.sentinel.buff_size))
def test_get_iscsi_session_devices(self): self._mock_ctypes() _get_iscsi_session_devices = _utils.get_wrapped_function( self._initiator._get_iscsi_session_devices) _get_iscsi_session_devices(self._initiator, mock.sentinel.session_id, buff=mock.sentinel.buff, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.GetDevicesForIScsiSessionW, self._ctypes.byref(mock.sentinel.session_id), self._ctypes.byref(mock.sentinel.element_count), self._ctypes.byref(mock.sentinel.buff))
def test_get_iscsi_sessions(self): self._mock_ctypes() _get_iscsi_sessions = _utils.get_wrapped_function( self._initiator._get_iscsi_sessions) _get_iscsi_sessions(self._initiator, buff=mock.sentinel.buff, buff_size=mock.sentinel.buff_size, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.GetIScsiSessionListW, self._ctypes.byref(mock.sentinel.buff_size), self._ctypes.byref(mock.sentinel.element_count), self._ctypes.byref(mock.sentinel.buff))
def test_get_iscsi_session_devices(self): self._mock_ctypes() _get_iscsi_session_devices = _utils.get_wrapped_function( self._initiator._get_iscsi_session_devices) _get_iscsi_session_devices( self._initiator, mock.sentinel.session_id, buff=mock.sentinel.buff, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.GetDevicesForIScsiSessionW, self._ctypes.byref(mock.sentinel.session_id), self._ctypes.byref(mock.sentinel.element_count), self._ctypes.byref(mock.sentinel.buff))
def test_get_iscsi_sessions(self): self._mock_ctypes() _get_iscsi_sessions = _utils.get_wrapped_function( self._initiator._get_iscsi_sessions) _get_iscsi_sessions( self._initiator, buff=mock.sentinel.buff, buff_size=mock.sentinel.buff_size, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.GetIScsiSessionListW, self._ctypes.byref(mock.sentinel.buff_size), self._ctypes.byref(mock.sentinel.element_count), self._ctypes.byref(mock.sentinel.buff))
def test_get_iscsi_persistent_logins(self): self._mock_ctypes() _get_iscsi_persistent_logins = _utils.get_wrapped_function( self._initiator._get_iscsi_persistent_logins) _get_iscsi_persistent_logins( self._initiator, buff=mock.sentinel.buff, buff_size=mock.sentinel.buff_size, element_count=mock.sentinel.element_count) self._mock_run.assert_called_once_with( self._iscsidsc.ReportIScsiPersistentLoginsW, self._ctypes.byref(mock.sentinel.element_count), self._ctypes.byref(mock.sentinel.buff), self._ctypes.byref(mock.sentinel.buff_size))
def test_get_initiators(self, mock_parse_string_list): self._mock_ctypes() get_initiators = _utils.get_wrapped_function( self._initiator.get_iscsi_initiators) mock_el_count = mock.Mock(value=mock.sentinel.element_count) resulted_initator_list = get_initiators(self._initiator, element_count=mock_el_count, buff=mock.sentinel.buff) self.assertEqual(mock_parse_string_list.return_value, resulted_initator_list) self._mock_run.assert_called_once_with( self._iscsidsc.ReportIScsiInitiatorListW, self._ctypes.byref(mock_el_count), mock.sentinel.buff) mock_parse_string_list.assert_called_once_with( mock.sentinel.buff, mock.sentinel.element_count)
def test_get_targets(self, mock_parse_string_list): self._mock_ctypes() get_targets = _utils.get_wrapped_function(self._initiator.get_targets) mock_el_count = mock.Mock(value=mock.sentinel.element_count) resulted_target_list = get_targets( self._initiator, forced_update=mock.sentinel.forced_update, element_count=mock_el_count, buff=mock.sentinel.buff) self.assertEqual(mock_parse_string_list.return_value, resulted_target_list) self._mock_run.assert_called_once_with( self._iscsidsc.ReportIScsiTargetsW, mock.sentinel.forced_update, self._ctypes.byref(mock_el_count), self._ctypes.byref(mock.sentinel.buff)) mock_parse_string_list.assert_called_once_with( mock.sentinel.buff, mock.sentinel.element_count)
def test_get_initiators(self, mock_parse_string_list): self._mock_ctypes() get_initiators = _utils.get_wrapped_function( self._initiator.get_iscsi_initiators) mock_el_count = mock.Mock(value=mock.sentinel.element_count) resulted_initator_list = get_initiators( self._initiator, element_count=mock_el_count, buff=mock.sentinel.buff) self.assertEqual(mock_parse_string_list.return_value, resulted_initator_list) self._mock_run.assert_called_once_with( self._iscsidsc.ReportIScsiInitiatorListW, self._ctypes.byref(mock_el_count), self._ctypes.byref(mock.sentinel.buff)) mock_parse_string_list.assert_called_once_with( mock.sentinel.buff, mock.sentinel.element_count)