test-tool: replace some manual PDU tweaks with helper calls
For now this only changes iSCSIDataSnInvalid to use iscsi_pdu_set_datasn() instead of scsi_set_uint32(). iSCSICmdSnTooHigh/Low changes should also be possible, as noted, but haven't been converted yet. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -31,7 +31,10 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
|
||||
{
|
||||
switch (change_cmdsn) {
|
||||
case 1:
|
||||
/* change the cmdsn so it becomes too big */
|
||||
/*
|
||||
* change the cmdsn so it becomes too low. TODO: use
|
||||
* iscsi_pdu_set_cmdsn(), which also changes pdu->cmdsn?
|
||||
*/
|
||||
scsi_set_uint32(&pdu->outdata.data[24], iscsi->expcmdsn - 1);
|
||||
/* fudge the cmdsn value back to where it should be if this
|
||||
* pdu is ignored.
|
||||
@@ -40,12 +43,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
|
||||
break;
|
||||
}
|
||||
|
||||
change_cmdsn = 0;
|
||||
change_cmdsn = 0;
|
||||
return iscsi_drv_orig.queue_pdu(iscsi, pdu);
|
||||
}
|
||||
|
||||
void test_iscsi_cmdsn_toolow(void)
|
||||
{
|
||||
{
|
||||
int ret;
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
|
||||
Reference in New Issue
Block a user