Commit Graph

1291 Commits

Author SHA1 Message Date
Bart Van Assche
fe9620092c test tool: Detect unsupported opcodes correctly
There is no agreement among the T10 committee whether a SCSI target should
report "invalid opcode", "invalid field in CDB" or "invalid field in
parameter list" if the opcode consists of two bytes. Hence accept all three
sense codes for two-byte opcodes. For more information see also Frederick
Knight, RE: INVALID COMMAND OPERATION CODE, T10 Reflector, 16 May 2008
(http://t10.org/ftp/t10/t10r/2008/r0805167.htm).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:51:56 -07:00
Bart Van Assche
30355f8cc0 test_inquiry_block_limits: Only query VPD page B2h if LBPME = 1
In the READ CAPACITY response support for logical block provisioning
is indicated via the LBPME (logical block provisioning management
enabled) bit. Since the logical block provisioning VPD page (B2h)
is optional, only query it if LBPME = 1.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:03:45 -07:00
Bart Van Assche
eee66727a7 test_iscsi_datasn_invalid: Make terminology consistent with RFC 3720
According to RFC 3720 the data associated with a SCSI WRITE command
is sent via Data-Out PDU's. Update log texts accordingly and also
make the capitalization of DataSN consistent with RFC 3720.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 18:02:48 -07:00
Bart Van Assche
0763dc5743 libiscsi: Clear PS bit before sending MODE SELECT
A quote from SPC-4: "When using the MODE SENSE command, a
parameters saveable (PS) bit set to one indicates that the mode
page may be saved by the logical unit in a nonvolatile, vendor
specific location. A PS bit set to zero indicates that the device
server is not able to save the supported parameters. When using
the MODE SELECT command, the PS bit is reserved."

Hence clear the PS bit after having queried a mode page via MODE
SENSE and before changing it via MODE SELECT.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 17:56:40 -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
d411f12bbc TESTS: tweak inquiry blocklimits test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 12:54:34 -07:00
Ronnie Sahlberg
f3205bb095 scsi-lowlevel.c: check that task/datain are valid before we unmarshalling
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 09:49:52 -07:00
Ronnie Sahlberg
edbfb12232 TESTS: Allow inquiry data to contain padding IFF it is all zero
Some implementations may send oversized data coming back from Inquiry.
Warn about this instead of failing the test but then perform additional
checks that the padding MUST be zero or else fail the test.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-27 09:27:02 -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
0666691b2a TESTS: pass an actual block to the ritesame16/0blocks test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 20:57:59 -07:00
Ronnie Sahlberg
5f9444b91a libiscsi.def: we do not need to specify scsi_cdb_compareandwrite twice
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 17:27:08 -07:00
Ronnie Sahlberg
ed238f1e69 Merge branch 'master' into sgio 2014-09-23 17:26:02 -07:00
Ronnie Sahlberg
f6d57ef3b0 connect.c: remove UA whitelist and just consume up to 10 UAs before failing
Lets not use a whitelist of UnitAttentions that we consume during the connect
phase. Instead we can just loop and fail after the 10th.
If there are more than 10 UAs then we have a problem, otherwise
just consume them all, forget them  and then pass control back to the caller.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-23 17:23:27 -07:00
Ronnie Sahlberg
47d7e4b0ac TESTS: make sure ascq_ok is initialized
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:30:40 -07:00
Ronnie Sahlberg
839276dd7c TESTS: fix memory leaks in report supported opcodes tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:24:41 -07:00
Ronnie Sahlberg
264ea509c8 iscsi-support.c: fix memory leaks. Thanks valgrind, you rock
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:14:51 -07:00
Ronnie Sahlberg
38798e2090 initialize task->datain.data to keep valgrind happy
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 15:10:38 -07:00
Ronnie Sahlberg
2af45d9ad4 initialize sense to keep valgrind happy
valgrind does not know that sense will be initialized by the ioctl
so we need to to it explicitely to keep it from warning us.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 14:58:12 -07:00
Ronnie Sahlberg
f2904be1f6 Typo
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-21 14:19:58 -07:00
Ronnie Sahlberg
ef20220ac2 iscsi-test-cy.c: drop READ6 from the linux tests. it is obsolete 2014-09-21 14:19:35 -07:00
Ronnie Sahlberg
d11e4175f7 TESTS: Dont memcpy if task==NULL
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 17:33:21 -07:00
Ronnie Sahlberg
1e3cc445c8 TESTS: Remove some tests that wont work yet for /dev/sg
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 17:15:48 -07:00
Ronnie Sahlberg
59817c7959 TESTS: rename the old and abandoned scsi-usb-sbc testsuite to LINUX
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 16:33:03 -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
bd6570c324 TESTS: create an abstraction to connect to a device
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-19 06:26:53 -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
5efc7bf925 TESTS: create a helper/wrapper for sending scsi commands
Create a wrapper for sending scsi_commands so that we can hide the
libiscsi function far away from the "opcode" helpers.
This means we only have a single place later to switch to a different
type of device, such as a SG_IO one.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:52:08 -07:00
Ronnie Sahlberg
74a50052cd TESTS: get rid of iscsic2
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 18:37:35 -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
Ronnie Sahlberg
9b768f7de9 TESTS: move the default url, lun and iscsi context into a structure
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 16:42:45 -07:00
Ronnie Sahlberg
40de7d95a9 Configure: add a test for SG_IO
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 14:26:03 -07:00
Ronnie Sahlberg
f015ab095a TESTS: update reportsupportedopcodes to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
9be6ddaf09 TESTS: update inquiry to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
398f03205d TESTS: update unmap to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
832d88797a TESTS: remove the read10_task helper
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
9e75b10103 TESTS: change get_lba_status to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
fd21a8f2c4 TESTS: convert readcapacity to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
46eaa7dcc3 TESTS: convert compareandwrite to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
44d88e3bc6 TESTS: update synchronizecache to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
1c14b9b911 TESTS: update read6 to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:22 -07:00
Ronnie Sahlberg
3ee3964332 TESTS: change testunitready to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 14:07:21 -07:00
Ronnie Sahlberg
fe11a6178b TESTS: add ASCQ check to miscompare
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 13:12:59 -07:00
Ronnie Sahlberg
f1d198c684 TESTS: update startstopunit to use new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 13:12:58 -07:00
Ronnie Sahlberg
28b0a0ab11 TESTS: update the READ tests to the new API
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 13:12:58 -07:00
Ronnie Sahlberg
900ce145ad libiscsi.def: add missing scsi_cdb_compareandwrite and scs_malloc symbols
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 12:11:50 -07:00
Ronnie Sahlberg
4b2e9bd417 TESTS: update the prefetch tests to the new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:08:02 -07:00
Ronnie Sahlberg
8585e4509b TESTS: update writesame tests to new API
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:08:01 -07:00
Ronnie Sahlberg
d3f98dfdd5 TESTS: rework WRITEVERIFY* tests to the new API
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:07:59 -07:00