Commit Graph

13 Commits

Author SHA1 Message Date
Ronnie Sahlberg
b4cdf07271 Add tests that BlockLimits VPD matches the AtomicWrite16 support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-09 06:49:51 -07:00
Bart Van Assche
30355f8cc0 test_inquiry_block_limits: Only query VPD page B2h if LBPME = 1
In the READ CAPACITY response support for logical block provisioning
is indicated via the LBPME (logical block provisioning management
enabled) bit. Since the logical block provisioning VPD page (B2h)
is optional, only query it if LBPME = 1.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:03:45 -07:00
Ronnie Sahlberg
d411f12bbc TESTS: tweak inquiry blocklimits test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 12:54:34 -07:00
Ronnie Sahlberg
072291c852 TESTS: change the function signatures for the helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:19:04 -07:00
Ronnie Sahlberg
9b768f7de9 TESTS: move the default url, lun and iscsi context into a structure
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 16:42:45 -07:00
Ronnie Sahlberg
9be6ddaf09 TESTS: update inquiry to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Edward Tomasz Napierala
5f46119899 Fix segv. 2013-10-12 23:51:16 +02:00
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