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>
When we reissue an inquiry due to the firast attempt not containing
all of the data, make sure to ask for the same page once we know the
proper size and ask again.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
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>
Connect to each iSCSI URL provided, and confirm that they all correspond
to the same multipathed logical unit by using the previously added
mpath_check_matching_ids() helper.
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>
Stop calling out to libiscsi specific interfaces for faling a command
and checking the sense data. Use the now generic read16() which now works
also for normal device nodes.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
this variable was introduced for iscsi-test-cu only. This patch
makes it a generic environment variable that can be set per context.
Signed-off-by: Peter Lieven <pl@kamp.de>
check_lun_is_wiped() verifies whether the 256 blocks following LBA
'lba' contain byte value 'c'. Modify the log messages such that these
refer to byte value 'c' instead of to zero. Change the argument type
of 'c' from char into unsigned char to avoid that 'c' is sign
extended in the log statements.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
The test_report_supported_opcodes_one_command() sends SCSI commands
to the target for which the target has to reply with ILLEGAL REQUEST
/ INVALID FIELD IN CDB. Avoid that such a reply is misinterpret as
"command not supported" by checking the field offset in the sense
descriptor. See also patch "test tool: Detect unsupported opcodes
correctly" (commit ID fe9620092c).
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Extend struct scsi_sense with sense specific descriptor information,
introduce the function scsi_parse_sense_data() and let that function
parse the sense specific descriptor.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Initialize the buffer with data from the medium to avoid to
trigger a miscompare and double the compareandwrite() xferlen
argument.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
The test:
"Test WRITESAME16 of 1-256 blocks at the end of the LUN by setting
number-of-blocks==0"
was passing 0 for the data length instead of the block count.
Signed-off-by: Chris Zankel <chris@zankel.net>
Some targets only support a single descriptor for unmap operations,
so skip (CU_PASS) the test cases that use multiple descriptors in
those cases. Only run the tests if maximum_unmap_block_descriptor_count
is less than 2.
Also the test
"Test UNMAP of 0 blocks at LBA:0-255 with one descriptor per block")
was passing one less descriptor.
Signed-off-by: Chris Zankel <chris@zankel.net>
Skip 0-block WRITE SAME tests for targets that don't support these
operations, ie. they have write_same_no_zero (WSNZ) set in the
block limits vpd.
Also, fix the test:
"Test WRITESAME10 of 1-256 blocks at the end of the LUN by setting
number-of-blocks==0"
to actually pass 0 blocks instead of the number of remaining blocks to the end.
Signed-off-by: Chris Zankel <chris@zankel.net>
Disable memory caching in libiscsi if the environment variable
LIBISCSI_CACHE_ALLOCATIONS has been set to zero. This makes
Valgrind reports more meaningful.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
RFC 3720 is not clear about whether a target should return SUCCESS
or CHECK CONDITION if SPDTL > EDTL. Hence accept both. See also
Fred Knight, Re: [Ips] Data Out residual overflow/underflow handling,
IETF mailing list archive, 21 September 2012
(http://www.ietf.org/mail-archive/web/ips/current/msg02756.html).
This patch reworks the changes introduced via commit
cfce944b35 and applies similar changes
to the other WRITE and WRITE VERIFY tests.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
When scanning for the CONTROL mode page we must also check that SPF==0
since otherwise we might pick up CONTROL EXTENSIONS or other subpages
that may be returned.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
I didn't set up the transfer length properly for the vectored SG_IO
support in the previous patch, which makes some implementations
of the ioctl unhappy. Fix this up per the spec.
Command like PERSISTENT RESERVE OUT fill out DATA OUT data in their
CDB setup routine, but the SG_IO code doesn't look at that, leading
to a segfault when issueing such commands. Fix this by copying over
some code from the iSCSI path.
Signed-off-by: Christoph Hellwig <hch@lst.de>