Commit Graph

385 Commits

Author SHA1 Message Date
Bart Van Assche
12f93b60c7 Retry RESERVE6/RELEASE6 upon BUS RESET UA
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-06-08 07:45:18 -07:00
Ronnie Sahlberg
12a7d2f60d TEST: update SANITIZE test output 2013-06-02 16:37:56 -07:00
Ronnie Sahlberg
dd44a62994 typo 2013-06-01 09:02:04 -07:00
Ronnie Sahlberg
44e64fb8cf TESTS: SANITIZE. Produce warnings if WABEREQ does not match BLOCK ERASE support status 2013-06-01 08:59:37 -07:00
Ronnie Sahlberg
804ab643a3 TESTS: SANITIZE tests. Print additional warnings.
If SANITIZE is supported but we dont have the BlockDeviceCharacteristics
page we produce a warning.
If OVERWRITE is supported on SSDs we warn.
If BLOCK ERASE is supported on HDDs we warn.
2013-06-01 08:53:54 -07:00
Ronnie Sahlberg
7d413da22c TESTS: Print NORMAL log level by default 2013-06-01 08:47:05 -07:00
Ronnie Sahlberg
cb793f01f3 TESTS: Fix typo. s/allow_sanitize/allow-sanitize/g 2013-06-01 08:40:43 -07:00
Ronnie Sahlberg
595b7043b7 TESTS: fix test for modesense6 residuals. We never get overflow
but we get underflow if less than EDTL was returned
2013-06-01 07:57:31 -07:00
Ronnie Sahlberg
a16dd132db TESTS: Add a test and verify we dont get residuals for MODE SENSE 6 2013-05-30 22:01:25 -07:00
Ronnie Sahlberg
3766067328 TESTS: Add a simple test for MODESENSE6 that we can read it and we get at least 3 bydet of mode data (minimum size, header only) 2013-05-30 21:40:52 -07:00
Ronnie Sahlberg
5494580b4a TEST: READ6 add a test to verify that READ6 with transferlength
gets 256 blocks of data back from the target.
2013-05-30 19:16:57 -07:00
Ronnie Sahlberg
5713c2d363 TESTS: Initialize is_usb or else it will be very seldom that is_usb==0 and thus we dont truncate the transferlengths 2013-05-30 19:04:58 -07:00
Ronnie Sahlberg
b95f44a4ff Type: print correct sizes we test for for std inquiry page 2013-05-29 19:26:11 -07:00
Ronnie Sahlberg
c9a01c4c1f TESTS: For the inquiry test for whether a target only looks at the low
order byte of the two byte transfer length field or not.
Since the maximum size of a std vpd page takes 260 bytes to transfer
and some targets send this much,  testing and comparing the returned buffer
between allocation length == 255 and == 256 doesnt work.
Instead change test to verify that allocation length 511 and 512 returns the same amount and content of data.

This test then still allows finding targets that only look at the low order byte
(which is 0xff for 511   but is 0 for 512)
2013-05-29 19:21:39 -07:00
Ronnie Sahlberg
b5a31571dc TESTS: Remove the READ6 0-blocks test.
Since you can not request a read for 0 blocks with READ6
this test makes no sense.
(transfer length ==0  means 256 blocks for READ6)
2013-05-29 19:05:39 -07: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
10d101cf51 TESTS: Try reading the BlockDeviceCharacteristics VPD page on startup 2013-05-26 19:53:27 -07:00
Ronnie Sahlberg
b193e08be8 Tests: Update the SANITIZE tests 2013-05-26 19:36:35 -07:00
Ronnie Sahlberg
58dde352f1 Update SANITIZE OVERWRITE tests, test one block/half block and 4 byte
initialization pattern.
2013-05-26 15:51:46 -07:00
Ronnie Sahlberg
1c832923c8 Add test that all undefined SANITIZE service actions return an error. 2013-05-26 15:30:26 -07:00
Ronnie Sahlberg
4e08d27031 Add tests from SANITIZE OVERWRITE parameter length 2013-05-26 15:21:43 -07:00
Ronnie Sahlberg
e5e8d7e3ef TESTS: Add a simple test for SANITIZE OVERWRITE 2013-05-26 11:48:45 -07:00
Ronnie Sahlberg
eebd04e613 Add initial support for SANITIZE and a simple test to generate this opcode. 2013-05-25 16:02:02 -07:00
Ronnie Sahlberg
28cc715a7c TEST: INQUIRY, request 260 bytes of data when reading the standard VPD page.
This is the maximum possible size of this page.

Previouslly we only read the arbitrary 255 bytes of page, but for targets
that return >255 bytes of data this would then incorrectly make the test fail
since the data-in buffer was truncated and thus the inq->additional_length
no longer matched up with the datain buffer size.

Now reading up to 260 bytes will avoid the datain buffer from ever becomming truncated, and as a second feature also make sure to test that the target
understands > 8-bit values for the allocation length in the request.
2013-05-25 06:53:48 -07:00
Ronnie Sahlberg
ec5855c6b2 fix incorrect check in test 2013-05-19 08:42:10 -07:00
Ronnie Sahlberg
4df179bfd4 TESTS: Add checks for CDB sanity to REPORT SUPPORTED OPCODES
Read all individual opcodes and check that CDB length > 0  and that
CDB[0] Usage Data is 0xFF
2013-05-19 08:18:09 -07:00
Ronnie Sahlberg
c9ee8525b2 TESTS: Add a test for the reprot one command reporting options for
REPORT SUPPORTED OPCODES.

Opcodes that are listed in the full list of all supported opcodes as taking
a service action should work to ask reporting option 2 (uses service action)
from  but fail when asked for option 1 (no service action)

Similarly, opcodes that are flagged as not taking a service action should
work when used with option 1 but fail with option 2.
2013-05-19 07:27:33 -07:00
Ronnie Sahlberg
d7acb5f128 remove extraneous and incorrect log message from a test 2013-05-18 16:34:08 -07:00
Ronnie Sahlberg
2753878cd3 TEST: REPORT SUPPORTED OPCODES, SERVACTV
When this flag is clear then service action must be zero.
2013-05-18 16:31:16 -07:00
Ronnie Sahlberg
d34e28dc1a TESTS: Improve the REPORT SUPPORTED OPCODES test for RCTD and also verify that
the returned timeout descriptors have the correct length.
2013-05-18 14:00:25 -07:00
Ronnie Sahlberg
709410b1d7 TESTS: Add some REPORT SUPPORTED OPCODES tests
Add a simple test that it works or is not implemented.

Add a RCTD test to verify that with this flag clear we get command descriptors without CTDP set  and with it set we get command descriptors with CTDP set and a timeout descriptor
2013-05-18 13:56:02 -07:00
Ronnie Sahlberg
ce4623b2fb READ SUPPORTED OPCODES. Update the signature to allow setting all of the
parameters to this command.
2013-05-18 12:34:03 -07:00
Ronnie Sahlberg
c6754fe73b TESTS: Writesame16_unmap test should call writesame16 not writesame10 2013-05-17 16:36:59 -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
8c22f8d986 TESTS: UNMAP/WRITESAME10/16 Check LBPRZ before we read the unmapped blocks and verify they are blank. 2013-05-15 17:10:20 -07:00
Ronnie Sahlberg
bdce246bc0 TESTS: Fix trying to free a NULL task. 2013-05-14 23:01:48 -07:00
Ronnie Sahlberg
e28a94ce77 TESTS: Add tests for WriteSame10/16 UNMAP.
If UNMAP is available, verify that both LBPME and LBPWS[10] are set.
If unmap is not available, verify that LBPWS[10] is clear.
2013-05-14 22:55:05 -07:00
Ronnie Sahlberg
dc6c603106 TEST: Add SCSI.Unmap.UnmapVPD and see if UNMAP availability matches
the VPD settings.

If UNMAP is not available then LBPU must be clear
and if UNMAP is available then both LBPME and LBPU must be set.
2013-05-14 22:35:57 -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
e9b79807ae TESTS: Make READCAPACITY16PI test more verbose under -V 2013-05-14 20:29: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
f49a1beb16 TEST: Add test for the protection information setting in READCAPACITY16
If the device does not support PI (INQ->PROTECT) then
verify that PROT_EN, P_TYPE and P_I_EXP are all zero.

If the device does support PI and IF PROT_EN is clear
then verify that both P_TYPE and P_I_EXP are zero.

If the device does support PI and IF PROT_EN is set
then verify that P_TYPE is 0, 1 or 2
2013-05-13 20:03:56 -07:00
Ronnie Sahlberg
f9fb1e0ee3 TESTS: ReadCapacity16 is also mandatory in SBC-2 when INQ->PROTECT is set.
Check for this in the support functions and return error.
2013-05-12 21:19:51 -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
Ronnie Sahlberg
bd239db4fa TEST: Add a test for inquiry version descriptors
Block devices should claim at least some version of SPC and SBC
2013-05-12 08:26:21 -07:00
Ronnie Sahlberg
ee689ee3fb TESTS: Update the protection tests 2013-05-12 08:06:08 -07:00
Ronnie Sahlberg
67676d4756 TESTS: *protect field set to non-zero are only guaranteed to fail if the device does not support protection information 2013-05-11 17:27:35 -07:00
Ronnie Sahlberg
5135836ee5 TESTS: keep the unmarshalled std inq structure around 2013-05-11 17:07:59 -07:00
Ronnie Sahlberg
d38cf7cfcd TESTS: since we track expcmdsn we dont need to keep the old value around in a static variable 2013-04-30 19:17:59 -07:00