Commit Graph

827 Commits

Author SHA1 Message Date
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
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
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
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
Ronnie Sahlberg
8ffd78c117 temp: redo the write10/12/16 commands to the new saner api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:07:57 -07:00
Ronnie Sahlberg
8aefc7d579 TEST: update all the verify tests to a new API
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:07:55 -07:00
Ronnie Sahlberg
138939cb0e TESTS: change ORWRITE to use a single helper function for all
Switch orwrite helpers to use _command_async instead of calling _orwrite_sync()
to prepare for switching to non-iscsi targets. Use the new check_result API
so that we only need a single helper function for ORWRITE instead of one
helper for each expected result.

Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:07:52 -07:00
Ronnie Sahlberg
905695575f TESTS: add a new helper check_result to validate the result of SCSI helpers
Many/most all SCSI helpers do pretty much the same checking for the SCSI
result and status. Break this out into a separate helper that we can use
to reduce code duplication.

Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
2014-09-18 12:07:49 -07:00
Ronnie Sahlberg
2dccc96160 Merge pull request #134 from plieven/fix_inquiry
test-tool: fix Inquiry.AllocLength
2014-08-21 18:50:12 -07:00
Ronnie Sahlberg
4650f47d63 Merge pull request #132 from plieven/test_lbas_check_desc
Some improvements for the get_lba_status tests.
2014-08-21 18:49:56 -07:00
Sitsofe Wheeler
3bac2a0e17 Add ULL suffix to large integer literals
When trying to compile libiscsi on a 32 bit Ubuntu 10.04 with gcc 4.4.3
errors like the following are produced:

test_get_lba_status_beyond_eol.c:45: error: integer constant is too
large for ‘long’ type

This is because we don't specify that we are explictly compiling to the
c99 standard and as such gcc defaults to gnu90 standard. This in turn
means the maximum default type of integer literals is unsigned long int
which not big enough to hold the literal on a 32 bit architecture.

Fix this by adding the ULL suffix to all large integer literals.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2014-08-21 18:04:37 +01:00
Bart Van Assche
ad5872c1d5 Fix test_writesame1[06]_unmap_unaligned()
As far as I know SPC-4 does not allow unaligned unmap requests to
fail. The only phrase I found in SPC-4 about unaligned unmap
requests is the following: "An unmap request with a starting LBA
that is not optimal may result in unmap operations on fewer LBAs
than requested." Hence check that unaligned unmap requests succeed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-21 06:43:40 -07:00
Bart Van Assche
ded75ae18a Fix WRITE SAME data buffer length handling
From the SPC-4 paragraph about WRITE SAME(10): "The WRITE SAME (10)
command requests that the device server transfer a single logical
block from the Data-Out Buffer [ ... ]". Hence always pass a data
buffer when sending a WRITE SAME(10) command.

Set the NDOB bit in the WRITE SAME(16) command if no data out buffer
is present.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-21 06:42:49 -07:00
Bart Van Assche
e8c4be8f62 test_writesame16_0blocks: Add support for WSNZ=1
Support for WRITE SAME with NUMBER OF LOGICAL BLOCKS = 0 is optional.
Hence set NUMBER OF LOGICAL BLOCKS to 0 if this value is supported
and set this parameter to 1 otherwise.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-21 06:40:51 -07:00
Bart Van Assche
d4ac9ef1b5 Skip test_writesame1[06]_unmap large len test for small disks
Only perform the test with 65536 blocks on block devices with at
least that number of blocks. Fix the 65536 block test log message.
Generalize the WRITE SAME(10) 256-block test log messages. Fix
interpretation of the MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT field.
A quote from SPC-4: "If there is no limit on the number of UNMAP
block descriptors contained in the parameter data, then the device
server shall set the MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT field to
FFFF_FFFFh."

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-21 06:40:21 -07:00
Peter Lieven
1f900054e1 test-tool: fix Inquiry.AllocLength
according to SBC-2 the alloc length should be at least 5 when
evpd is set to zero.

Also don't leak task if SPC-3 or later.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-08-13 18:53:52 +02:00
Peter Lieven
f3ce541463 test-tool: fix GetLBAStatus.Simple exit
if GetLBAStatus fails immediately exit the test.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-08-13 17:58:32 +02:00
Peter Lieven
a2592bff3a test-tool: improve GetLBAStatus.UnmapSingle
the test became nearly useless when reverting most
of its contents in commit 7d96336.

This patch adds some useful stuff back. While
we can't check that unmapped blocks are deallocated
we still can check that the blocks surrounding the
unmapped area don't get dealloaced.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-08-13 17:55:09 +02:00