TESTS: Fix WRITESAME tests to handle targets that don't like datalen == 0
Recent SBC specs say (when the WSNZ bit is set to one and the NUMBER OF LOGICAL BLOCKS field is set to zero) or (if MAXIMUM WRITE SAME LENGTH is greater than 0 and the number of logical blocks specified to be written exceeds the MAXIMUM WRITE SAME LENGTH) the server should terminate with CHECK CONDITION, set the sense key to ILLEGAL REQUEST and the additional sense code to INVALID FIELD IN CDB. Update the WRITESAME tests to cope with this.
This commit is contained in:
@@ -40,8 +40,13 @@ test_writesame16_0blocks(void)
|
||||
logging(LOG_NORMAL, "[SKIPPED] WRITESAME16 is not implemented.");
|
||||
CU_PASS("[SKIPPED] Target does not support WRITESAME16. Skipping test");
|
||||
return;
|
||||
} else if (ret == -3) {
|
||||
CU_PASS("[SKIPPED] Target does not support WRITESAME16 with NUMBER OF LOGICAL BLOCKS == 0");
|
||||
} else if (ret == -4) {
|
||||
CU_PASS("[SKIPPED] Number of WRITESAME16 logical blocks to be written exceeds MAXIMUM WRITE SAME LENGTH");
|
||||
} else {
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
logging(LOG_VERBOSE, "Test WRITESAME16 0-blocks one block past end-of-LUN");
|
||||
ret = writesame16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1,
|
||||
|
||||
Reference in New Issue
Block a user