Commit Graph

1791 Commits

Author SHA1 Message Date
Sushil
0593ac20de 251_SCSI Executing with SCSI device only (no ISCSI URL) ProutRegister test case failed
<iscsi-url> parameter absent handled for SCSI devices.

* Verbose logging segfault fixed.

* For ioctl case, if reservation conflicts hits it is not considered as
test case failure.
2017-11-09 06:15:06 +10:00
Ronnie Sahlberg
f9d54c5e45 Merge branch 'master' of github.com:sahlberg/libiscsi 2017-06-14 08:25:58 -07:00
Ronnie Sahlberg
446a0f5d2f WIN32: Make dup2 a NO-OP under win32.
There is something wrong with dup2 under win32 and I do not know win32
well enough to fix it, thus this workaround.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-14 08:25:39 -07:00
Ronnie Sahlberg
64ffae4062 WIN32: Use send/recv instead of read/write
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-14 08:25:38 -07:00
Bart Van Assche
e5296920e9 test_multipathio_simple: Only compare if READ10 succeeded
Since the data in the read buffer is not valid if READ10() failed,
only compare the data in the read buffer if READ10() succeeded.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-14 08:25:38 -07:00
Bart Van Assche
0241fe8014 test_extended_copy_simple: Limit transfer size to half of the capacity
This avoids that the test fails for LUNs with less than 2048 blocks.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-14 08:25:38 -07:00
Bart Van Assche
1af120d2c3 test_extended_copy_simple: Fix buffer comparison code
Compare the buffers in their entirety instead of only a prefix of
the buffers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-14 08:25:38 -07:00
Bart Van Assche
e866dc36e0 test_async_*_simple: Fix a CUnit assertion failure
Using any of the CU_ASSERT macros after a test has finished causes
the test tool to abort. This patch adds an iSCSI logout to two tests
to avoid that the test tool aborts e.g. as follows:

==11578== Process terminating with default action of signal 6 (SIGABRT)
==11578==    at 0x54BB77F: raise (raise.c:58)
==11578==    by 0x54BD379: abort (abort.c:89)
==11578==    by 0x54B3B46: __assert_fail_base (assert.c:92)
==11578==    by 0x54B3BF1: __assert_fail (assert.c:101)
==11578==    by 0x504213E: CU_assertImplementation (in /usr/lib/x86_64-linux-gnu/libcunit.so.1.0.1)
==11578==    by 0x16FA36: test_async_abort_cb (test_async_abort_simple.c:67)
==11578==    by 0x5274B82: iscsi_process_task_mgmt_reply (task_mgmt.c:100)
==11578==    by 0x525E226: iscsi_process_pdu (pdu.c:598)
==11578==    by 0x526F2AA: iscsi_read_from_socket (socket.c:677)
==11578==    by 0x5270015: iscsi_tcp_service (socket.c:963)
==11578==    by 0x52700A5: iscsi_service (socket.c:980)
==11578==    by 0x52707E1: event_loop (sync.c:69)

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-14 08:25:38 -07:00
Bart Van Assche
4591a82209 test_report_supported_opcodes_rctd: Fix a NULL pointer dereference
Avoid that the test tool crashes due to a NULL pointer dereference
if unmarshalling the Data-In buffer fails.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-14 08:25:38 -07:00
Ronnie Sahlberg
cd32003a26 Merge pull request #249 from bvanassche/master
Five bug fixes for the iSCSI conformance test tool
2017-06-14 07:47:06 -07:00
Ronnie Sahlberg
6d6cb515fb Update the documentation for the --debug flag to iscsi-ls
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-03 11:36:04 -07:00
Ronnie Sahlberg
fb45f0343e Fix another compiler warning
We do need a default: arm here as the switch is not supposed to deal with
all possible values for the enum.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-03 11:33:51 -07:00
Ronnie Sahlberg
854e37aab7 Fix compiler warning/error under gcc7
Gcc7 complains about falling through from the previous case to the default arm

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-06-03 11:20:20 -07:00
Bart Van Assche
494bddc660 test_multipathio_simple: Only compare if READ10 succeeded
Since the data in the read buffer is not valid if READ10() failed,
only compare the data in the read buffer if READ10() succeeded.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-02 16:44:32 -07:00
Bart Van Assche
6332c5e3d1 test_extended_copy_simple: Limit transfer size to half of the capacity
This avoids that the test fails for LUNs with less than 2048 blocks.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-02 16:44:32 -07:00
Bart Van Assche
7658e5f0a5 test_extended_copy_simple: Fix buffer comparison code
Compare the buffers in their entirety instead of only a prefix of
the buffers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-02 16:44:31 -07:00
Bart Van Assche
cba570408e test_async_*_simple: Fix a CUnit assertion failure
Using any of the CU_ASSERT macros after a test has finished causes
the test tool to abort. This patch adds an iSCSI logout to two tests
to avoid that the test tool aborts e.g. as follows:

==11578== Process terminating with default action of signal 6 (SIGABRT)
==11578==    at 0x54BB77F: raise (raise.c:58)
==11578==    by 0x54BD379: abort (abort.c:89)
==11578==    by 0x54B3B46: __assert_fail_base (assert.c:92)
==11578==    by 0x54B3BF1: __assert_fail (assert.c:101)
==11578==    by 0x504213E: CU_assertImplementation (in /usr/lib/x86_64-linux-gnu/libcunit.so.1.0.1)
==11578==    by 0x16FA36: test_async_abort_cb (test_async_abort_simple.c:67)
==11578==    by 0x5274B82: iscsi_process_task_mgmt_reply (task_mgmt.c:100)
==11578==    by 0x525E226: iscsi_process_pdu (pdu.c:598)
==11578==    by 0x526F2AA: iscsi_read_from_socket (socket.c:677)
==11578==    by 0x5270015: iscsi_tcp_service (socket.c:963)
==11578==    by 0x52700A5: iscsi_service (socket.c:980)
==11578==    by 0x52707E1: event_loop (sync.c:69)

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-02 16:44:31 -07:00
Bart Van Assche
1971294017 test_report_supported_opcodes_rctd: Fix a NULL pointer dereference
Avoid that the test tool crashes due to a NULL pointer dereference
if unmarshalling the Data-In buffer fails.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-06-02 16:44:31 -07:00
Ronnie Sahlberg
12222077cc Add project file for iscsi-ls and make it build under visual studio
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-13 12:09:42 -07:00
Ronnie Sahlberg
bfd5bd944a Merge branch 'master' of github.com:sahlberg/libiscsi 2017-05-11 21:19:25 -07:00
Ronnie Sahlberg
f750101980 Add initial visual studio project files and fix the win32 build
Win32 has been rotting for a while. This patch adds vs17 build files
as well as fixing up all build errors that have accumulated.
There are still build warnings but those can be addressed in a followup
patch.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-11 21:19:14 -07:00
Ronnie Sahlberg
86fd53581e Merge pull request #244 from bvanassche/master
test tool: Set BYTCHK=1 if EDTL != 0
2017-05-03 15:31:55 -07:00
Bart Van Assche
7c10722449 test tool: Set BYTCHK=1 if EDTL != 0
From SBC-4: BYTCHK = 0 means that the Data-Out buffer contents
must not be used. BYTCHK = 1 means that the Data-Out buffer must
be compared against the data on the storage medium. Hence set
BYTCHK to 1 if EDTL != 0.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-03-20 12:15:44 -04:00
Ronnie Sahlberg
383e6572d4 Use srcdir to find the includes for the build
From Yuri Stotski <Yuri.Stotski@dell.com>
We need to include files relative to srcdir or else they can not be found
when building from a different directory.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-02-17 21:41:26 -08:00
Ronnie Sahlberg
cd0dcb5dae Make iscsi-ls default to HeaderDigest=None for its discovery session
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-02-17 18:18:08 -08:00
Ronnie Sahlberg
b1003dc75a Add URL arguments to enable/disable header digest
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-02-17 17:58:19 -08:00
Ronnie Sahlberg
a1cbd8a2ce Merge pull request #237 from bvanassche/master
Three libiscsi fixes
2017-02-05 07:41:12 -08:00
Bart Van Assche
71c797fd1c test-tool: Fix a segmentation fault in test_receive_copy_results_op_params()
Do not access the RECEIVE_COPY_RESULTS() output if this operation
failed.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-01-23 10:55:53 -08:00
Bart Van Assche
9df32565a6 test-tool/test_async_read.c: Allocate large arrays dynamically
This patch avoids that Valgrind complains about the memset() call
that was used to initialize the array that it triggers an invalid
write.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-01-23 10:55:53 -08:00
Bart Van Assche
38e6ab7582 Spelling fix: incase -> in case
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2017-01-23 10:55:53 -08:00
Ronnie Sahlberg
81f7f60e6c Merge pull request #236 from plieven/fix_sync_ret
sync: fix return value for various sync commands
2017-01-23 07:12:52 -08:00
Peter Lieven
b5210a1e31 sync: fix return value for various sync commands
all sync commands that return an integer value are
supposed to return a negative value on error.
However, state.status is positive non-zero on error.
Fix this by returning -1 if the state.status is
not SCSI_STATUS_GOOD.

Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-23 15:40:09 +01:00
Ronnie Sahlberg
9f4f6f85d0 Merge pull request #234 from optimistyzy/19_1
iscsi-perf: fix overflow issue in fill_read_queue
2017-01-09 18:07:43 -08:00
optimistyzy
63cfcd3384 iscsi-perf: fix overflow issue in fill_read_queue
If with int defintion, this statement:

num_blocks = client->num_blocks - client->pos;

May not get the exact value we want.

Signed-off-by: optimistyzy <optimistyzy@gmail.com>
2017-01-09 18:38:59 +08:00
Ronnie Sahlberg
20f52ea756 Add test that ipv6 works
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-08 13:12:16 -08:00
Ronnie Sahlberg
179f6b33d4 Fix IPV6
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-08 12:57:12 -08:00
Ronnie Sahlberg
2eefdbb9e8 Lost patch when resolving conflicts
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-07 09:06:59 -08:00
Ronnie Sahlberg
178b3ec5b9 XCOPY: Only set the write flag if we actually have DATA-OUT
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-07 08:57:45 -08:00
Ronnie Sahlberg
f915aabf57 Merge pull request #231 from plieven/read_batch_pdu2
Batch pdu read in function iscsi_read_from_socket()
2017-01-07 08:42:32 -08:00
Ronnie Sahlberg
33d0b63717 Merge branch 'master' into read_batch_pdu2 2017-01-07 08:42:12 -08:00
Ronnie Sahlberg
310674224c Merge pull request #233 from plieven/for_upstream
fix crc32c header checksums and some bugs
2017-01-07 08:32:32 -08:00
Peter Lieven
eb7c1d9b0c socket: process PDUs directly after receiving them
this eliminated the need for an inqueue

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-06 11:48:17 +01:00
Ronnie Sahlberg
8784a2b65f Bump API version
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-01-05 19:33:40 -08:00
Peter Lieven
0225c662d0 socket: restore connected_portal info
this got lost in commit 0d6362f

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 14:47:51 +01:00
Peter Lieven
1cbeec6bdc pdu: verify header digest
we never verified the received header digest. do that now.

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 14:41:21 +01:00
Peter Lieven
443b104833 crc32c: use uint_t types
Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 14:39:15 +01:00
Peter Lieven
55eacac425 login: add logging for the negotiation login parameters
Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 12:33:47 +01:00
Peter Lieven
23738bf1c3 socket: calculate header checksum at the right place
we mangled the PDU header after calculating the checksum which
effectively broke CRC32C header digests completely.

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 12:28:37 +01:00
Peter Lieven
ed1ed27dde socket: return in->hdr to smalloc pool
commit bc64420 introduced an extra smalloc for the in->hdr,
however it did use iscsi_free instead of iscsi_sfree to free it.

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 12:19:20 +01:00
Peter Lieven
1a552a8afa socket: do not zero header of incoming PDU
we overwrite it anyway

Signed-off-by: Peter Lieven <pl@kamp.de>
2017-01-05 12:19:07 +01:00