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.
Ronnie Sahlberg
2013-05-29 19:21:39 -07:00
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)
Ronnie Sahlberg
2013-05-29 19:05:39 -07:00
7b011a5ee2
Fix scsi_cdb_read6()
Bart Van Assche
2013-05-29 18:07:20 +02:00
9dce01bbea
Fix PERSISTENT RESERVE IN / READ RESERVATION response unmarshalling
Bart Van Assche
2013-05-29 18:06:17 +02:00
0577fa9d66
Fix a buffer overflow in the code for unmarshalling the, PERSISTENT RESERVE IN / READ RESERVATION
Bart Van Assche
2013-05-29 18:05:22 +02:00
99a74310a2
Block Device Characteristics: Add decode of the rest of this page that was missing
Ronnie Sahlberg
2013-05-27 08:28:26 -07:00
10d101cf51
TESTS: Try reading the BlockDeviceCharacteristics VPD page on startup
Ronnie Sahlberg
2013-05-26 19:53:27 -07:00
b193e08be8
Tests: Update the SANITIZE tests
Ronnie Sahlberg
2013-05-26 19:36:35 -07:00
58dde352f1
Update SANITIZE OVERWRITE tests, test one block/half block and 4 byte initialization pattern.
Ronnie Sahlberg
2013-05-26 15:51:46 -07:00
1c832923c8
Add test that all undefined SANITIZE service actions return an error.
Ronnie Sahlberg
2013-05-26 15:30:26 -07:00
4e08d27031
Add tests from SANITIZE OVERWRITE parameter length
Ronnie Sahlberg
2013-05-26 15:21:43 -07:00
e5e8d7e3ef
TESTS: Add a simple test for SANITIZE OVERWRITE
Ronnie Sahlberg
2013-05-26 11:48:45 -07:00
92b987de52
Add helpers for the SANITIZE service actions
Ronnie Sahlberg
2013-05-26 10:51:19 -07:00
eebd04e613
Add initial support for SANITIZE and a simple test to generate this opcode.
Ronnie Sahlberg
2013-05-25 16:02:02 -07:00
28cc715a7c
TEST: INQUIRY, request 260 bytes of data when reading the standard VPD page. This is the maximum possible size of this page.
Ronnie Sahlberg
2013-05-25 06:53:48 -07:00
fcbeb2858f
REPORT_SUPPORTED_OPCODES, serviceaction is a 16 bit integer at offset 4, not a 32 bit integer
Ronnie Sahlberg
2013-05-19 09:47:45 -07:00
ec5855c6b2
fix incorrect check in test
Ronnie Sahlberg
2013-05-19 08:42:10 -07:00
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
Ronnie Sahlberg
2013-05-19 08:18:09 -07:00
c9ee8525b2
TESTS: Add a test for the reprot one command reporting options for REPORT SUPPORTED OPCODES.
Ronnie Sahlberg
2013-05-19 07:27:33 -07:00
d7acb5f128
remove extraneous and incorrect log message from a test
Ronnie Sahlberg
2013-05-18 16:34:08 -07:00
2753878cd3
TEST: REPORT SUPPORTED OPCODES, SERVACTV When this flag is clear then service action must be zero.
Ronnie Sahlberg
2013-05-18 16:31:16 -07:00
d34e28dc1a
TESTS: Improve the REPORT SUPPORTED OPCODES test for RCTD and also verify that the returned timeout descriptors have the correct length.
Ronnie Sahlberg
2013-05-18 14:00:25 -07:00
709410b1d7
TESTS: Add some REPORT SUPPORTED OPCODES tests
Ronnie Sahlberg
2013-05-18 13:56:02 -07:00
ce4623b2fb
READ SUPPORTED OPCODES. Update the signature to allow setting all of the parameters to this command.
Ronnie Sahlberg
2013-05-18 12:34:03 -07:00
c6754fe73b
TESTS: Writesame16_unmap test should call writesame16 not writesame10
Ronnie Sahlberg
2013-05-17 16:36:59 -07:00
864bf81c56
TESTS: Test that WRITESAME10/16 unmap can handle big number of logical blocks when unmapping.
Ronnie Sahlberg
2013-05-15 19:50:41 -07:00
8c22f8d986
TESTS: UNMAP/WRITESAME10/16 Check LBPRZ before we read the unmapped blocks and verify they are blank.
Ronnie Sahlberg
2013-05-15 17:10:20 -07:00
bdce246bc0
TESTS: Fix trying to free a NULL task.
Ronnie Sahlberg
2013-05-14 23:01:48 -07:00
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.
Ronnie Sahlberg
2013-05-14 22:55:05 -07:00
dc6c603106
TEST: Add SCSI.Unmap.UnmapVPD and see if UNMAP availability matches the VPD settings.
Ronnie Sahlberg
2013-05-14 22:35:57 -07:00
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.
Ronnie Sahlberg
2013-05-14 20:43:09 -07:00
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.
Ronnie Sahlberg
2013-05-14 20:37:20 -07:00
e9b79807ae
TESTS: Make READCAPACITY16PI test more verbose under -V
Ronnie Sahlberg
2013-05-14 20:29:20 -07:00
dd46f3acf0
TESTS: Keep the LogicalBlockProvisioning VPD around after we read it during test startup.
Ronnie Sahlberg
2013-05-14 20:25:42 -07:00
f49a1beb16
TEST: Add test for the protection information setting in READCAPACITY16
Ronnie Sahlberg
2013-05-13 20:03:56 -07:00
f9fb1e0ee3
TESTS: ReadCapacity16 is also mandatory in SBC-2 when INQ->PROTECT is set. Check for this in the support functions and return error.
Ronnie Sahlberg
2013-05-12 21:19:51 -07:00
d166d27ab8
TESTS: Add a test to start verifying that the BlockLimits VPD page is correct.
Ronnie Sahlberg
2013-05-12 18:43:43 -07:00
704e0f6448
SCSI: add a safe function to read a byte from the datain buffer and use it throughout the unmarshalling code
Ronnie Sahlberg
2013-05-12 13:57:15 -07:00
bd239db4fa
TEST: Add a test for inquiry version descriptors
Ronnie Sahlberg
2013-05-12 08:26:21 -07:00
ee689ee3fb
TESTS: Update the protection tests
Ronnie Sahlberg
2013-05-12 08:06:08 -07:00
67676d4756
TESTS: *protect field set to non-zero are only guaranteed to fail if the device does not support protection information
Ronnie Sahlberg
2013-05-11 17:27:35 -07:00
5135836ee5
TESTS: keep the unmarshalled std inq structure around
Ronnie Sahlberg
2013-05-11 17:07:59 -07:00
772d220217
Add a version descriptor
Ronnie Sahlberg
2013-05-11 16:03:23 -07:00
3a31759fa4
Merge pull request #62 from bonzini/master
Ronnie Sahlberg
2013-05-03 06:36:35 -07:00
bcb2950d8d
use libgcrypt for MD5
Paolo Bonzini
2013-05-03 12:47:12 +02:00
cc742279d0
fix bug in md5 code
Paolo Bonzini
2013-05-03 12:43:50 +02:00
d38cf7cfcd
TESTS: since we track expcmdsn we dont need to keep the old value around in a static variable
Ronnie Sahlberg
2013-04-30 19:17:59 -07:00
b7dd6b533b
TEST: Add a test that is cmdsn is too low the target just ignores the pdu
Ronnie Sahlberg
2013-04-30 19:05:23 -07:00
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.
Ronnie Sahlberg
2013-04-30 18:46:26 -07:00
1a275bbecc
TEST: rename the cmdsn too high test
Ronnie Sahlberg
2013-04-30 18:32:09 -07:00
1165e06d19
Fix a bunch of typos
Ronnie Sahlberg
2013-04-29 21:02:40 -07:00
4a8d967541
Add support for synchronous command timeout. Default to 0 meaning no timeout.
Ronnie Sahlberg
2013-04-29 20:42:33 -07:00
5bce69f1f3
TEST: rename the usb block device tests to usb-sbc
Ronnie Sahlberg
2013-04-27 20:39:30 -07:00
f8e317c355
TESTS: READ6 is optional(==obsolete)
Ronnie Sahlberg
2013-04-27 16:22:58 -07:00
94d048afae
TESTS: Persistent reserve in/out are optional
Ronnie Sahlberg
2013-04-27 14:09:19 -07:00
4222d5fcd7
TESTS: Add another level for the test hiearchy : Familt/Suite/Test and add 4 basic families : ALL, SCSI, iSCSI and USB-MEMORY-STICK
Ronnie Sahlberg
2013-04-27 13:57:57 -07:00
9d44644c63
TESTS: Move the tests for iscsi residuals to its own suite
Ronnie Sahlberg
2013-04-27 10:15:30 -07:00
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
Ronnie Sahlberg
2013-04-27 09:59:59 -07:00
c866787dcb
TESTS: read12 is optional, should make test skip, not fail
Ronnie Sahlberg
2013-04-27 07:43:24 -07:00
227489d32b
TESTS: fix PREFETCH10/16 tests
Ronnie Sahlberg
2013-04-26 18:01:04 -07:00
1331656f85
TESTS: ORWRITE is optional, lack os support should skip the test not fail it
Ronnie Sahlberg
2013-04-26 17:52:55 -07:00
78e02737c6
TESTS: fix some bugs in the tests for INQUIRY
Ronnie Sahlberg
2013-04-26 17:43:06 -07:00
e33194d94a
TESTS: WRITEVERIFY10/12/16 are all optional. Update the helpers to return -2/not supported on invalid operaction code. Update all tests to accept that the opcode might be missing and abort the test without failing.
Ronnie Sahlberg
2013-04-25 17:41:13 -07:00
b5804ee499
TESTS: Update WRITE10/12 to allow it to fail with invalid operation code. Both these opcodes are Optional in all SBC standards.
Ronnie Sahlberg
2013-04-23 21:29:25 -07:00
ee666ae451
TESTS: WRITE16 is optional so update the tests to allow WRITE16 to be missing and just make the test be [SKIPPED]
Ronnie Sahlberg
2013-04-23 21:15:28 -07:00
d280ce8ad7
Create safe 16/32/64 bit accessors for reading from the datain buffer and use it throughout the scsi lowlevel file.
Ronnie Sahlberg
2013-04-22 22:11:53 -07:00
0a026e2da7
AROS: We need emulation of readv/writev on aros
Ronnie Sahlberg
2013-04-22 18:50:05 -07:00
322be0cf24
add missing version descriptor
Ronnie Sahlberg
2013-04-22 18:34:02 -07:00
555906e76e
Revert "Add SSC to the version descriptors."
Ronnie Sahlberg
2013-04-22 18:32:09 -07:00
e640fa3cde
missing , broke compile
Ronnie Sahlberg
2013-04-22 18:28:20 -07:00
45f5fc2105
Add SSC to the version descriptors. I actually have a usb-stick that claims it supports SSC. I stongly doubt it.
Ronnie Sahlberg
2013-04-22 17:44:13 -07:00
284514b14e
fix typo
Ronnie Sahlberg
2013-04-22 17:38:10 -07:00
79f54c5e06
TESTS update all read16 tests to fail/skip on illegal opcode depending on whether the device claims support for it or not (mandatory in sbc-3, optional prior)
Ronnie Sahlberg
2013-04-22 17:31:50 -07:00
77ff1b1808
TESTS: make the "is readcapacity16 supported on this device" tests cleaner
Ronnie Sahlberg
2013-04-22 17:11:38 -07:00
af6d1c9c13
Add a test for mandatory opcodes for SBC devices.
Ronnie Sahlberg
2013-04-21 14:50:41 -07:00
91a98d6b92
Add handling of inquiry version descriptors
Ronnie Sahlberg
2013-04-21 14:04:30 -07:00
b3ca40efbe
Get rid of the popt dependency
Ronnie Sahlberg
2013-04-21 10:25:30 -07:00
a048079c90
covnert the old test suite grom popt to getopt_long
Ronnie Sahlberg
2013-04-21 10:19:40 -07:00
ecfe404316
iscsi-support.c does not need popt.h
Ronnie Sahlberg
2013-04-21 10:03:34 -07:00
1c5d132ed0
convert iscsi-dd to use getopt_long()
Ronnie Sahlberg
2013-04-21 10:02:05 -07:00
f5d25c0157
ISCSI-READCAPACITY16 convert to getopt_long()
Ronnie Sahlberg
2013-04-21 09:58:15 -07:00
c3886cf9c4
ISCSI-INQ: convert to getopt_long instead of popt
Ronnie Sahlberg
2013-04-21 09:53:12 -07:00
c0d1c122c3
ISCSI-LS : Change from popt to the slightly less portable getopt_long
Ronnie Sahlberg
2013-04-21 09:44:23 -07:00
622b38d679
Add support for AROS
Ronnie Sahlberg
2013-04-18 19:45:17 -07:00
402653b9f3
portability updates
Ronnie Sahlberg
2013-04-18 19:43:36 -07:00
fbf58ead9f
TESTS: When task management functions fail, print the reason why it failed.
Ronnie Sahlberg
2013-03-27 17:25:47 -07:00
aac7ed29b8
SYNC Task mgmt functions. Return !0 status if the command completed successfully but the target responded with non-zero response code.
Ronnie Sahlberg
2013-03-26 17:38:47 -07:00
d6f4c4d259
TESTS update reserve6 tests
Ronnie Sahlberg
2013-03-25 17:49:11 -07:00
2873b18bb7
TESTS: Add tests to verify that RELEASE6 is dropped on target/lun reset
Ronnie Sahlberg
2013-03-25 17:42:24 -07:00
1f54a3068c
TESTS: Add tests for residuals for WRITEVERIFY10/12/16
Ronnie Sahlberg
2013-03-24 09:29:03 -07:00
641cc997c1
TESTS: Improve WRITE* residual tests and also check that we dont write too much if iSCSI EDTL < SCSI TL
Ronnie Sahlberg
2013-03-24 09:10:01 -07:00
e1f15c8464
TESTS: Add tests that WRITE10/12/16 handle residuals correctly
Ronnie Sahlberg
2013-03-24 08:56:23 -07:00
7cfcf32591
TESTS: Add tests for READ12/16 residuals
Ronnie Sahlberg
2013-03-23 15:50:57 -07:00
a95a83764a
TESTS: fixup a log message to be nore accurate
Ronnie Sahlberg
2013-03-23 15:32:05 -07:00
5b29ad2ddf
TESTS: Add test for READ10 to check that over/underflow residuals are generated correctly.
Ronnie Sahlberg
2013-03-23 12:44:55 -07:00
808eed9680
Make task->residual a size_t instead of an int Update and improve the log messages for failures for the read10 invalid test
Ronnie Sahlberg
2013-03-23 11:23:02 -07:00
2d10d0a2d8
TESTS: Update the "invalid read10" test with better description and logging of what exactly it tests
Ronnie Sahlberg
2013-03-23 10:35:39 -07:00
3e358bb192
TESTS: in RESERVE6 test, allow slow targets 3 seconds to notice the nexus loss and drop the reservation
Ronnie Sahlberg
2013-03-23 10:13:03 -07:00
510883f28f
fix reregister to check for resvn conflict
Lee Duncan
2013-03-22 15:43:29 -07:00