Commit Graph

1639 Commits

Author SHA1 Message Date
Sitsofe Wheeler
71879c913a Silence clang missing-field-initializers warning
When libiscsi is built with clang several spurious
missing-field-initializers warnings like the following are reported:

test_async_write.c:61:45: error: missing field 'completed' initializer
[-Werror,-Wmissing-field-initializers]
	struct tests_async_write_state state = { 0 };

These appear to be due to clang being overzealous in its checking
because the code is legal C (see
https://llvm.org/bugs/show_bug.cgi?id=21689 ) but it causes compilation
to be aborted. Workaround the problem by specifying a 0 or NULL for each
structure member.
2016-03-31 20:32:47 +01:00
Ronnie Sahlberg
2bba2fedf9 Merge pull request #197 from bonzini/libiscsi-20160330
Fix iscsi-ls for IPv6 link-local addresses, and bump ABI version again
2016-03-30 19:25:48 -07:00
Jakob van Kruijssen
7d2e9ec708 Fix sending to many headers after completing CHAP auth.
TODO: see if this breaks something else.
2016-03-30 19:21:25 -07:00
Jakob van Kruijssen
81a7610155 Fix CHAP challange not being fully read and hashed. 2016-03-30 19:21:12 -07:00
Paolo Bonzini
edc5a80857 bump ABI version again
Commit 80b81772e2 again broke
the libiscsi ABI.  Bump the soname of the library.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-03-30 18:07:29 +02:00
Paolo Bonzini
d84ee65eaa iscsi-ls: skip link-local IPv6 addresses
Some iSCSI targets provide a link-local IPv6 address as a portal, but that
is unusable without knowing the interface (aka scope-id) to use for the
connection.  This causes iscsi-ls to report an EINVAL and exit.  Just
skip the error.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-03-30 17:55:03 +02:00
Ronnie Sahlberg
8afffbd506 Fix compiler warning
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-03-27 10:51:05 -07:00
Ronnie Sahlberg
6f702198e9 Merge pull request #195 from ddiss/abort_nocancel
Remove local cancellation from ABORT TASK path and add simple test
2016-03-27 10:47:12 -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
f117b6c96d socket: add iscsi_out_queue_length() function
This function allows the caller to determine the number of PDUs queued
for transmission for a given iscsi context.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:19:51 +01:00
David Disseldorp
c38a8c1d9a task_mgmt: don't cancel local PDUs on ABORT TASK
Currently the iscsi_task_mgmt_abort_task_[a]sync() functions cancel any
queued or dispatched (awaiting response) PDUs prior to transmitting the
ABORT TASK TMF request, which means that a TMF request may be sent which
references a PDU that the target never received.

Bug: https://github.com/sahlberg/libiscsi/issues/192

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:12:09 +01:00
David Disseldorp
4a3dcf0349 iscsi: add response values for Task Mgmt Func
These values are defined in rfc3720
10.6. Task Management Function Response
-> 10.6.1.  Response

The response field is a single byte value, and is already used within
libiscsi as a command_data parameter for iscsi_task_mgmt_async()
callbacks.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:06:39 +01:00
Ronnie Sahlberg
a370208b38 Merge pull request #194 from plieven/segfault_fix
Fix Qemu Segfault
2016-03-17 19:41:00 -07:00
Peter Lieven
a7c94a7af5 connect: invoke all callbacks for dropped PDUs
if we drop a PDU which has a callback we should invoke it otherwise
the caller may wait infinetely for a command completion.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-03-17 12:08:26 +01:00
Peter Lieven
97406c5b36 Revert "Fail pending LOGOUT commands on session reconnect"
This seriously breaks qemu NOP timeouts and probably other things.
The reason is that the

define ISCSI_PDU_ERROR_ON_RECONNECT	0x00000016

is masking bits 0x2 and 0x4 as well.

Correctly it should read:
define ISCSI_PDU_ERROR_ON_RECONNECT	0x00000010

However, the better solution for this approach is invoke all callbacks
of PDUs which carry the ISCSI_PDU_DROP_ON_RECONNECT flag. This will
make sure that callbacks of whatever sync tasks are invoked.

This reverts commit 0407cf6aed.
2016-03-17 12:08:20 +01:00
Ronnie Sahlberg
d6e76e8ba4 Merge pull request #191 from ddiss/test-async
Tests: Asynchronous iSCSI
2016-03-14 19:42:22 -07: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