8 Commits

Author SHA1 Message Date
Bart Van Assche
c49461e4b7 test-tool: Do not use empty initializers
Empty initializers are a GNU extension that is not supported by older
versions of gcc.

Fixes: https://github.com/sahlberg/libiscsi/issues/356
2021-06-24 20:07:54 -07:00
David Disseldorp
54b3dcaa30 test-tool: add LogoutDuringIOAsync test case
This attempts to reproduce upstream LIO reports of a use after free bug
when logout occurs alongside concurrent I/O.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2020-08-18 17:12:28 +02:00
David Disseldorp
4080c09839 test-tool: rename async write dispatch/complete counters
Add an io_ prefix, to differentiate between I/O and future iSCSI Logout
request tracking.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2020-08-18 16:43:54 +02:00
Bart Van Assche
9d2493248b Use dynamic memory allocation instead of variable-length arrays
Since it is easy to trigger a stack overflow with variable-length arrays,
use dynamic memory allocation instead of VLAs. Add -Wvla to the compiler
options such that no new VLAs get introduced.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2019-11-09 13:39:34 -08:00
David Disseldorp
e716691a45 test-tool: use CHECK_FOR_ISCSI() helper macro
This removes a large amount of boilerplate code.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2019-09-22 16:40:13 +02:00
Khazhismel Kumykov
08cd206c4a test-tool: fix async read/write test for bs != 512
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
2019-07-14 12:47:47 +10:00
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
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