Dispatch a number of Compare And Write requests simultaneously via
separate iSCSI sessions and await all responses.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Dispatch a number of READ10 requests simultaneously, and await all
responses.
The iscsi-support test helper functions are currently all synchronous,
so this test mostly uses the bare libiscsi API. As new async tests are
added, we can make a more informed decision on which boilerplate code
can be split out.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Ceph RADOS block devices split images into 4MB objects. This test
ensures that cross object IOs are successful.
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Move the scsi_free_scsi_task() call from receive_copy_results() to the
callers of this function to avoid that accessing the unmarshalled data
triggers a use-after-free.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This patch avoids that Valgrind reports that an uninitialized buffer
is passed to writev():
Syscall param writev(vector[...]) points to uninitialised byte(s)
at 0x5557D07: writev (in /lib64/libc-2.19.so)
by 0x5269BFD: iscsi_iovector_readv_writev (socket.c:509)
by 0x526A7A9: iscsi_write_to_socket (socket.c:727)
by 0x526AE47: iscsi_service (socket.c:888)
by 0x526B632: event_loop (sync.c:67)
by 0x526D925: iscsi_scsi_command_sync (sync.c:1223)
by 0x405970: send_scsi_command (iscsi-support.c:276)
by 0x40B190: extendedcopy (iscsi-support.c:2673)
by 0x40E9FE: test_extendedcopy_param (test_extendedcopy_param.c:63)
by 0x503E260: ??? (in /usr/lib64/libcunit.so.1.0.1)
by 0x503E56E: ??? (in /usr/lib64/libcunit.so.1.0.1)
by 0x503E8A5: CU_run_all_tests (in /usr/lib64/libcunit.so.1.0.1)
Address 0xffefff864 is on thread 1's stack
in frame #8, created by test_extendedcopy_param (test_extendedcopy_param.c:31)
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
The test tool is simplistic and uses the synchronous API. In this API
we will only poll() the socket and process events during the lifetime of any
iscsi_*_sync() calls.
A problem with this approach arises with multipath tests. When iscsi-test-cu
is used with multiple devices we will first open a session for each
multipath leg, but then as most tests are only using the first device we end
up with creating secondary sessions we don't do any iscsi_*_sync() calls on
for very long times. If a target is set up to send NOPs on these
secondary paths it will not get any responses and eventually tear down the
connection.
To avoid this, try to make sure we service any secondary paths we have
created by calling iscsi_service(POLLIN|POLLOUT) every few seconds
to make sure we do service and respond to any NOPs.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Normal applications want the current behaviour where we have the library
consume any/all of the UnitAttentions that the target may have queued on the
initial connection, but when we reconnect the session after a failure the
library will pass all the UAs back to the application to process.
Some applications, such as the test suite or really trivial applications
might not want to have to deal with handling of UAs and just "make it work".
Those applications can now request that upon any reconnection of the session
that libiscsi will automatically consume any and all UAs and hide them from
the application.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
If a previous run of the test tool had been interrupted one or
more persistent reservation keys can still be registered. This
can cause tests in the new run to fail. Avoid this by clearing
these keys before running any tests. Do this only if --dataloss
has been specified.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>