Commit Graph

699 Commits

Author SHA1 Message Date
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
Ronnie Sahlberg
99980b2437 TESTS: fix unsigned/signed warning in writesame tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-05-23 21:47:21 -07:00
David Disseldorp
3644504147 tests: add WRITESAME data verification tests
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>
2016-05-18 11:59:54 +02:00
Sitsofe Wheeler
f291c7f9c0 Tests: Exit iscsi-test-cu with 1 if a test fails
Make it easier for build systems to tell a test run had failures by
changing the exit code to 1.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2016-05-05 17:18:19 +01:00
Ronnie Sahlberg
a6fc65b4ef Tests: remove the warning if a SSD supports SANITIZE/OVERWRITE
There is technically no reason why a SSD with (assumingly with thin
provisioning) can not support SANITIZE/OVERWRITE instead or or in addition
to the more expected SANITIZE/BLOCK-ERASE so remove the warning for this.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-05-01 12:35:29 -07:00
Sitsofe Wheeler
190f5712fe Tests: Ensure each path sends a different initiator when using multipath
Tests such as ProutPreempt presume each path they have is sending a
different initiator name. When using multipath this did not happen and
initiatorname1 was used on all paths.

Fix this by creating and initializing an array (currently size 2) of
initiator names and iterating it in step with each new path we make
(hopefully the compiler will complain if iscsi-test-cu ever supports
more than two multipaths and there isn't a corresponding initiatorname).

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2016-04-05 09:13:15 +01:00
Ronnie Sahlberg
678d70eb68 Tests: writeatimic simple. Make sure that writes are aligned correctly
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-04-03 09:56:16 -07:00
Sitsofe Wheeler
71879c913a Silence clang missing-field-initializers warning
When libiscsi is built with clang several spurious
missing-field-initializers warnings like the following are reported:

test_async_write.c:61:45: error: missing field 'completed' initializer
[-Werror,-Wmissing-field-initializers]
	struct tests_async_write_state state = { 0 };

These appear to be due to clang being overzealous in its checking
because the code is legal C (see
https://llvm.org/bugs/show_bug.cgi?id=21689 ) but it causes compilation
to be aborted. Workaround the problem by specifying a 0 or NULL for each
structure member.
2016-03-31 20:32:47 +01:00
Ronnie Sahlberg
8afffbd506 Fix compiler warning
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-03-27 10:51:05 -07:00
David Disseldorp
bf9c7cb277 test: simple ABORT TASK TMF test
Dispatch a write and subsequently abort it.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-22 21:27:25 +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
David Disseldorp
9ae5a64662 Tests: Asynchronous iSCSI Multipath Compare And Write
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>
2016-03-11 19:16:10 +01:00
David Disseldorp
51da17c41f Tests: Asynchronous iSCSI write test
Dispatch a number of WRITE10 requests simultaneously, and await all
responses.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-03-11 18:53:24 +01:00
David Disseldorp
ebeca19480 Tests: Asynchronous iSCSI read test
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>
2016-03-10 18:20:37 +01:00
Ronnie Sahlberg
83a4f54cb8 Remove a trailing CU_ASSERT_EQUAL(ret we no longer need
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-24 18:11:14 -08:00
Ronnie Sahlberg
c5bc0a49b0 Tests: Fix the retry loop for the reserve6 helpers.
We should exit the loop once we have a command that is NOT
aborted with unit attention.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-23 21:34:34 -08:00
David Disseldorp
2feb4d40db TESTS: add 4MB overlap test to write10_simple
Ceph RADOS block devices split images into 4MB objects. This test
ensures that cross object IOs are successful.

Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-02-23 21:00:25 -08: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
5a80c7b581 Fix some clang warnings
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 16:13:53 -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
b5402d55c2 Tests: Make readonly-sbc tests use the new helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:52:15 -08:00
Ronnie Sahlberg
ce0a22e040 Tests: Use the helpers in NoMedia tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:52:03 -08:00
Ronnie Sahlberg
1deee0898a Tests: Add a test that RC16 must be supported when SBC3 is claimed
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:51:53 -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
69f4dc76ca Tests: Convert remaining write16 to new helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 15:40:32 -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
Ronnie Sahlberg
72cfdbb5f1 Tests: Make null pointer asserts abort the test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-21 14:55:54 -08:00
Ronnie Sahlberg
99a5f99527 Add some emacs defaults. Tabs are 8 spaces.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-02-18 21:34:43 -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