Commit Graph

607 Commits

Author SHA1 Message Date
Ronnie Sahlberg
4c87f455ae TESTS: Verify that MAX_ATOMIC_XFER_LEN is <= MAX_XFER_LEN
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-09 06:55:13 -07:00
Ronnie Sahlberg
b4cdf07271 Add tests that BlockLimits VPD matches the AtomicWrite16 support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-09 06:49:51 -07:00
Ronnie Sahlberg
6c16f9e322 Add tests for WRITE_ATOMIC_16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-09-08 10:17:15 -07:00
Bart Van Assche
9826147581 test_extendedcopy_descr_limits: Fix a crash if this command is not supported
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>
2015-09-06 07:05:36 -07:00
Ronnie Sahlberg
3b8b42d976 TESTS: Add missing check for not supported : RECEIVE_COPY_RESULTS
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:57:45 -07:00
Ronnie Sahlberg
0bb846c0f5 Don't use alloca for large blobs.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:57:32 -07:00
Ronnie Sahlberg
a6f7c06119 Add support and tests for ExtendedCopy and ReceiveCopyResults
From sushma.gurram@sandisk.com
Add support to libiscsi and tests for these two opcodes.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:57:21 -07:00
Ronnie Sahlberg
4518dfa43c Don't leak memory in the test helper for write16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:16:58 -07:00
Ronnie Sahlberg
c29b9bcc60 TEST: NULL out rsop_task after freeing it to avoid double free.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-08-02 12:16:54 -07:00
Ronnie Sahlberg
ed17e17f8e Fix broken makefile
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-16 07:06:43 -07:00
Adam Grare
838c35b693 test_modesense6_control_swp test: read current control before modeselect6
After checking if SWP can be changed the current control page has
to be read back before sending it to initiator with modeselect6.
2015-06-11 16:48:43 -04:00
Ronnie Sahlberg
f240ef1cc7 Merge pull request #173 from rodrigc/fix4
reserve6 tests: fix login parameters
2015-06-04 00:15:52 -07:00
Ronnie Sahlberg
c7398ac0d1 Merge pull request #171 from rodrigc/fix2
test_modesense6_control_swp: skip test if target cannot change swp
2015-06-04 00:13:37 -07:00
Craig Rodrigues
7fe7891e84 reserve6 tests: fix login parameters 2015-06-03 20:23:09 +00:00
Craig Rodrigues
1995298914 test_modesense6_control_swp: skip test if target cannot change swp
Signed-off-by: Vadim Finkelstein <vadim@pi-coral.com>
2015-06-03 18:54:29 +00:00
Craig Rodrigues
ff7a73360a test_reserve6_target_cold_reset: fix login parameters
Signed-off-by: Vadim Finkelstein <vadim@pi-coral.com>
2015-06-03 02:30:31 +00:00
Ronnie Sahlberg
a8e42680ed MULTIPATH TESTS: Remove the iscsi-only restriction. The tests work for /dev/* too
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:28:49 -07:00
Ronnie Sahlberg
2388db9f12 MULTIPATH TEST: use READ10/WRITE10 instead of READ16/WRITE16
Many small devices do not implement the 16 version of these commands.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:27:51 -07:00
Ronnie Sahlberg
3601799a1b MULTIPATH TESTS: fix another bug where we did an inquiry for the wrong page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:18:28 -07:00
Ronnie Sahlberg
95d763d9f9 TESTS: Add comment to describe why we keep a pointer around for iscsi_queue_pdu
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 21:16:39 -07:00
Ronnie Sahlberg
86a42c8b3a MULTIPATH TESTS: pass the right pointer back when copying a des
Else we will double free and crash.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-06-01 19:39:13 -07:00
Ronnie Sahlberg
86df6c9a20 MULTIPATH TESTS: We need to pass the correct evpv/pagecode when we reissue an inquiry
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>
2015-06-01 19:30:19 -07:00
David Disseldorp
34dea87a69 test: add simple multipath IO test
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>
2015-05-28 19:27:21 +02:00
David Disseldorp
43b47cf1fb test/multipath: add MPATH_SKIP_IF_UNAVAILABLE macro
Check whether multiple SCSI device paths are available, if not then skip
the test.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2015-05-28 16:56:21 +02:00
David Disseldorp
024fe873e3 iscsi-test-cu: support multiple iSCSI URLs for multipath
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>
2015-05-28 16:56:18 +02:00
David Disseldorp
a291c2b308 test: add multipath helper functions
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>
2015-05-28 16:52:54 +02:00
Ronnie Sahlberg
2f10f05084 TESTS: improve text output for test_report_supported_opcodes_rctd
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-13 19:54:50 -07:00
Ronnie Sahlberg
6e4a84f815 TESTS Add the modesense tests to the linux family
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-13 19:50:24 -07:00
Ronnie Sahlberg
d9352865c2 TESTS: Skip the test with a warning if BlockDevChar VPD page is missing
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:30:04 -07:00
Ronnie Sahlberg
2a6264f76e TESTS: Change ModeSense6.Control D_SENSE test to work with /dev/* devices
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>
2015-05-12 20:25:29 -07:00
Ronnie Sahlberg
b2b474f3ad TESTS: Allow inquiry(block dev characteristics) to fail
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:11 -07:00
Ronnie Sahlberg
811c04f01a TESTS: read12/read16 change signature to return an optional task structure
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-05-12 20:25:04 -07:00
Craig Rodrigues
3aec1a37a9 Skip unsupported tests instead of failing
* SCSI_REPORT_SUPPORTING_OPCODE
* SCSI_REPORT_SUPPORTING_SERVICEACTION
2015-05-07 07:09:13 -04:00
Peter Lieven
b4098c535e init: make LIBISCSI_CACHE_ALLOCATIONS a public environment variable
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>
2015-05-05 14:10:44 +02:00
Bart Van Assche
e7a90f7ecb test_sanitize_overwrite: Fix three log messages
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>
2015-04-27 19:19:30 -07:00
Bart Van Assche
52a57d26f2 test-tool: Improve reliability of status_is_invalid_opcode()
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>
2015-04-27 19:18:41 -07:00
Bart Van Assche
8435f9722e lib: Parse sense specific descriptor
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>
2015-04-27 19:17:51 -07:00
Bart Van Assche
fbc87ab12f test_compareandwrite_dpofua: Fix this test
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>
2015-04-27 19:15:54 -07:00
Chris Zankel
a4bde6adfd test_writesame16_unmap_until_end: pass 0 blocks instead of 0-length block
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>
2015-04-23 17:40:02 -07:00
Chris Zankel
de512a5888 test_unmap_0blocks: skip multi-descriptor test if unsupported
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>
2015-04-23 17:39:49 -07:00
Chris Zankel
fff67ba7dd test_writesame*_0blocks: skip 0-block test if unsupported
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>
2015-04-23 17:36:38 -07:00
Chris Zankel
9068f23f95 test-tool: print (logging) the actual sense code if mismatch
Print (log) the actual sense code that was returned if it doesn't match the
expected value.

Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-22 18:18:27 -07:00
Chris Zankel
e186169064 build: fix 'out-of-tree' build
Prefix include paths with '${srcdir}' to allow 'out-of-tree' builds:

  cd $BUILD
  $LIBISCSI/configure
  make

Signed-off-by: Chris Zankel <chris@zankel.net>
2015-04-22 18:18:14 -07:00
Bart Van Assche
cf4076dba9 test-tool: Make it possible to disable memory caching
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>
2015-04-20 07:01:17 -07:00
Bart Van Assche
e3e4d8730c test_write*_residuals: Fix overflow tests
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>
2015-04-20 06:51:02 -07:00
Ronnie Sahlberg
b6fc366b5c TESTS: Add a test for D_SENSE in the CONTROL mode page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-19 18:20:12 -07:00
Ronnie Sahlberg
669998e9d7 TESTS: the CONTROL mode page has SPF==0
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>
2015-04-19 17:27:20 -07:00
Christoph Hellwig
60a0289d74 iscsi-test-cu: set up vectored transfer length properly
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.
2015-04-18 12:06:14 -07:00
Ronnie Sahlberg
b745e28573 TESTS: remove some dead code
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-18 08:48:43 -07:00
Christoph Hellwig
b89f6592c4 iscsi-test-cu: fix implicit DATA OUT buffers with SG_IO
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>
2015-04-18 08:44:24 -07:00