Fix test_writesame1[06]_unmap_unaligned()

As far as I know SPC-4 does not allow unaligned unmap requests to
fail. The only phrase I found in SPC-4 about unaligned unmap
requests is the following: "An unmap request with a starting LBA
that is not optimal may result in unmap operations on fewer LBAs
than requested." Hence check that unaligned unmap requests succeed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2014-08-21 14:46:07 +02:00
committed by Ronnie Sahlberg
parent ded75ae18a
commit ad5872c1d5
2 changed files with 7 additions and 8 deletions

View File

@@ -38,12 +38,12 @@ test_writesame10_unmap_unaligned(void)
CHECK_FOR_SBC;
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that unaligned WRITESAME10 Unmap fails. LBPPB==%d", lbppb);
logging(LOG_VERBOSE, "Test that unaligned WRITESAME10 Unmap succeeds. LBPPB==%d", lbppb);
for (i = 1; i < lbppb; i++) {
logging(LOG_VERBOSE, "Unmap %d blocks using WRITESAME10 at LBA:%d", lbppb - i, i);
ret = writesame10_invalidfieldincdb(iscsic, tgt_lun, i,
block_size, lbppb - i,
0, 1, 0, 0, buf);
ret = writesame10(iscsic, tgt_lun, i,
block_size, lbppb - i,
0, 1, 0, 0, buf);
CU_ASSERT_EQUAL(ret, 0);
}
}

View File

@@ -37,13 +37,12 @@ test_writesame16_unmap_unaligned(void)
CHECK_FOR_SBC;
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that unaligned WRITESAME16 Unmap fails. LBPPB==%d", lbppb);
logging(LOG_VERBOSE, "Test that unaligned WRITESAME16 Unmap succeeds. LBPPB==%d", lbppb);
for (i = 1; i < lbppb; i++) {
logging(LOG_VERBOSE, "Unmap %d blocks using WRITESAME16 at LBA:%d", lbppb - i, i);
ret = writesame16_invalidfieldincdb(iscsic, tgt_lun, i,
block_size, lbppb - i,
0, 1, 0, 0, NULL);
ret = writesame16(iscsic, tgt_lun, i, 0, lbppb - i,
0, 1, 0, 0, NULL);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITESAME16 is not implemented.");
CU_PASS("[SKIPPED] Target does not support WRITESAME16. Skipping test");