TEST: Add a test that is cmdsn is too low the target just ignores the pdu
This commit is contained in:
@@ -35,6 +35,10 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
|
||||
old_cmdsn = *(uint32_t *)&pdu->outdata.data[24];
|
||||
/* change the cmdsn so it becomes too big */
|
||||
*(uint32_t *)&pdu->outdata.data[24] = htonl(iscsi->maxcmdsn + 1);
|
||||
/* fudge the cmdsn value back to where it should be if this
|
||||
* pdu is ignored.
|
||||
*/
|
||||
iscsi->cmdsn--;
|
||||
break;
|
||||
case 2:
|
||||
*(uint32_t *)&pdu->outdata.data[24] = old_cmdsn;
|
||||
@@ -60,8 +64,8 @@ void test_iscsi_cmdsn_toohigh(void)
|
||||
iscsic->target_max_recv_data_segment_length = block_size;
|
||||
local_iscsi_queue_pdu = my_iscsi_queue_pdu;
|
||||
change_cmdsn = 1;
|
||||
/* we dont want autoreconnect since some targets will drop the
|
||||
* connection on this condition.
|
||||
/* we dont want autoreconnect since some targets will incorrectly
|
||||
* drop the connection on this condition.
|
||||
*/
|
||||
iscsi_set_noautoreconnect(iscsic, 1);
|
||||
iscsi_set_timeout(iscsic, 3);
|
||||
@@ -75,7 +79,6 @@ void test_iscsi_cmdsn_toohigh(void)
|
||||
}
|
||||
|
||||
|
||||
|
||||
iscsi_set_noautoreconnect(iscsic, 0);
|
||||
logging(LOG_VERBOSE, "Send a TESTUNITREADY with CMDSN == EXPCMDSN. should work again");
|
||||
change_cmdsn = 2;
|
||||
|
||||
Reference in New Issue
Block a user