Commit Graph

1542 Commits

Author SHA1 Message Date
Ronnie Sahlberg
514de96e15 TEST-TOOL: We need to include the multipath header in the dist files
or else we break all building of RPMs, which is not good.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-04 00:04:55 -07:00
Craig Rodrigues
7fe7891e84 reserve6 tests: fix login parameters 2015-06-03 20:23:09 +00:00
Craig Rodrigues
1995298914 test_modesense6_control_swp: skip test if target cannot change swp
Signed-off-by: Vadim Finkelstein <vadim@pi-coral.com>
2015-06-03 18:54:29 +00:00
Ronnie Sahlberg
3f73f00b25 Merge pull request #168 from rodrigc/fix1
test_reserve6_target_cold_reset: fix login parameters
2015-06-02 19:39:02 -07:00
Craig Rodrigues
ff7a73360a test_reserve6_target_cold_reset: fix login parameters
Signed-off-by: Vadim Finkelstein <vadim@pi-coral.com>
2015-06-03 02:30:31 +00:00
Ronnie Sahlberg
a8e42680ed MULTIPATH TESTS: Remove the iscsi-only restriction. The tests work for /dev/* too
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:28:49 -07:00
Ronnie Sahlberg
2388db9f12 MULTIPATH TEST: use READ10/WRITE10 instead of READ16/WRITE16
Many small devices do not implement the 16 version of these commands.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:27:51 -07:00
Ronnie Sahlberg
3601799a1b MULTIPATH TESTS: fix another bug where we did an inquiry for the wrong page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:18:28 -07:00
Ronnie Sahlberg
95d763d9f9 TESTS: Add comment to describe why we keep a pointer around for iscsi_queue_pdu
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:16:39 -07:00
Ronnie Sahlberg
86a42c8b3a MULTIPATH TESTS: pass the right pointer back when copying a des
Else we will double free and crash.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 19:39:13 -07:00
Ronnie Sahlberg
86df6c9a20 MULTIPATH TESTS: We need to pass the correct evpv/pagecode when we reissue an inquiry
When we reissue an inquiry due to the firast attempt not containing
all of the data, make sure to ask for the same page once we know the
proper size and ask again.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 19:30:19 -07:00
Ronnie Sahlberg
73102aeddd Merge pull request #167 from ddiss/test-multipath-v2
test: multipath support v2
2015-06-01 07:06:29 -07:00
David Disseldorp
34dea87a69 test: add simple multipath IO test
Write data to device via one path, then read back using a different
path. Confirm that data is correct.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 19:27:21 +02:00
David Disseldorp
43b47cf1fb test/multipath: add MPATH_SKIP_IF_UNAVAILABLE macro
Check whether multiple SCSI device paths are available, if not then skip
the test.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 16:56:21 +02:00
David Disseldorp
024fe873e3 iscsi-test-cu: support multiple iSCSI URLs for multipath
Connect to each iSCSI URL provided, and confirm that they all correspond
to the same multipathed logical unit by using the previously added
mpath_check_matching_ids() helper.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 16:56:18 +02:00
David Disseldorp
a291c2b308 test: add multipath helper functions
mpath_check_matching_ids() walks the list of scsi devices, and confirms
that all entries share one common device identification designator or
unit serial number.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 16:52:54 +02:00
Ronnie Sahlberg
0630aa5ef0 Timeouts: Fix bugs in scsi task timeout code
Add a test to verify the pdu timeout handling.
Fix numerous bugs in the timeout handling. It was really broken.

Add test for non-SCSI task PDUs too and verify they works.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-24 14:34:06 -07:00
Ronnie Sahlberg
cb4ad5f774 Connect: Don't use the TUR checks on re-connects
Only use TUR to eat any pending unit attentions on the initial connect
but not during reconnect.

From Peter Lieven <pl@kamp.de>

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-19 19:21:26 -07:00
Ronnie Sahlberg
2f10f05084 TESTS: improve text output for test_report_supported_opcodes_rctd
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-13 19:54:50 -07:00
Ronnie Sahlberg
6e4a84f815 TESTS Add the modesense tests to the linux family
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-13 19:50:24 -07:00
Ronnie Sahlberg
d9352865c2 TESTS: Skip the test with a warning if BlockDevChar VPD page is missing
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:30:04 -07:00
Ronnie Sahlberg
2a6264f76e TESTS: Change ModeSense6.Control D_SENSE test to work with /dev/* devices
Stop calling out to libiscsi specific interfaces for faling a command
and checking the sense data. Use the now generic read16() which now works
also for normal device nodes.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:29 -07:00
Ronnie Sahlberg
b2b474f3ad TESTS: Allow inquiry(block dev characteristics) to fail
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:11 -07:00
Ronnie Sahlberg
811c04f01a TESTS: read12/read16 change signature to return an optional task structure
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:04 -07:00
Ronnie Sahlberg
20ef4b5687 README: Update the README with more unit test documentation
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-11 06:25:29 -07:00
Ronnie Sahlberg
1c9792941f iscsi-perf: use uint64_t instead of u_int64_t
because portability

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 10:55:27 -07:00
Ronnie Sahlberg
45f667739c login.c: use uint32_t instead of u_int32_t
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 10:55:18 -07:00
Ronnie Sahlberg
de0795928a makerpms.sh : we dont need to configure from this script. rpmbuild will do it
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 10:04:20 -07:00
Ronnie Sahlberg
0ae2e936df Add tests t Makefile.am subdirectories
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 10:04:04 -07:00
Ronnie Sahlberg
dfeefd6539 New version 1.14.0
- Add support to use /dev/* nodes instead of just iscsi devices.
 - Create a dedicated test for the FUA/DPO flags
 - Allow reusing the context after disconnect
 - Fix non-randomness in rand_key()
 - Add iscsi-perf tool
 - Fix length bug when sending unsolicited data in iscsi_command
 - Reqrite the reconnect logic to begome fully async
 - Fix wrong checks for username in CHAP
 - Support Bidirectional CHAP
 - Improve handling of IMMEDIATE bit
 - Cmdsn, statsn fixes+
 - iscsi_which_events can return 0, which means that there are no events right
   now but try again in a second or so.
 - Ignore any ASYNC EVENTS we receive since we can not yet pass them back to
   the application.
 - Add initial make test support
 - Various minor fixes to libiscsi and the test suite

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 09:14:11 -07:00
Ronnie Sahlberg
e0f1d58141 Add a README for the make test directiory
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-10 08:14:42 -07:00
Ronnie Sahlberg
d790209a8a TESTS: use TGTPORTAL instead of a hardcoded port
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-09 15:47:15 -07:00
Ronnie Sahlberg
2170f656bc Merge branch 'master' of github.com:sahlberg/libiscsi 2015-05-09 15:40:22 -07:00
Ronnie Sahlberg
86ce6a0ccd TESTS: tgtd now had TGT_IPC_SOCKET so lets use it
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-09 15:39:45 -07:00
Ronnie Sahlberg
64ead1c3df Merge pull request #164 from plieven/for_upstream
pdu: add known exceptions to target serial processing
2015-05-08 07:32:29 -07:00
Peter Lieven
6aa47691ce pdu: add known execptions to target serial processing
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-08 12:47:34 +02:00
Ronnie Sahlberg
9c58bf64f4 Merge pull request #163 from rodrigc/fix1
Skip unsupported tests instead of failing
2015-05-07 06:32:14 -07:00
Craig Rodrigues
3aec1a37a9 Skip unsupported tests instead of failing
* SCSI_REPORT_SUPPORTING_OPCODE
* SCSI_REPORT_SUPPORTING_SERVICEACTION
2015-05-07 07:09:13 -04:00
Ronnie Sahlberg
6b51466048 Merge pull request #162 from plieven/for_upstream
For upstream
2015-05-05 06:19:17 -07:00
Peter Lieven
a027931a2c init: simplify the case that the freelist is full in iscsi_sfree
if the freelist gets full we are likely in a low load situation so
we do not need to make all the work copying the pointers.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 14:14:26 +02:00
Peter Lieven
b4098c535e init: make LIBISCSI_CACHE_ALLOCATIONS a public environment variable
this variable was introduced for iscsi-test-cu only. This patch
makes it a generic environment variable that can be set per context.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 14:10:44 +02:00
Peter Lieven
724f44c31b socket: change the order of POLLIN and POLLOUT in iscsi_service
the original idea of writing to the socket before reading was to put data
on the wire as early as possible and avoid potential latency increase due
to long taking callbacks invoked in iscsi_read_from_socket.

Benchmarking with libiscsi userland tools have shown that changing the
order increases throughput by about 5%.
The reason is that during POLLIN we might receive an updated MaxCmdSN
which might us allow to send new data out during POLLOUT.

For Qemu the change doesn't matter since POLLIN and POLLOUT are processed
independently.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 13:57:10 +02:00
Peter Lieven
e9d67540e1 add LIBISCSI_IGNORE_NOP_OUT_ON_STUCK_WAITPDU_QUEUE environment variable
this variable is a helper to tell libiscsi to not reset the nops_in_flight
on receival of a NOP-Out if the oldest element in the waitpdu queue is
not changed since the last NOP-Out.

The idea is that we can detect a command that the target silently dropped
by this mechanism and run into a NOP timeout forcing a reconnect.

This environment variable is not suitable if a command is send that is taking more than
the allowed timeout for a NOP-Out as a reply to a initiator generated NOP-In
(or several NOP-Outs if more than 1 in flight is allowed).

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 13:54:22 +02:00
Peter Lieven
efcf602476 nop: print a warning if the oldest element in iscsi->waitpdu queue is stuck
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-05-05 13:54:15 +02:00
Bart Van Assche
e7a90f7ecb test_sanitize_overwrite: Fix three log messages
check_lun_is_wiped() verifies whether the 256 blocks following LBA
'lba' contain byte value 'c'. Modify the log messages such that these
refer to byte value 'c' instead of to zero. Change the argument type
of 'c' from char into unsigned char to avoid that 'c' is sign
extended in the log statements.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-27 19:19:30 -07:00
Bart Van Assche
52a57d26f2 test-tool: Improve reliability of status_is_invalid_opcode()
The test_report_supported_opcodes_one_command() sends SCSI commands
to the target for which the target has to reply with ILLEGAL REQUEST
/ INVALID FIELD IN CDB. Avoid that such a reply is misinterpret as
"command not supported" by checking the field offset in the sense
descriptor. See also patch "test tool: Detect unsupported opcodes
correctly" (commit ID fe9620092c).

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-27 19:18:41 -07:00
Bart Van Assche
8435f9722e lib: Parse sense specific descriptor
Extend struct scsi_sense with sense specific descriptor information,
introduce the function scsi_parse_sense_data() and let that function
parse the sense specific descriptor.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-27 19:17:51 -07:00
Bart Van Assche
fbc87ab12f test_compareandwrite_dpofua: Fix this test
Initialize the buffer with data from the medium to avoid to
trigger a miscompare and double the compareandwrite() xferlen
argument.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-27 19:15:54 -07:00
Ronnie Sahlberg
39c4322c99 Merge pull request #161 from czankel/master
Fix '0block' write same and unmap tests and 'out-of-tree' builds
2015-04-26 09:30:18 -07:00
Chris Zankel
a4bde6adfd test_writesame16_unmap_until_end: pass 0 blocks instead of 0-length block
The test:
  "Test WRITESAME16 of 1-256 blocks at the end of the LUN by setting
number-of-blocks==0"
was passing 0 for the data length instead of the block count.

Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-23 17:40:02 -07:00