Commit Graph

6 Commits

Author SHA1 Message Date
Bart Van Assche
8da8cf8c4c Fix block limit tests
The tests currently verify whether two block limits are above 2**20. Change
these tests into <= 2**20.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-05-29 18:52:21 -07:00
Ronnie Sahlberg
864bf81c56 TESTS: Test that WRITESAME10/16 unmap can handle big number of logical blocks when unmapping.
If  BLockLimits->MaxWriteSameLength is 0 (no limit) or >=256
then verify that both WRITESAME10 and WRITESAME16 can unmap with a
number of blocks == 2 byte field.
If not, then verify that a 256 block unmap results in INVALID FIELD IN CDB

If  BLockLimits->MaxWriteSameLength is 0 (no limit) or >=65536
then verify that WRITESAME16 can unmap with a
number of blocks == 3 byte field.
If not, then verify that a 65536 block unmap results in INVALID FIELD IN CDB

From discussions on linux-scsi there are devices that support WRITESAME16
but where the implementation only looks at the low 2 bytes of the 4 bytes for
num-blocks in the CDB.
This added test aims to find and flag such devices.
2013-05-15 19:50:41 -07:00
Ronnie Sahlberg
30358ffd56 TESTS: BlockLimits VPD. If a device returns a SBC-3 VPD (page length 0x3c)
but does not claim SBC-3 support then print a harsh warning
about this.
2013-05-14 20:43:09 -07:00
Ronnie Sahlberg
c7238aa426 TESTS: Relax the tests for BlockLimit VPD page length.
Discussions on linux-scsi indicate that some SBC-2 devices may provide
some SBC-3 features and thus a SBC-3 BlockLimit page.

Supporting more than you claim is a transgression but a relatively minor
one, so lets turn a blind eye to it.
Supporting less than you claim is a serious transgression and will always
result in a harsh test failure.
2013-05-14 20:37:20 -07:00
Ronnie Sahlberg
dd46f3acf0 TESTS: Keep the LogicalBlockProvisioning VPD around after we read it during
test startup.
2013-05-14 20:25:42 -07:00
Ronnie Sahlberg
d166d27ab8 TESTS: Add a test to start verifying that the BlockLimits VPD page is correct.
Verify that the page length matches up with the size of the data in buffer.
Verify that page length is 0x3c if the device claims SBC-3,  and 0x0c if not.

If the device claims SBC-3 and if it claims UNMAP support (LBPU)
then we check that both MAXIMUM UNMAP LBA COUNT and
MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT looks sane.
Sane here means >0, <1M or 0xffffffff

If the device claims SBC-3 and if it does not claim UNMAP support (LBPU)
then we check that both MAXIMUM UNMAP LBA COUNT and
MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT are both 0.
2013-05-12 18:43:43 -07:00