test_writesame*_0blocks: skip 0-block test if unsupported

Skip 0-block WRITE SAME tests for targets that don't support these
operations, ie. they have write_same_no_zero (WSNZ) set in the
block limits vpd.

Also, fix the test:
  "Test WRITESAME10 of 1-256 blocks at the end of the LUN by setting
number-of-blocks==0"
to actually pass 0 blocks instead of the number of remaining blocks to the end.

Signed-off-by: Chris Zankel <chris@zankel.net>
This commit is contained in:
Chris Zankel
2015-04-22 18:05:13 -07:00
parent 9068f23f95
commit fff67ba7dd
4 changed files with 38 additions and 14 deletions

View File

@@ -39,6 +39,12 @@ test_writesame16_unmap_until_end(void)
CHECK_FOR_LBPWS;
CHECK_FOR_SBC;
if (inq_bl->wsnz) {
logging(LOG_NORMAL, "[SKIPPED] WRITESAME10 does not support 0-blocks.");
CU_PASS("[SKIPPED] WRITESAME10 does not support 0-blocks.");
return;
}
zeroBlock = alloca(block_size);
memset(zeroBlock, 0, block_size);