If a previous run of the test tool had been interrupted one or
more persistent reservation keys can still be registered. This
can cause tests in the new run to fail. Avoid this by clearing
these keys before running any tests. Do this only if --dataloss
has been specified.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Avoid that running the regression tests against a LUN with size zero triggers
the following assertion failure:
lt-iscsi-test-cu: iscsi-support.c:1666: read6: Assertion `task != ((void *)0)' failed.
Aborted
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This patch does not change any functionality but removes the number
of casts in the test tool source code.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
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>
test_iscsi_tur_until_good() dispatches TUR requests until the target has
cleared all UAs for the given sd, or the maximum number of retries is
reached.
This helper function is useful for any test that needs to deal with UAs
(e.g. PRs), so should be moved out into common code.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Issue a Persistent Reservation Out PREEMPT request, with keys and type
provided.
PREEMPT allows for the removal of registrations, and replacement of
reservations.
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>
Issue a Persistent Reservation In REPORT CAPABILITIES request and parse
the response. Callers can obtain the unmarshalled response data via the
_rcaps parameter.
Signed-off-by: David Disseldorp <ddiss@suse.de>
This test currently reconnects to the base sd for multi-initiator
testing. Use the secondary multipath device instead, if available.
Signed-off-by: David Disseldorp <ddiss@suse.de>
These tests currently reconnect to the base sd for multi-initiator
testing. Use the secondary multipath device instead, if available.
Signed-off-by: David Disseldorp <ddiss@suse.de>
These tests currently reconnect to the base sd for multi-initiator
testing. Use the secondary multipath device instead, if available.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Many tests currently reconnect to the base sd for multi-initiator
testing. Use the secondary multipath device instead, if available.
Signed-off-by: David Disseldorp <ddiss@suse.de>
A number of existing tests create a secondary iSCSI session by logging
into the target specified in the base sd during the test.
With multipath sessions now connected during iscsi-test-cu startup
(when launched with multiple URIs), secondary sessions can be
provided via multipath when available, rather than reconnecting.
This change adds a helper that conditionally returns the secondary
multipath device if available, or falls back to creating a new session
via the base sd target details.
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>
MPATH_SKIP_UNLESS_ISCSI(_sds, _num_sds) iterates over all _sds, and
skips the test unless all paths are iSCSI based.
Signed-off-by: David Disseldorp <ddiss@suse.de>
From Alexander Motin <mav@freebsd.org>
Treat BlockLimits VPD atomic granulatity/alignment reported as 0
(no restrictions) as == 1 (also means no restriction).
Both 0 and 1 mean that there is no restriction on alignment or
granularity but with the difference being that the second value can
be used to increment to the next valid LBA.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Avoid that this test crashes as follows if the RECEIVE COPY RESULTS
command is not supported:
[FAILED] RECEIVECOPYRESULT command failed with sense. (null)
Segmentation fault
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sushma Gurram <Sushma.Gurram@sandisk.com>