Ronnie Sahlberg
39001203b7
TESTS: simple support for READDEFECTDATA10/12
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-09-22 22:43:16 -07:00
Ronnie Sahlberg
bb22ff71eb
TESTS: Add tests that a target will reject WriteSame where DataOut has invalid size.
2016-09-21 19:53:22 -07:00
Ronnie Sahlberg
df1dc08eb7
TESTS: cleanup and remove noise warnings for iscsi cmdsn tests
...
The iscsi cmdsn tests are noisy and generate a lot of [FAILURE]
warnings for things that are expected.
Fix this by do the plumbing to allow using a EXPECT_STATUS_TIMEOUT
for commands we expect will never be replied to and will thus time out.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-07-11 20:50:47 -07:00
Sitsofe Wheeler
b908bdeb99
Tests: WRITESAME 0-blocks fixes and improvements
...
The current WRITE SAME (WS) 0 blocks test at LBA 0 isn't always correct
because if:
- The target's WSNZ bit set is 0
- The target's MAXIMUM WRITE SAME LENGTH (MWSL) is greater than 0
- We are issuing a WS with a NUMBER OF LOGICAL BLOCKS of 0
then whether the command should return success or failure depends on
whether the starting LBA is within MWSL blocks of the end of the LUN
(see http://www.t10.org/pipermail/t10/2016-May/017988.html for details).
Replace the vestigial code which tried to handle this (but no longer
worked since commit 8585e4509b ) and add
some additional MAXIMUM WRITE SAME LENGTH tests.
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com >
2016-05-30 12:37:58 +01:00
David Disseldorp
bfd614053e
test-tool: add test_get_clock_sec() helper
...
Useful for test IO timeouts.
Signed-off-by: David Disseldorp <ddiss@suse.de >
2016-03-22 21:19:59 +01:00
Ronnie Sahlberg
8a44851128
Tests: Add a helper for the all_zero checker
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-23 19:26:15 -08:00
Ronnie Sahlberg
b4320bd76c
Tests: convert tabs to 8 spaces
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 16:17:18 -08:00
Ronnie Sahlberg
efedc02224
Test: Add helper for MODESENSE6
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:52:26 -08:00
Ronnie Sahlberg
9f81ae91fe
Tests: Add helper for READCAPACITY10
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:51:42 -08:00
Ronnie Sahlberg
80e06cae30
Tests: Add helped for UNMAP
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:51:34 -08:00
Ronnie Sahlberg
d3913ee864
Tests: add helpers for synchronizecache
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:51:20 -08:00
Ronnie Sahlberg
ea8e4c4115
Tests: add helper for TESTUNITREADY
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:51:11 -08:00
Ronnie Sahlberg
05fb882e19
Tests: add getlbastatus helper
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:50:58 -08:00
Ronnie Sahlberg
23a9278e23
Tests: Add helpers fro preventallow/startstopunit
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:49:22 -08:00
Ronnie Sahlberg
d910bab852
Tests: add helpers for PREFETCH*
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:48:53 -08:00
Ronnie Sahlberg
9d7103e5ac
Tests: helpers for READ6
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:48:22 -08:00
Ronnie Sahlberg
935c2cba22
Tests: helper for READCAPACITY16
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:47:59 -08:00
Ronnie Sahlberg
c48283fe75
Tests: add helpers for read*
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:45:23 -08:00
Ronnie Sahlberg
0a814db48f
Tests: Add helpers for ORWRITE
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:40:59 -08:00
Ronnie Sahlberg
b01780b9ee
Tests: Add helpers for ExtendedCopy and ReceiveCopyResults
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:39:59 -08:00
Ronnie Sahlberg
9afd4a4412
Test: add helpers for reserve6/release6
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:36:18 -08:00
Ronnie Sahlberg
39d128db6d
Tests: Add helpers for SANITIZE
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:34:54 -08:00
Ronnie Sahlberg
d18dbe49aa
Tests: add helper for WRITEATOMIC16
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:32:41 -08:00
Ronnie Sahlberg
0b5b724f17
Tests: Add helpers for WRITESAME
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:28:59 -08:00
Ronnie Sahlberg
4d1e3aecd0
Tests: add helper macro for REPORT_SUPPORTED_OPCODES
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:25:21 -08:00
Ronnie Sahlberg
f699503f8c
Tests: Create helper macro for COMPAREANDWRITE
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:21:46 -08:00
Ronnie Sahlberg
f88bcf61cc
Tests: Create a global scratch buffer and avoid allocating memory in the tests
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:17:43 -08:00
Ronnie Sahlberg
b4e4649ae5
Tests: Add helper macros for Verify*
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:14:06 -08:00
Ronnie Sahlberg
eba1ac059a
Tests: Add helper macros for Write*
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:07:55 -08:00
Ronnie Sahlberg
bd29dab95b
Tests: Create helper macros for the WriteVerify* commands
...
By creating a helper macros for WriteVerify we can save a lot of boilerplate
code.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2016-02-21 15:04:36 -08:00
Bart Van Assche
be9b803334
test-tool: Avoid that using receive_copy_results() triggers a use-after-free
...
Move the scsi_free_scsi_task() call from receive_copy_results() to the
callers of this function to avoid that accessing the unmarshalled data
triggers a use-after-free.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-12-24 10:38:38 -08:00
Bart Van Assche
2d412530c1
test-tool: Move all_zeroes() helper function to iscsi-support.c
...
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-10-07 07:44:18 -07:00
Bart Van Assche
393165d66a
test-tool: Remove three casts
...
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 >
2015-10-07 07:43:00 -07:00
David Disseldorp
a1d11eb0f9
test: move UA drain helper function into iscsi-support
...
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 >
2015-09-30 11:00:25 +02:00
David Disseldorp
760ae95d9c
test: add prout_preempt() helper function
...
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 >
2015-09-30 11:00:25 +02:00
David Disseldorp
9c524b37fa
test: add prin_report_caps() helper function
...
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 >
2015-09-30 11:00:19 +02:00
David Disseldorp
a90e5a3d4c
test/iscsi-support: PR Out CLEAR helper function
...
Add a helper function to dispatch Persistent Reserve Out requests with
CLEAR service action.
Signed-off-by: David Disseldorp <ddiss@suse.de >
2015-09-18 18:06:19 +02: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
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
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
Ronnie Sahlberg
68acbb7c3f
rand_key: fix non-randomness in rand_key()
...
If rand_key() is called twive within the same second it would return the
same key both times. Not very random.
Redo how rand_key() works to make it more likely to be random and more likely
that two consequtive calls do not yield the same result.
Reported-by: CyberLoiter <yanming.xiao@gmail.com >
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2015-02-10 16:57:22 -08:00
Ronnie Sahlberg
58f06b0e74
TESTS: get rid of a sanitize helper
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-10-14 19:39:27 -07:00
Ronnie Sahlberg
8ac7d64082
TESTS: convert most of SANITIZE to new saner api
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-10-14 19:25:17 -07:00
Ronnie Sahlberg
14461757c4
TESTS: Allow Hardware/Software write protect as valid ASCQ
...
Add 0x2701/0x2702 to the list of valid ASCQ values we accept for devices
that are write protected.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-10-08 06:23:43 -07:00
Ronnie Sahlberg
45d87238e2
TESTS: Flag a whole bunch of tests as not supported on non-iSCSI backends
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-27 08:58:24 -07:00
Ronnie Sahlberg
abbf9a11b0
TESTS: change modeselect to become /dev/sg-aware
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-27 08:10:14 -07:00
Ronnie Sahlberg
55c1f0d2ec
TESTS: Add support to test against a /dev/sg device on linux
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-19 16:26:46 -07:00
Ronnie Sahlberg
48e14f5ccf
TESTS: update main program to use helpers instead of calling directly to libiscsi
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-19 06:21:02 -07:00
Ronnie Sahlberg
8ed2ad9b69
TESTS: start abstracting away the error string handling from transports
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-18 19:20:49 -07:00
Ronnie Sahlberg
072291c852
TESTS: change the function signatures for the helpers
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2014-09-18 18:19:04 -07:00