From ad5872c1d52f670cb33b00643e65c8d7eb289e84 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 21 Aug 2014 14:46:07 +0200 Subject: [PATCH] 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 --- test-tool/test_writesame10_unmap_unaligned.c | 8 ++++---- test-tool/test_writesame16_unmap_unaligned.c | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test-tool/test_writesame10_unmap_unaligned.c b/test-tool/test_writesame10_unmap_unaligned.c index 35ce236..9085500 100644 --- a/test-tool/test_writesame10_unmap_unaligned.c +++ b/test-tool/test_writesame10_unmap_unaligned.c @@ -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); } } diff --git a/test-tool/test_writesame16_unmap_unaligned.c b/test-tool/test_writesame16_unmap_unaligned.c index d1bc44f..41d8ab5 100644 --- a/test-tool/test_writesame16_unmap_unaligned.c +++ b/test-tool/test_writesame16_unmap_unaligned.c @@ -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");