Some targets such as LIO support base64 encoded CHAP_R values. Test this
by intercepting hex-encoded CHAP_R responses and converting the value to
base64.
This will fail on targets which don't support base64; we should probably
skip the test instead.
base64 encoding is performed using the gnutls_base64_encode2() function,
so the test is only present for gnutls-enabled builds.
Signed-off-by: David Disseldorp <ddiss@suse.de>
This test checks regular sense/ascq values on miscompare as well as
the Information sense field, which should be set as follows:
sense key set to MISCOMPARE and the additional sense code set to
MISCOMPARE DURING VERIFY OPERATION. In the sense data (see 4.18 and
SPC-5) the offset from the start of the Data-Out Buffer to the first
byte of data that was not equal shall be reported in the INFORMATION
field.
Signed-off-by: David Disseldorp <ddiss@suse.de>
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>
Check for 0x0A descriptor support via SCSI_COPY_RESULTS_OP_PARAMS. If
supported, perform a 0x0A type XCOPY using target's
maximum_segment_length (or 256M if larger).
Signed-off-by: David Disseldorp <ddiss@suse.de>
In my tests I hit a stack overflow caused by infinite recursion of
.queue_pdu() calls, caused by .queue_pdu() not being restored in an
error path. Make the approach for restoring .queue_pdu() more robust.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
The iSCSICHAP.Simple test ensures that CHAP_A comma separated lists
are correctly handled. iSCSICHAP.Invalid tests a range of invalid
CHAP_A parameters.
Signed-off-by: David Disseldorp <ddiss@suse.de>
This test registers PR key and then sends a PR-In read-keys request with
an ALLOCATION LENGTH value that forces response truncation. Ensure that
the ADDITIONAL LENGTH is *not* modified as a result of the truncation.
This test currently passes against TGT but fails against LIO (fix
pending).
Signed-off-by: David Disseldorp <ddiss@suse.de>
Dispatch a write and subsequently reset the logical unit via iSCSI TMF.
This is based on the AbortTaskSimpleAsync test.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Based on the corresponding simple tests. Issue a WRITESAME request and
confirm that the data written matches the data read back.
Signed-off-by: David Disseldorp <ddiss@suse.de>
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>
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>
Check that the Persistent Reserve Out PREEMT request removes the
registration referenced by the service action key.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Check that the Persistent Reserve In REPORT CAPABILITIES response
carries valid LENGTH, ALLOW COMMANDS, and PERSISTENT RESERVATION TYPE
MASK fields.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Check that a Persistent Reserve Out CLEAR request:
- clears an existing reservation
- clears existing registration keys
- bumps the PRgeneration number
Signed-off-by: David Disseldorp <ddiss@suse.de>
Confirm that data is consistent across paths when using the atomic
COMPARE AND WRITE operation.
This should be extended in future to issue the requests simultaneously
across both paths, in an attempt to trigger a read/write race.
Signed-off-by: David Disseldorp <ddiss@suse.de>
This test issues a logical unit reset iSCSI TMF request, and then
confirms that all paths report a subsequent unit attention condition.
Signed-off-by: David Disseldorp <ddiss@suse.de>
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>
Remove the flags tests for READ* and replace them with a test for the DPO
and FUA bits.
IF the device claims DPOFUA support in modesense then the READ* CDBs
MUST allow these two flags. IF the device does NOT claim DPOFUA then any
READ* CDB with these flags must fail with invalod field in cdb.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Add a test for unmapping a single range of blocks and that
get_lba_status returns correct data.
Test unmapping a single block at offsets 0-255
Test unmapping 1-255 blocks at offset 0 and verify that
get_lba_status at LBA 0 returns a descriptor of 1-255 blocks.
get_lba_status at the last block of the unmapped range returns
a descriptor for a single block.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Free read_write_buf and task after each test. Free iscsi2 after
each PGR test when using CUnit version 2. Note: CUnit version 1
doesn't support test setup and teardown functions.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Linux distributions like openSUSE 12.3 include CUnit version 2.
Apparently libiscsi uses some CUnit version 1 data structures that
have been modified in CUnit version 2. This causes the libiscsi
build to fail against CUnit version 2. Fix this by detecting the
CUnit version during the configure step.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>