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>
Instead of adding __attribute__((unused)) to unused arguments, add the
-Wno-unused-parameter compiler flag.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Instead of defining the macro _R_(), define __attribute__() as a macro for
compilers that do not support __attribute__(), namely Microsoft Visual
Studio.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Looking at test_write10_residuals.c, test_write12_residuals.c and
test_write16_residuals.c tests the similarity of the testing scenario
can be found. There are several EDTL and SPDTL combinations which are
the same for different length write command tests. They form the core
of testing scenario of these commands. There aren't so much differences
in the way of testing these combinations itself either. It is possible
to move the main parameters describing the testing scenario into a
separate structure and move the scenario itself into a separate function.
It will increase the readability and reduce the duplicate code of these tests.
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>
libiscsipriv.la exposes all symbols, so allows tests to perform low
level PDU manipulation, etc. without duplicating code.
As a trade-off, this results in a larger iscsi-test-cu, with libiscsi.so
linking removed.
Link: https://github.com/sahlberg/libiscsi/issues/297
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>
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>
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>