Commit Graph

2234 Commits

Author SHA1 Message Date
Ronnie Sahlberg e5e8d7e3ef TESTS: Add a simple test for SANITIZE OVERWRITE 2013-05-26 11:48:45 -07:00
Ronnie Sahlberg 92b987de52 Add helpers for the SANITIZE service actions 2013-05-26 10:51:19 -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 fcbeb2858f REPORT_SUPPORTED_OPCODES, serviceaction is a 16 bit integer at offset 4, not a 32 bit integer 2013-05-19 09:47:45 -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 704e0f6448 SCSI: add a safe function to read a byte from the datain buffer and use it
throughout the unmarshalling code
2013-05-12 13:57:15 -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 772d220217 Add a version descriptor 2013-05-11 16:03:23 -07:00
Ronnie Sahlberg 3a31759fa4 Merge pull request #62 from bonzini/master
MD5 updates
2013-05-03 06:36:35 -07:00
Paolo Bonzini bcb2950d8d use libgcrypt for MD5
This makes sure that CHAP authentication is disabled if the system
is running in FIPS 140-2 mode.  MD5 is not a secure algorithm according
to the standard.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-03 12:51:15 +02:00
Paolo Bonzini cc742279d0 fix bug in md5 code 2013-05-03 12:50:58 +02: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
Ronnie Sahlberg b7dd6b533b TEST: Add a test that is cmdsn is too low the target just ignores the pdu 2013-04-30 19:05:23 -07:00
Ronnie Sahlberg 325360789e TEST: Improve the test for cmdsn too high with more documentation
and verify that the target did ignore the command and the session is still good.
2013-04-30 18:46:26 -07:00
Ronnie Sahlberg 1a275bbecc TEST: rename the cmdsn too high test 2013-04-30 18:32:09 -07:00
Ronnie Sahlberg 1165e06d19 Fix a bunch of typos 2013-04-29 21:02:40 -07:00
Ronnie Sahlberg 4a8d967541 Add support for synchronous command timeout.
Default to 0 meaning no timeout.

Implement a test for iSCS to test what happens if we send a command
with CMDSN being higher than the target allows.
In this case we dont strictly know what will happen, just that what should
NOT happen is the target responding with success.
But we have to be prepared for any kind of failure, including a timeout,
scsi sense, or even iscsi reject or session failure.
2013-04-29 20:42:33 -07:00
Ronnie Sahlberg 5bce69f1f3 TEST: rename the usb block device tests to usb-sbc 2013-04-27 20:39:30 -07:00
Ronnie Sahlberg f8e317c355 TESTS: READ6 is optional(==obsolete) 2013-04-27 16:22:58 -07:00
Ronnie Sahlberg 94d048afae TESTS: Persistent reserve in/out are optional 2013-04-27 14:09:19 -07:00
Ronnie Sahlberg 4222d5fcd7 TESTS: Add another level for the test hiearchy : Familt/Suite/Test
and add 4 basic families :  ALL, SCSI, iSCSI and USB-MEMORY-STICK
2013-04-27 13:57:57 -07:00
Ronnie Sahlberg 9d44644c63 TESTS: Move the tests for iscsi residuals to its own suite 2013-04-27 10:15:30 -07:00
Ronnie Sahlberg 2627a8845e TESTS: add a flag --usb so we can clamp all i/o to at most 120k
Add checks for maximum tranfer length to all commands that are limited
by BlockLimits/MTL
2013-04-27 09:59:59 -07:00
Ronnie Sahlberg c866787dcb TESTS: read12 is optional, should make test skip, not fail 2013-04-27 07:43:24 -07:00
Ronnie Sahlberg 227489d32b TESTS: fix PREFETCH10/16 tests 2013-04-26 18:01:04 -07:00
Ronnie Sahlberg 1331656f85 TESTS: ORWRITE is optional, lack os support should skip the test not fail it 2013-04-26 17:52:55 -07:00