Commit Graph

691 Commits

Author SHA1 Message Date
Ronnie Sahlberg
8afffbd506 Fix compiler warning
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-03-27 10:51:05 -07:00
David Disseldorp
bf9c7cb277 test: simple ABORT TASK TMF test
Dispatch a write and subsequently abort it.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:27:25 +01:00
David Disseldorp
bfd614053e test-tool: add test_get_clock_sec() helper
Useful for test IO timeouts.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:19:59 +01:00
David Disseldorp
9ae5a64662 Tests: Asynchronous iSCSI Multipath Compare And Write
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>
2016-03-11 19:16:10 +01:00
David Disseldorp
51da17c41f Tests: Asynchronous iSCSI write test
Dispatch a number of WRITE10 requests simultaneously, and await all
responses.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-11 18:53:24 +01:00
David Disseldorp
ebeca19480 Tests: Asynchronous iSCSI read test
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>
2016-03-10 18:20:37 +01:00
Ronnie Sahlberg
83a4f54cb8 Remove a trailing CU_ASSERT_EQUAL(ret we no longer need
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-24 18:11:14 -08:00
Ronnie Sahlberg
c5bc0a49b0 Tests: Fix the retry loop for the reserve6 helpers.
We should exit the loop once we have a command that is NOT
aborted with unit attention.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-23 21:34:34 -08:00
David Disseldorp
2feb4d40db TESTS: add 4MB overlap test to write10_simple
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>
2016-02-23 21:00:25 -08:00
Ronnie Sahlberg
8a44851128 Tests: Add a helper for the all_zero checker
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-23 19:26:15 -08:00
Ronnie Sahlberg
b4320bd76c Tests: convert tabs to 8 spaces
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 16:17:18 -08:00
Ronnie Sahlberg
5a80c7b581 Fix some clang warnings
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 16:13:53 -08:00
Ronnie Sahlberg
efedc02224 Test: Add helper for MODESENSE6
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:52:26 -08:00
Ronnie Sahlberg
b5402d55c2 Tests: Make readonly-sbc tests use the new helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:52:15 -08:00
Ronnie Sahlberg
ce0a22e040 Tests: Use the helpers in NoMedia tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:52:03 -08:00
Ronnie Sahlberg
1deee0898a Tests: Add a test that RC16 must be supported when SBC3 is claimed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:53 -08:00
Ronnie Sahlberg
9f81ae91fe Tests: Add helper for READCAPACITY10
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:42 -08:00
Ronnie Sahlberg
80e06cae30 Tests: Add helped for UNMAP
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:34 -08:00
Ronnie Sahlberg
d3913ee864 Tests: add helpers for synchronizecache
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:20 -08:00
Ronnie Sahlberg
ea8e4c4115 Tests: add helper for TESTUNITREADY
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:11 -08:00
Ronnie Sahlberg
05fb882e19 Tests: add getlbastatus helper
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:50:58 -08:00
Ronnie Sahlberg
23a9278e23 Tests: Add helpers fro preventallow/startstopunit
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:49:22 -08:00
Ronnie Sahlberg
d910bab852 Tests: add helpers for PREFETCH*
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:48:53 -08:00
Ronnie Sahlberg
9d7103e5ac Tests: helpers for READ6
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:48:22 -08:00
Ronnie Sahlberg
935c2cba22 Tests: helper for READCAPACITY16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:47:59 -08:00
Ronnie Sahlberg
c48283fe75 Tests: add helpers for read*
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:45:23 -08:00
Ronnie Sahlberg
0a814db48f Tests: Add helpers for ORWRITE
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:40:59 -08:00
Ronnie Sahlberg
69f4dc76ca Tests: Convert remaining write16 to new helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:40:32 -08:00
Ronnie Sahlberg
b01780b9ee Tests: Add helpers for ExtendedCopy and ReceiveCopyResults
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:39:59 -08:00
Ronnie Sahlberg
9afd4a4412 Test: add helpers for reserve6/release6
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:36:18 -08:00
Ronnie Sahlberg
39d128db6d Tests: Add helpers for SANITIZE
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:34:54 -08:00
Ronnie Sahlberg
d18dbe49aa Tests: add helper for WRITEATOMIC16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:32:41 -08:00
Ronnie Sahlberg
0b5b724f17 Tests: Add helpers for WRITESAME
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:28:59 -08:00
Ronnie Sahlberg
4d1e3aecd0 Tests: add helper macro for REPORT_SUPPORTED_OPCODES
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:25:21 -08:00
Ronnie Sahlberg
f699503f8c Tests: Create helper macro for COMPAREANDWRITE
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:21:46 -08:00
Ronnie Sahlberg
f88bcf61cc Tests: Create a global scratch buffer and avoid allocating memory in the tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:17:43 -08:00
Ronnie Sahlberg
b4e4649ae5 Tests: Add helper macros for Verify*
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:14:06 -08:00
Ronnie Sahlberg
eba1ac059a Tests: Add helper macros for Write*
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:07:55 -08:00
Ronnie Sahlberg
bd29dab95b Tests: Create helper macros for the WriteVerify* commands
By creating a helper macros for WriteVerify we can save a lot of boilerplate
code.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:04:36 -08:00
Ronnie Sahlberg
72cfdbb5f1 Tests: Make null pointer asserts abort the test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 14:55:54 -08:00
Ronnie Sahlberg
99a5f99527 Add some emacs defaults. Tabs are 8 spaces.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-18 21:34:43 -08:00
Bart Van Assche
be9b803334 test-tool: Avoid that using receive_copy_results() triggers a use-after-free
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>
2015-12-24 10:38:38 -08:00
Bart Van Assche
cacc144a29 test-tool: Initialize parameter buffers
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>
2015-12-24 10:36:55 -08:00
Bart Van Assche
9ab1cc8baa test-tool/*_dpofua: Fix memory leaks in error paths
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-12-24 08:55:25 -08:00
Bart Van Assche
e9536d3333 test-tool: Avoid that login failure causes a segmentation fault
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-12-24 08:54:40 -08:00
Ronnie Sahlberg
5532325042 Test-tool: call iscsi_service on MP devices once every second so we respond to NOP
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>
2015-12-15 21:55:03 -08:00
Ronnie Sahlberg
cda985167d Merge branch 'master' of github.com:sahlberg/libiscsi 2015-12-13 14:34:19 -08:00
Ronnie Sahlberg
3c44092635 Add a feature to request transparent reconnects without any UA
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>
2015-12-13 14:29:32 -08:00
David Disseldorp
086f1d1903 test/pr: fix key deregistration in PRout PREEMPT test
Remove duplicate k2 deregistration.

Reported-by: Chris Zankel <czankel@purestorage.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-12-10 12:02:03 +01:00
Bart Van Assche
0e0073e818 test-tool: Clear persistent reservation keys before tests are run
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>
2015-10-07 07:45:32 -07:00