test_writesame16_0blocks: Add support for WSNZ=1

Support for WRITE SAME with NUMBER OF LOGICAL BLOCKS = 0 is optional.
Hence set NUMBER OF LOGICAL BLOCKS to 0 if this value is supported
and set this parameter to 1 otherwise.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2014-08-17 18:12:48 +02:00
committed by Ronnie Sahlberg
parent d4ac9ef1b5
commit e8c4be8f62

View File

@@ -55,21 +55,21 @@ test_writesame16_0blocks(void)
logging(LOG_VERBOSE, "Test WRITESAME16 0-blocks one block past end-of-LUN");
ret = writesame16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1,
block_size, 0,
block_size, inq_bl->wsnz,
0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test WRITESAME16 0-blocks at LBA==2^63");
ret = writesame16_lbaoutofrange(iscsic, tgt_lun, 0x8000000000000000,
block_size, 0,
block_size, inq_bl->wsnz,
0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test WRITESAME16 0-blocks at LBA==-1");
ret = writesame16_lbaoutofrange(iscsic, tgt_lun, -1,
block_size, 0,
block_size, inq_bl->wsnz,
0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
}