For now this only changes iSCSIDataSnInvalid to use
iscsi_pdu_set_datasn() instead of scsi_set_uint32().
iSCSICmdSnTooHigh/Low changes should also be possible, as noted, but
haven't been converted yet.
Signed-off-by: David Disseldorp <ddiss@suse.de>
libiscsipriv.la exposes all symbols, so allows tests to perform low
level PDU manipulation, etc. without duplicating code.
As a trade-off, this results in a larger iscsi-test-cu, with libiscsi.so
linking removed.
Link: https://github.com/sahlberg/libiscsi/issues/297
Signed-off-by: David Disseldorp <ddiss@suse.de>
All users have now been changed to overload via the iscsi_ctx transport
callback, so the dlsym based overloading can now be dropped.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
This commit also removes a number of unnecessary "WRITE10 is not
implemented" checks, which should all be caught by the first check.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert this test to use the regular transport driver
callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
In preparation for removing the test-tool iscsi_queue_pdu() dlsym
overload hack, convert the Compare&Write InvalidDataOutSize test to use
the regular transport driver callback for this purpose.
Signed-off-by: David Disseldorp <ddiss@suse.de>
rfc3720 indicates that SendTargets on discovery *and* normal operational
sessions must be supported by targets:
A system that contains targets MUST support discovery sessions on
each of its iSCSI IP address-port pairs, and MUST support the
SendTargets command on the discovery session.
...
A target MUST support the SendTargets command on operational
sessions...
Signed-off-by: David Disseldorp <ddiss@suse.de>
wr_buf was hardcoded with blocksize 512, resulting in incorrect behavior
for larger block sizes, and buffer overflow. Use the block_size global.
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Added support for negotiating below keys:
RDMAExtensions, TargetRecvDataSegmentLength, and
InitiatorRecvDataSegmentLength.
These are required to support iSER. See RFC5046 Section 6.
clear_pr() can be called before connect_scsi_device() has been invoked
on each MPIO sdev. This results in a NULL pointer dereference in the
send_scsi_command() MPIO NOP-responder code-path.
Fix this by invoking clear_pr() after the MPIO connect_scsi_device()
loop has run. clear_pr() also only needs to be invoked via a single
path, so do so via the first path only.
Link: https://github.com/sahlberg/libiscsi/issues/289
Fixes: 16435a9 ("iscsi-test-cu: Improve persistent reservation clearing")
Signed-off-by: David Disseldorp <ddiss@suse.de>
Clear persistent reservations before sending the first SCSI command to the
target to avoid that that command fails due to persistent reservations left
behind by a previous run of the test tool.
Avoid that a subsequent test fails if a test did not remove the persistent
reservations it obtained.
Make sure that clear_pr() returns -1 if clearing persistent reservations
fails.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
In a production system, the examples are not needed.
Add a configure option to disable building the examples.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
When doing a production system, the production environment has been
pre-validated (with this test-toll or by other means), so the teest-tool
is not needed in production.
Add a configure option to disable building test-tool.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
When doing cross-compilation, the tests are meant to be run on the
target. However, they are currently not installed, so it does not make
sense to build tehm to start with.
Additionally, when doing a system for production, those tests are not
needed anyway.
Add a configure option to disable building the tests altogether.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
The ac_cv_-prefix variables are supposed to be settable from the command
line, à-la: ./configure ac_cv_foo=no
The canonical way of doing so is to use AC_CACHE_VAL() or AC_CACHE_CHECK().
The latter is to be preferred in our case, as it handles printing the
message for us.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
The ISCSI_HEADER_SIZE macro accesses iscsi->header_size, so pass it in
as a parameter to make it easier to follow callers.
Signed-off-by: David Disseldorp <ddiss@suse.de>
ISCSI_HEADER_SIZE is determined based on the iscsi->header_digest
setting, which may change via iscsi_process_pdu().
Signed-off-by: David Disseldorp <ddiss@suse.de>