Commit Graph

1304 Commits

Author SHA1 Message Date
Ronnie Sahlberg
3aef8a0d4f README: mention that we can test against /dev/sg devices
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-21 15:14:29 -08:00
Ronnie Sahlberg
7865a8a26e Merge branch 'sgio' 2014-12-21 15:07:40 -08:00
Ronnie Sahlberg
646c8b963d New version 1.13.0
- Fix UNMAP tests
 - Build updates
 - Check residuals also when status != GOOD
 - Add WSNZ bit to the tests
 - Various test updates
 - Fix bug in scsi_create_task so it sets cdb_len correctly
 - Add a getter function for scsi task status and sense
 - Fixes and workarounds for Dell Equallogic issues
 - Be more flexible when allowing for unit attentions during connect time

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-21 14:58:46 -08:00
Ronnie Sahlberg
8c4a579cda SCSI: scsi_task_get_status add getter function for task status and sense
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-19 08:33:21 -08:00
Ronnie Sahlberg
0c6e3bffb3 SCSI: scsi_create_task must set task->cdb_size
We forgot to set task->cdb_size which means all tasks we create with this
function becomes test unit ready :-(

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-18 09:20:17 -08:00
Ronnie Sahlberg
9eabebd78a iscsi.h: remove obsolete scsi_get_data_[in|out]_buffer symbols
These two functions do not exist. Remove them from the header.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-18 05:51:23 -08:00
Ronnie Sahlberg
e07498e5c3 connect.c: improve the error message when iscsi_connect_async fails
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-12-07 10:08:38 -08:00
Ronnie Sahlberg
fc601fd228 Merge pull request #140 from plieven/vc
pdu: add workaround for DELL Equallogic FW bugs 71409 & 73732
2014-10-29 12:59:27 -07:00
Peter Lieven
ac46262afa pdu: add workaround for DELL Equallogic FW bugs 71409 & 73732
Dell Equallogic storages may redirect connections from one member of a multi member storage
group to another. When the member that has the volume lead changes the storage issues
an async disconnect request message. The correct behaviour would be to either fail all I/O requests
with a check condition (waiting for logout) or fullfil requests until the time specified
in the disconnect request message has elapsed and then drop the connection. In firwamre 7.x
however the storage sometimes cancels requests with SENSE KEY:ILLEGAL_REQUEST(5)
ASCQ:LOGICAL_UNIT_NOT_SUPPORTED(0x2500). This leads to I/O errors propagated to the application.
This patch was reported in May 2014 to Dell and the initial bug 71409 has been fixed in 7.0.7.
However, the first fix did not entirely solve the problem and bug 73732 has been raised.

This patch adds an environment variable LIBISCSI_DROP_CONN_ON_ASYNC_EVENT1 which if set leads
to an immediate drop of the connection when such an async event is received. This is ugly, but
works around the I/O errors.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-10-28 09:20:05 +01:00
Ronnie Sahlberg
3d6c2be342 configure: only build the test tool and ld-iscsi iff we have shared libraries
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-10-22 17:44:03 -07:00
Ronnie Sahlberg
58f06b0e74 TESTS: get rid of a sanitize helper
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-10-14 19:39:27 -07:00
Ronnie Sahlberg
8ac7d64082 TESTS: convert most of SANITIZE to new saner api
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-10-14 19:25:17 -07:00
Bart Van Assche
fe9620092c test tool: Detect unsupported opcodes correctly
There is no agreement among the T10 committee whether a SCSI target should
report "invalid opcode", "invalid field in CDB" or "invalid field in
parameter list" if the opcode consists of two bytes. Hence accept all three
sense codes for two-byte opcodes. For more information see also Frederick
Knight, RE: INVALID COMMAND OPERATION CODE, T10 Reflector, 16 May 2008
(http://t10.org/ftp/t10/t10r/2008/r0805167.htm).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:51:56 -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
Bart Van Assche
eee66727a7 test_iscsi_datasn_invalid: Make terminology consistent with RFC 3720
According to RFC 3720 the data associated with a SCSI WRITE command
is sent via Data-Out PDU's. Update log texts accordingly and also
make the capitalization of DataSN consistent with RFC 3720.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:02:48 -07:00
Bart Van Assche
0763dc5743 libiscsi: Clear PS bit before sending MODE SELECT
A quote from SPC-4: "When using the MODE SENSE command, a
parameters saveable (PS) bit set to one indicates that the mode
page may be saved by the logical unit in a nonvolatile, vendor
specific location. A PS bit set to zero indicates that the device
server is not able to save the supported parameters. When using
the MODE SELECT command, the PS bit is reserved."

Hence clear the PS bit after having queried a mode page via MODE
SENSE and before changing it via MODE SELECT.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 17:56:40 -07:00
Ronnie Sahlberg
14461757c4 TESTS: Allow Hardware/Software write protect as valid ASCQ
Add 0x2701/0x2702 to the list of valid ASCQ values we accept for devices
that are write protected.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-10-08 06:23:43 -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
f3205bb095 scsi-lowlevel.c: check that task/datain are valid before we unmarshalling
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 09:49:52 -07:00
Ronnie Sahlberg
9e514fbf44 scsi-lowlevel.c: check that task/datain are valid before we unmarshalling
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 09:48:16 -07:00
Ronnie Sahlberg
edbfb12232 TESTS: Allow inquiry data to contain padding IFF it is all zero
Some implementations may send oversized data coming back from Inquiry.
Warn about this instead of failing the test but then perform additional
checks that the padding MUST be zero or else fail the test.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 09:27:02 -07:00
Ronnie Sahlberg
45d87238e2 TESTS: Flag a whole bunch of tests as not supported on non-iSCSI backends
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 08:58:24 -07:00
Ronnie Sahlberg
abbf9a11b0 TESTS: change modeselect to become /dev/sg-aware
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 08:10:14 -07:00
Ronnie Sahlberg
0666691b2a TESTS: pass an actual block to the ritesame16/0blocks test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 20:57:59 -07:00
Ronnie Sahlberg
5f9444b91a libiscsi.def: we do not need to specify scsi_cdb_compareandwrite twice
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 17:27:08 -07:00
Ronnie Sahlberg
ed238f1e69 Merge branch 'master' into sgio 2014-09-23 17:26:02 -07:00
Ronnie Sahlberg
f6d57ef3b0 connect.c: remove UA whitelist and just consume up to 10 UAs before failing
Lets not use a whitelist of UnitAttentions that we consume during the connect
phase. Instead we can just loop and fail after the 10th.
If there are more than 10 UAs then we have a problem, otherwise
just consume them all, forget them  and then pass control back to the caller.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 17:23:27 -07:00
Ronnie Sahlberg
47d7e4b0ac TESTS: make sure ascq_ok is initialized
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:30:40 -07:00
Ronnie Sahlberg
839276dd7c TESTS: fix memory leaks in report supported opcodes tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:24:41 -07:00
Ronnie Sahlberg
264ea509c8 iscsi-support.c: fix memory leaks. Thanks valgrind, you rock
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:14:51 -07:00
Ronnie Sahlberg
38798e2090 initialize task->datain.data to keep valgrind happy
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:10:38 -07:00
Ronnie Sahlberg
2af45d9ad4 initialize sense to keep valgrind happy
valgrind does not know that sense will be initialized by the ioctl
so we need to to it explicitely to keep it from warning us.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 14:58:12 -07:00
Ronnie Sahlberg
f2904be1f6 Typo
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 14:19:58 -07:00
Ronnie Sahlberg
ef20220ac2 iscsi-test-cy.c: drop READ6 from the linux tests. it is obsolete 2014-09-21 14:19:35 -07:00
Ronnie Sahlberg
d11e4175f7 TESTS: Dont memcpy if task==NULL
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 17:33:21 -07:00
Ronnie Sahlberg
1e3cc445c8 TESTS: Remove some tests that wont work yet for /dev/sg
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 17:15:48 -07:00
Ronnie Sahlberg
59817c7959 TESTS: rename the old and abandoned scsi-usb-sbc testsuite to LINUX
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 16:33:03 -07:00
Ronnie Sahlberg
55c1f0d2ec TESTS: Add support to test against a /dev/sg device on linux
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 16:26:46 -07:00
Ronnie Sahlberg
bd6570c324 TESTS: create an abstraction to connect to a device
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 06:26:53 -07:00
Ronnie Sahlberg
48e14f5ccf TESTS: update main program to use helpers instead of calling directly to libiscsi
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 06:21:02 -07:00
Ronnie Sahlberg
8ed2ad9b69 TESTS: start abstracting away the error string handling from transports
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 19:20:49 -07:00
Ronnie Sahlberg
5efc7bf925 TESTS: create a helper/wrapper for sending scsi commands
Create a wrapper for sending scsi_commands so that we can hide the
libiscsi function far away from the "opcode" helpers.
This means we only have a single place later to switch to a different
type of device, such as a SG_IO one.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:52:08 -07:00
Ronnie Sahlberg
74a50052cd TESTS: get rid of iscsic2
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:37:35 -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
40de7d95a9 Configure: add a test for SG_IO
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 14:26:03 -07:00
Ronnie Sahlberg
f015ab095a TESTS: update reportsupportedopcodes to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -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
Ronnie Sahlberg
398f03205d TESTS: update unmap to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
832d88797a TESTS: remove the read10_task helper
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00