Commit Graph

852 Commits

Author SHA1 Message Date
Ronnie Sahlberg
a95a83764a TESTS: fixup a log message to be nore accurate 2013-03-23 15:32:05 -07:00
Ronnie Sahlberg
5b29ad2ddf TESTS: Add test for READ10 to check that over/underflow residuals are generated correctly. 2013-03-23 12:44:55 -07:00
Ronnie Sahlberg
808eed9680 Make task->residual a size_t instead of an int
Update and improve the log messages for failures for the read10 invalid test
2013-03-23 11:23:02 -07:00
Ronnie Sahlberg
2d10d0a2d8 TESTS: Update the "invalid read10" test with better description and logging of what exactly it tests 2013-03-23 10:35:39 -07:00
Ronnie Sahlberg
3e358bb192 TESTS: in RESERVE6 test, allow slow targets 3 seconds to notice the nexus loss and drop the reservation 2013-03-23 10:13:03 -07:00
Lee Duncan
510883f28f fix reregister to check for resvn conflict
According to SPC, an attempt to register on
a registeried I_T Nexus with the incorrect
reservation key should produce a reservation
conflict.
2013-03-22 17:57:51 -07:00
Lee Duncan
cfc83f0b4f Reservation type not needed to register. 2013-03-22 17:56:59 -07:00
Ronnie Sahlberg
fd77387c66 TESTS: Add tests to verify a RESERVE6 is dropped on logout and it-nexus loss 2013-03-21 19:55:24 -07:00
Ronnie Sahlberg
6c0fd5cfa3 TESTS: Add RESERVE6/RELEASE6 tests 2013-03-21 19:41:32 -07:00
Ronnie Sahlberg
d5c5fb83af We should still be able to login even if the device is reserved.
TESTUNITREADY returning reservation conflict is no reason to fail the login
2013-03-21 19:26:55 -07:00
Ronnie Sahlberg
6a3888e39e TESTS: Old and new testsuite tested slightly different things for 0block tests
Change all tests in the old testsuite to check 0block tests 2 blocks past the end of the device, just like the new testsuite.

These tests check that we get an error if we do a 0-block read/write etc beyond the end of the device.

In the SBC standard, the only thing that discusses LBA_OUT_OF_RANGE is wordings
such as this :
	If the LBA plus the transfer length exceeds the capacity of the medium,
	then the device server shall terminate the command with CHECK CONDITION
	status with the sense key set to ILLEGAL REQUEST and the additional
	sense code set to LOGICAL BLOCK ADDRESS OUT OF RANGE.

This is very clear for when transfer length is > 0,  but what when
transfer length is == 0?

Assume we have a device that is 0x31fff in size.
With this wording, if we read 1 block at LBA : 0x31fff  we end up at 0x32000
and this is at the end, but not beyond the end.
We are reading/accessing the last block at 0x31fff and we stop at 0x32000.

Similarly, if we are reading 1 block, starting at 0x32000 and reading to 0x32001 which would be LBA_OUT_OF_RANGE since we are accessing beyond the end of the device.

The question now is what happens if we try to read 0-blocks  just at the edge at the end of the device.
I.e. What is we try to read 0 blocks at LBA:0x32000 ?

Looking at the standard, the wordings say that this should be fine.
Because the SBC standard only says that we should check LBA+transfer length.
Thus since 0x31fff + 1 block   is exactly the same as 0x32000 + 0 blocks
thus a device SHOULD allow reading of 0 blocks just at the end.

This is the conclusion from reading SBC by the letter. However It might be unreasonable to do so and it might be wiser to just stay away from this ambigous area of SBC.

Following the SBC standard by the letter,   the new test suite was wrong since it should have flagged this as a failure. But it did checks on one block beyond the blobk at the end of the device.  It checked that we would fail  for 0x32001 in the example above.

Strictly, I should have fixed the new test to check 0x32000   but I think it might be unreasonably to enforce something here for this ambigous area of "what happens when accessing 0 blocks just at the edge of the device".

So instead I have changed the OLD tests so that they now check one block further on. In the example above it means they too now check 0x32001  instead of 0x32000.
Technically speaking this is wrong,  but this is the imho reasonable thing to do.
2013-03-19 18:04:24 -07:00
Ronnie Sahlberg
f11749ca52 TEST: Add test that all mandatoryb VPD pages are available on SBC devices 2013-03-12 19:26:39 -07:00
Ronnie Sahlberg
ec70169380 TEST: Add test for the supported VPD pages and that we can read them 2013-03-12 18:41:57 -07:00
Ronnie Sahlberg
e84b71af15 TEST: Add test for EVPD bit for INQUIRY commands 2013-03-12 18:29:24 -07:00
Ronnie Sahlberg
b10641566e TESTS: Add tests for INQUIRY allocation length.
Add special test that for SPC3+ devices we do have 16 bits of alloc length available.
2013-03-11 18:32:29 -07:00
Ronnie Sahlberg
f8901ea18e Merge pull request #61 from plieven/ascq
Add ASCQ codes related to thin-provisioning
2013-03-11 06:46:20 -07:00
Ronnie Sahlberg
f2e244f10c Merge pull request #60 from plieven/defer_reconnect
Fixes for iscsi_set_reconnect_max_retries()
2013-03-11 06:45:29 -07:00
Peter Lieven
80ef1807ef Add ASCQ codes related to thin-provisioning
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-03-11 12:13:42 +01:00
Peter Lieven
5a94d5d73a fix leak of iscsi_context in iscsi_reconnect
in case the maximum number of reconnects is limited with
iscsi_set_reconnect_max_retries() the an iscsi_context
is leaked if the limit is exhausted.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-03-11 08:51:18 +01:00
Peter Lieven
327b51ed5b do not reconnect if reconnect is already defered
If the amount of reconnects is limited with iscsi_set_reconnect_max_retries()
it might happen that iscsi_reconnect is called while there is already a deferred
reconnect.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-03-11 08:44:11 +01:00
Ronnie Sahlberg
0bc415761a TESTS: Add test for standard inquiry page 2013-03-10 19:02:45 -07:00
Ronnie Sahlberg
3e28133a9a Add unmarshallers for READ*/VERIFY*/WRITE* cdb 2013-03-10 09:19:23 -07:00
Ronnie Sahlberg
ad0b14e833 TEST: Add a test to verify PREVENT REMOVALs are seen across all nexuses 2013-03-03 13:44:16 -08:00
Ronnie Sahlberg
0d5c8a4f11 TESTS: Add test for PREVENTALLOWMEDIUMREMOVAL are cleared on lun/target reset 2013-03-03 13:37:52 -08:00
Ronnie Sahlberg
d288d5a8b6 TESTS: Add tests for prevent/allow medium removal 2013-03-03 10:05:57 -08:00
Ronnie Sahlberg
a2fd736930 TESTS: Add tests for medium access commands when medium is ejected 2013-03-03 09:26:34 -08:00
Ronnie Sahlberg
44c789c9c8 TESTS: Add tests for STARTSTOPUNIT 2013-03-02 16:53:40 -08:00
Ronnie Sahlberg
fdd15d7b08 SPEC: add the manpages and read16 command to the specfile 2013-02-24 12:44:22 -08:00
Ronnie Sahlberg
397735a5db Add the manpage XML files to the distribution 2013-02-24 12:20:57 -08:00
Ronnie Sahlberg
e4c800d998 DOC: Add manpage for iscsi-inq 2013-02-24 11:02:06 -08:00
Ronnie Sahlberg
777936507a MANPAGES: Add manpage for iscsi-ls 2013-02-24 10:36:45 -08:00
Ronnie Sahlberg
2e126318ac New version 1.9.0
The main part of this release is the introduction of a new
CUnit based test tool for iscsi and scsi : iscsi-test-cu
This test tool will replace iscsi-test which will remain but will not
be expanded with any new tests.

Other changes include:
 - Add new CUnit based test tool: iscsi-test-cu to replace iscsi-test
 - Add tests for persistent reservation
 - Autotools updates
 - Add pkgconfig
2013-02-24 09:09:02 -08:00
Ronnie Sahlberg
50d1f68ef1 Update README and mention iscsi-test-cu 2013-02-24 09:07:02 -08:00
Ronnie Sahlberg
0a7e9a200b Makefile: Add two new headerfiles that are used for the test tools 2013-02-24 08:59:08 -08:00
Ronnie Sahlberg
286c5ecb90 Merge pull request #59 from bonzini/master
usual bunch of autotools fixes
2013-02-24 08:24:39 -08:00
Lee Duncan
8493ec5837 Added persistent reservation ownership tests.
Created tests for all persistent reservation types that
verifies reservation ownership based on reservation
type.
2013-02-24 08:19:30 -08:00
Lee Duncan
c4df17e794 minor cleanup of persistent reserve access test
Renamed helper function to not conflict with new
names, and cleaned up the include file list.
2013-02-24 08:03:37 -08:00
Paolo Bonzini
5bb67f0a0b remove libdir hack
This does not work with Debian (which uses lib32 or multiarch) nor
when cross-compiling.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-02-22 18:01:23 +01:00
Paolo Bonzini
466da447f3 do not include /usr/local/include path
This should be done using the COMPILER_PATH environment variable
if needed (in .bashrc), but should not really be needed at all.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-02-22 18:01:22 +01:00
Paolo Bonzini
a5fd68472e distribute pkgconfig file
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-02-22 18:01:22 +01:00
Ronnie Sahlberg
473172813b TEST: Add ORWRITE test to the READONLY device test 2013-02-19 19:32:01 -08:00
Ronnie Sahlberg
41754b45e8 TESTS: Add tests for ORWRITE 2013-02-19 19:30:51 -08:00
Ronnie Sahlberg
100fcd796d Add ASCQ code for CAPACITY_DATA_HAS_CHANGED 2013-02-19 17:59:45 -08:00
Ronnie Sahlberg
fc1b2697d4 TESTS: Add tests for WRITEVERIFY10/12/16 2013-02-18 20:16:41 -08:00
Ronnie Sahlberg
02010f9157 TESTS: Add tests that medium changing commands fail for readonly devices 2013-02-18 19:28:53 -08:00
Ronnie Sahlberg
5fe7eb573c TESTS: Add beyond eol test for GET_LBA_STATUS 2013-02-18 18:11:05 -08:00
Lee Duncan
07bb4d04d2 ported group reservation access control test to CUnit
Ported group reservation access control test to CUnit format.
This is the final group reservation test to be ported.
2013-02-18 06:58:34 -08:00
Lee Duncan
9b436eee2f ported 3 more group reservation tests to CUnit
Ported 3 more group reservation tests to new the CUnit format.
2013-02-18 06:58:04 -08:00
Lee Duncan
99ef5c6495 group reservation tests logging and cleanup
Converted group reservation functions to use loggin(), and
cleaned up those functions a little as well.
2013-02-18 06:57:36 -08:00
Lee Duncan
9d46353a62 Added dataloss checks for prout_* functions
Added "--data-loss" check for prout_*() functions.
2013-02-18 06:57:03 -08:00